From 2aa1d86e9da0100e13f05faff6330c973451780e Mon Sep 17 00:00:00 2001 From: Cyrille Pitchen Date: Fri, 31 May 2024 14:22:14 +0200 Subject: [PATCH] configs: replace some configs on SAMA7D6 SoCs, which have only 2 overlays SAMA7D6 SoCs have only 2 overlays and a primary plane, whereas some configs expect a third overlay. Hence, such configs are discarded for SAMA7D6 SoCs and replaced with new adapted configs, named with the '_2overlays.config' suffix. Signed-off-by: Nicolas Ferre [cyrille.pitchen@microchip.com: adapted from Nicolas' original patch] Signed-off-by: Cyrille Pitchen --- configs/pan_2overlays.config | 46 +++++++++++++++++ configs/parallax_2overlays.config | 86 +++++++++++++++++++++++++++++++ configs/scale_2overlays.config | 48 +++++++++++++++++ configs/window_2overlays.config | 46 +++++++++++++++++ scripts/planes-loop.py | 11 +++- 5 files changed, 235 insertions(+), 2 deletions(-) create mode 100644 configs/pan_2overlays.config create mode 100644 configs/parallax_2overlays.config create mode 100644 configs/scale_2overlays.config create mode 100644 configs/window_2overlays.config diff --git a/configs/pan_2overlays.config b/configs/pan_2overlays.config new file mode 100644 index 0000000..fe223b4 --- /dev/null +++ b/configs/pan_2overlays.config @@ -0,0 +1,46 @@ +{ + "planes": [ + { + "type": "primary", + "format": "DRM_FORMAT_ARGB8888", + "image": "background1.png" + }, + { + "type": "overlay", + "index": 1, + "x": "(SCREEN_WIDTH / 2) - (physicalw(300) / 2)", + "y": "physicalh(90)", + "width": "physicalw(1580)", + "height": "physicalh(480)", + "format": "DRM_FORMAT_ARGB8888", + "image": "view.png", + "pan-x": 0, + "pan-y": "physicalh(40)", + "pan-width": "physicalw(300)", + "pan-height": "physicalh(300)", + "move-type": [ "panx-bounce","y-bounce-custom" ], + "move-xspeed": 2, + "move-yspeed": 2, + "move-panxspeed": 2, + "move-ymax": "physicalh(180)", + "move-ymin": 0 + }, + { + "type": "overlay", + "index": 0, + "format": "DRM_FORMAT_ARGB8888", + "x": 0, + "y": 0, + "width": "SCREEN_WIDTH", + "height": "SCREEN_HEIGHT", + "pattern": [ "0x00000000" ], + "text": { + "str": "Moving Overlay Pan", + "x": "physicalw(10)", + "y": "SCREEN_HEIGHT-physicalh(10)", + "color": "0xffffffff", + "size": "physicalw(24)" + } + } + ] +} diff --git a/configs/parallax_2overlays.config b/configs/parallax_2overlays.config new file mode 100644 index 0000000..b0e9ec2 --- /dev/null +++ b/configs/parallax_2overlays.config @@ -0,0 +1,86 @@ +{ + "planes": [ + { + "type": "primary", + "format": "DRM_FORMAT_RGB565", + "image": "parallax0.png", + "text": { + "str": "3D Parallax Animation", + "x": "physicalw(520)", + "y": "physicalh(60 + 24)", + "color": "0xffffffff", + "size": "physicalw(24)" + } + }, + { + "type": "overlay", + "index": 1, + "x": 0, + "y": "physicalh(300)", + "width": "physicalw(1600)", + "height": "physicalh(180)", + "format": "DRM_FORMAT_ARGB8888", + "image": "parallax2.png", + "pan-x": 0, + "pan-y": 0, + "pan-width": "physicalw(800)", + "pan-height": "physicalh(180)", + "move-type": ["panx-warp"], + "move-panxspeed": 2 + }, + { + "enabled": true, + "type": "overlay", + "format": "DRM_FORMAT_ARGB8888", + "index": 0, + "x": "(SCREEN_WIDTH / 2) - (physicalw(113) / 2)", + "y": "physicalh(315)", + "width": "physicalw(1000)", + "height": "physicalh(260)", + "image": "ninja.png", + "sprite-x": "physicalw(15)", + "sprite-y": "physicalh(122)", + "sprite-width": "physicalw(113)", + "sprite-height": "physicalh(122)", + "sprite-count": 6, + "sprite-speed": 4, + "move-type": ["sprite"] + }, + { + "enabled": false, + "type": "overlay", + "format": "DRM_FORMAT_ARGB8888", + "index": 1, + "x": 350, + "y": 320, + "width": 600, + "height": 481, + "image": "mouse.png", + "sprite-x": 0, + "sprite-y": 97, + "sprite-width": 120, + "sprite-height": 97, + "sprite-count": 8, + "sprite-speed": 6, + "move-type": ["sprite"] + }, + { + "enabled": false, + "type": "overlay", + "format": "DRM_FORMAT_ARGB8888", + "index": 1, + "x": 350, + "y": 320, + "width": 600, + "height": 481, + "image": "mouse.png", + "sprite-x": 0, + "sprite-y": 0, + "sprite-width": 120, + "sprite-height": 97, + "sprite-count": 2, + "sprite-speed": 10, + "move-type": ["sprite"] + } + ] +} diff --git a/configs/scale_2overlays.config b/configs/scale_2overlays.config new file mode 100644 index 0000000..8eecd15 --- /dev/null +++ b/configs/scale_2overlays.config @@ -0,0 +1,48 @@ +{ + "framedelay": 20, + "planes": [ + { + "type": "primary", + "format": "DRM_FORMAT_ARGB8888", + "image": "background4.png" + }, + { + "type": "overlay", + "index": 1, + "format": "DRM_FORMAT_XRGB8888", + "image": "mars.png", + "x": "(SCREEN_WIDTH / 2) - (physicalw(400) / 2)", + "y": "(SCREEN_HEIGHT / 2) - (physicalh(240) / 2)", + "width": "physicalw(400)", + "height": "physicalh(240)", + "pattern": [ "0xff0000aa", "0x00ff00aa" ], + "move-type": [ "scaler", "y-bounce-custom", "x-bounce-custom" ], + "scaler-speed": 0.01, + "scaler-max": 1.0, + "scaler-min": 0.5, + "move-xspeed": 1, + "move-xmin": 0, + "move-xmax": "(SCREEN_WIDTH - physicalw(400))", + "move-yspeed": 1, + "move-ymin": 0, + "move-ymax": "(SCREEN_HEIGHT - physicalh(240))" + }, + { + "type": "overlay", + "index": 0, + "format": "DRM_FORMAT_ARGB8888", + "x": 0, + "y": 0, + "width": "SCREEN_WIDTH", + "height": "SCREEN_HEIGHT", + "pattern": [ "0x00000000" ], + "text": { + "str": "High End Overlay Scaling", + "x": "physicalw(10)", + "y": "SCREEN_HEIGHT-physicalh(10)", + "color": "0x000000ff", + "size": "physicalw(24)" + } + } + ] +} diff --git a/configs/window_2overlays.config b/configs/window_2overlays.config new file mode 100644 index 0000000..a39685e --- /dev/null +++ b/configs/window_2overlays.config @@ -0,0 +1,46 @@ +{ + "framedelay": 10, + "planes": [ + { + "type": "primary", + "format": "DRM_FORMAT_ARGB8888", + "image": "background3.png" + }, + { + "type": "overlay", + "index": 1, + "x": 0, + "y": 0, + "width": "SCREEN_WIDTH", + "height": "SCREEN_HEIGHT", + "format": "DRM_FORMAT_ARGB8888", + "image": "view2.png", + "pan-x": 0, + "pan-y": 0, + "pan-width": "SCREEN_WIDTH", + "pan-height": "SCREEN_HEIGHT/4", + "move-type": [ "pany-bounce", "y-bounce-custom" ], + "move-yspeed": 1, + "move-panyspeed": 1, + "move-ymax": "(SCREEN_HEIGHT/4) * 3", + "move-ymin": 0 + }, + { + "type": "overlay", + "index": 0, + "x": 0, + "y": "(SCREEN_HEIGHT/4) * 3", + "width": "SCREEN_WIDTH", + "height": "SCREEN_HEIGHT/4", + "pattern": [ "0x00000000" ], + "format": "DRM_FORMAT_ARGB8888", + "text": { + "str": "Overlay Window Panning", + "x": "physicalw(10)", + "y": "(SCREEN_HEIGHT/4)-physicalh(10)", + "color": "0xffffffff", + "size": "physicalw(24)" + } + } + ] +} diff --git a/scripts/planes-loop.py b/scripts/planes-loop.py index e08b724..db438ea 100755 --- a/scripts/planes-loop.py +++ b/scripts/planes-loop.py @@ -1,7 +1,6 @@ #!/usr/bin/env python from mpio import * -import glob import os import signal from threading import Thread @@ -17,8 +16,16 @@ def run(): if cpu() == 'at91sam9x5': configs = ["default.config", "alpha.config", "sprite.config", "alpha2.config", "paper.config", "rotate.config"] + elif cpu() == 'sama7d6': + configs = ["alpha.config", "alpha2.config", "default.config", + "pan_2overlays.config", "paper.config", "parallax_2overlays.config", + "rotate.config", "scale_2overlays.config", "sprite.config", + "window_2overlays.config"] else: - configs = glob.glob("*.config") + configs = ["alpha.config", "alpha2.config", "default.config", + "pan.config", "paper.config", "parallax.config", + "rotate.config", "scale.config", "sprite.config", + "window.config"] while not abort: for config in configs: proc = Popen(["planes", "-f", "500", "-c", config], close_fds=True)