Skip to content

Commit 2aa1d86

Browse files
CyrillePitchenldesroches
authored andcommitted
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 <[email protected]> [[email protected]: adapted from Nicolas' original patch] Signed-off-by: Cyrille Pitchen <[email protected]>
1 parent 12678b8 commit 2aa1d86

File tree

5 files changed

+235
-2
lines changed

5 files changed

+235
-2
lines changed

configs/pan_2overlays.config

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"planes": [
3+
{
4+
"type": "primary",
5+
"format": "DRM_FORMAT_ARGB8888",
6+
"image": "background1.png"
7+
},
8+
{
9+
"type": "overlay",
10+
"index": 1,
11+
"x": "(SCREEN_WIDTH / 2) - (physicalw(300) / 2)",
12+
"y": "physicalh(90)",
13+
"width": "physicalw(1580)",
14+
"height": "physicalh(480)",
15+
"format": "DRM_FORMAT_ARGB8888",
16+
"image": "view.png",
17+
"pan-x": 0,
18+
"pan-y": "physicalh(40)",
19+
"pan-width": "physicalw(300)",
20+
"pan-height": "physicalh(300)",
21+
"move-type": [ "panx-bounce","y-bounce-custom" ],
22+
"move-xspeed": 2,
23+
"move-yspeed": 2,
24+
"move-panxspeed": 2,
25+
"move-ymax": "physicalh(180)",
26+
"move-ymin": 0
27+
},
28+
{
29+
"type": "overlay",
30+
"index": 0,
31+
"format": "DRM_FORMAT_ARGB8888",
32+
"x": 0,
33+
"y": 0,
34+
"width": "SCREEN_WIDTH",
35+
"height": "SCREEN_HEIGHT",
36+
"pattern": [ "0x00000000" ],
37+
"text": {
38+
"str": "Moving Overlay Pan",
39+
"x": "physicalw(10)",
40+
"y": "SCREEN_HEIGHT-physicalh(10)",
41+
"color": "0xffffffff",
42+
"size": "physicalw(24)"
43+
}
44+
}
45+
]
46+
}

configs/parallax_2overlays.config

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"planes": [
3+
{
4+
"type": "primary",
5+
"format": "DRM_FORMAT_RGB565",
6+
"image": "parallax0.png",
7+
"text": {
8+
"str": "3D Parallax Animation",
9+
"x": "physicalw(520)",
10+
"y": "physicalh(60 + 24)",
11+
"color": "0xffffffff",
12+
"size": "physicalw(24)"
13+
}
14+
},
15+
{
16+
"type": "overlay",
17+
"index": 1,
18+
"x": 0,
19+
"y": "physicalh(300)",
20+
"width": "physicalw(1600)",
21+
"height": "physicalh(180)",
22+
"format": "DRM_FORMAT_ARGB8888",
23+
"image": "parallax2.png",
24+
"pan-x": 0,
25+
"pan-y": 0,
26+
"pan-width": "physicalw(800)",
27+
"pan-height": "physicalh(180)",
28+
"move-type": ["panx-warp"],
29+
"move-panxspeed": 2
30+
},
31+
{
32+
"enabled": true,
33+
"type": "overlay",
34+
"format": "DRM_FORMAT_ARGB8888",
35+
"index": 0,
36+
"x": "(SCREEN_WIDTH / 2) - (physicalw(113) / 2)",
37+
"y": "physicalh(315)",
38+
"width": "physicalw(1000)",
39+
"height": "physicalh(260)",
40+
"image": "ninja.png",
41+
"sprite-x": "physicalw(15)",
42+
"sprite-y": "physicalh(122)",
43+
"sprite-width": "physicalw(113)",
44+
"sprite-height": "physicalh(122)",
45+
"sprite-count": 6,
46+
"sprite-speed": 4,
47+
"move-type": ["sprite"]
48+
},
49+
{
50+
"enabled": false,
51+
"type": "overlay",
52+
"format": "DRM_FORMAT_ARGB8888",
53+
"index": 1,
54+
"x": 350,
55+
"y": 320,
56+
"width": 600,
57+
"height": 481,
58+
"image": "mouse.png",
59+
"sprite-x": 0,
60+
"sprite-y": 97,
61+
"sprite-width": 120,
62+
"sprite-height": 97,
63+
"sprite-count": 8,
64+
"sprite-speed": 6,
65+
"move-type": ["sprite"]
66+
},
67+
{
68+
"enabled": false,
69+
"type": "overlay",
70+
"format": "DRM_FORMAT_ARGB8888",
71+
"index": 1,
72+
"x": 350,
73+
"y": 320,
74+
"width": 600,
75+
"height": 481,
76+
"image": "mouse.png",
77+
"sprite-x": 0,
78+
"sprite-y": 0,
79+
"sprite-width": 120,
80+
"sprite-height": 97,
81+
"sprite-count": 2,
82+
"sprite-speed": 10,
83+
"move-type": ["sprite"]
84+
}
85+
]
86+
}

configs/scale_2overlays.config

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"framedelay": 20,
3+
"planes": [
4+
{
5+
"type": "primary",
6+
"format": "DRM_FORMAT_ARGB8888",
7+
"image": "background4.png"
8+
},
9+
{
10+
"type": "overlay",
11+
"index": 1,
12+
"format": "DRM_FORMAT_XRGB8888",
13+
"image": "mars.png",
14+
"x": "(SCREEN_WIDTH / 2) - (physicalw(400) / 2)",
15+
"y": "(SCREEN_HEIGHT / 2) - (physicalh(240) / 2)",
16+
"width": "physicalw(400)",
17+
"height": "physicalh(240)",
18+
"pattern": [ "0xff0000aa", "0x00ff00aa" ],
19+
"move-type": [ "scaler", "y-bounce-custom", "x-bounce-custom" ],
20+
"scaler-speed": 0.01,
21+
"scaler-max": 1.0,
22+
"scaler-min": 0.5,
23+
"move-xspeed": 1,
24+
"move-xmin": 0,
25+
"move-xmax": "(SCREEN_WIDTH - physicalw(400))",
26+
"move-yspeed": 1,
27+
"move-ymin": 0,
28+
"move-ymax": "(SCREEN_HEIGHT - physicalh(240))"
29+
},
30+
{
31+
"type": "overlay",
32+
"index": 0,
33+
"format": "DRM_FORMAT_ARGB8888",
34+
"x": 0,
35+
"y": 0,
36+
"width": "SCREEN_WIDTH",
37+
"height": "SCREEN_HEIGHT",
38+
"pattern": [ "0x00000000" ],
39+
"text": {
40+
"str": "High End Overlay Scaling",
41+
"x": "physicalw(10)",
42+
"y": "SCREEN_HEIGHT-physicalh(10)",
43+
"color": "0x000000ff",
44+
"size": "physicalw(24)"
45+
}
46+
}
47+
]
48+
}

configs/window_2overlays.config

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"framedelay": 10,
3+
"planes": [
4+
{
5+
"type": "primary",
6+
"format": "DRM_FORMAT_ARGB8888",
7+
"image": "background3.png"
8+
},
9+
{
10+
"type": "overlay",
11+
"index": 1,
12+
"x": 0,
13+
"y": 0,
14+
"width": "SCREEN_WIDTH",
15+
"height": "SCREEN_HEIGHT",
16+
"format": "DRM_FORMAT_ARGB8888",
17+
"image": "view2.png",
18+
"pan-x": 0,
19+
"pan-y": 0,
20+
"pan-width": "SCREEN_WIDTH",
21+
"pan-height": "SCREEN_HEIGHT/4",
22+
"move-type": [ "pany-bounce", "y-bounce-custom" ],
23+
"move-yspeed": 1,
24+
"move-panyspeed": 1,
25+
"move-ymax": "(SCREEN_HEIGHT/4) * 3",
26+
"move-ymin": 0
27+
},
28+
{
29+
"type": "overlay",
30+
"index": 0,
31+
"x": 0,
32+
"y": "(SCREEN_HEIGHT/4) * 3",
33+
"width": "SCREEN_WIDTH",
34+
"height": "SCREEN_HEIGHT/4",
35+
"pattern": [ "0x00000000" ],
36+
"format": "DRM_FORMAT_ARGB8888",
37+
"text": {
38+
"str": "Overlay Window Panning",
39+
"x": "physicalw(10)",
40+
"y": "(SCREEN_HEIGHT/4)-physicalh(10)",
41+
"color": "0xffffffff",
42+
"size": "physicalw(24)"
43+
}
44+
}
45+
]
46+
}

scripts/planes-loop.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22

33
from mpio import *
4-
import glob
54
import os
65
import signal
76
from threading import Thread
@@ -17,8 +16,16 @@ def run():
1716
if cpu() == 'at91sam9x5':
1817
configs = ["default.config", "alpha.config", "sprite.config",
1918
"alpha2.config", "paper.config", "rotate.config"]
19+
elif cpu() == 'sama7d6':
20+
configs = ["alpha.config", "alpha2.config", "default.config",
21+
"pan_2overlays.config", "paper.config", "parallax_2overlays.config",
22+
"rotate.config", "scale_2overlays.config", "sprite.config",
23+
"window_2overlays.config"]
2024
else:
21-
configs = glob.glob("*.config")
25+
configs = ["alpha.config", "alpha2.config", "default.config",
26+
"pan.config", "paper.config", "parallax.config",
27+
"rotate.config", "scale.config", "sprite.config",
28+
"window.config"]
2229
while not abort:
2330
for config in configs:
2431
proc = Popen(["planes", "-f", "500", "-c", config], close_fds=True)

0 commit comments

Comments
 (0)