Skip to content

Commit

Permalink
configs: replace some configs on SAMA7D6 SoCs, which have only 2 over…
Browse files Browse the repository at this point in the history
…lays

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 <[email protected]>
[[email protected]: adapted from Nicolas' original patch]
Signed-off-by: Cyrille Pitchen <[email protected]>
  • Loading branch information
CyrillePitchen authored and ldesroches committed Jun 3, 2024
1 parent 12678b8 commit 2aa1d86
Show file tree
Hide file tree
Showing 5 changed files with 235 additions and 2 deletions.
46 changes: 46 additions & 0 deletions configs/pan_2overlays.config
Original file line number Diff line number Diff line change
@@ -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)"
}
}
]
}
86 changes: 86 additions & 0 deletions configs/parallax_2overlays.config
Original file line number Diff line number Diff line change
@@ -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"]
}
]
}
48 changes: 48 additions & 0 deletions configs/scale_2overlays.config
Original file line number Diff line number Diff line change
@@ -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)"
}
}
]
}
46 changes: 46 additions & 0 deletions configs/window_2overlays.config
Original file line number Diff line number Diff line change
@@ -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)"
}
}
]
}
11 changes: 9 additions & 2 deletions scripts/planes-loop.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python

from mpio import *
import glob
import os
import signal
from threading import Thread
Expand All @@ -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)
Expand Down

0 comments on commit 2aa1d86

Please sign in to comment.