summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-04-10 11:17:20 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-04-10 11:17:35 +0300
commit28cab7063328f02abc5f31c0ef79017c3127ee57 (patch)
treea4b87a3460d2c4675f848e0783f8898f70f123ca /py
parentaa8fbbe58e3d7fc7ec5ec0a3b3d9ae25c915f1f2 (diff)
test.py: use atomic modesetting
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'py')
-rwxr-xr-xpy/tests/test.py33
1 files changed, 31 insertions, 2 deletions
diff --git a/py/tests/test.py b/py/tests/test.py
index b11add7..b7bf6bd 100755
--- a/py/tests/test.py
+++ b/py/tests/test.py
@@ -1,5 +1,6 @@
#!/usr/bin/python3
+import sys
import pykms
# draw test pattern via dmabuf?
@@ -13,10 +14,17 @@ if omap:
else:
card = pykms.Card()
+if len(sys.argv) > 1:
+ conn_name = sys.argv[1]
+else:
+ conn_name = ""
+
res = pykms.ResourceManager(card)
-conn = res.reserve_connector()
+conn = res.reserve_connector(conn_name)
crtc = res.reserve_crtc(conn)
+plane = res.reserve_generic_plane(crtc)
mode = conn.get_default_mode()
+modeb = mode.to_blob(card)
if omap:
origfb = pykms.OmapFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24");
@@ -31,6 +39,27 @@ else:
pykms.draw_test_pattern(fb);
-crtc.set_mode(conn, fb, mode)
+card.disable_planes()
+
+req = pykms.AtomicReq(card)
+
+req.add(conn, "CRTC_ID", crtc.id)
+
+req.add(crtc, {"ACTIVE": 1,
+ "MODE_ID": modeb.id})
+
+req.add(plane, {"FB_ID": fb.id,
+ "CRTC_ID": crtc.id,
+ "SRC_X": 0 << 16,
+ "SRC_Y": 0 << 16,
+ "SRC_W": mode.hdisplay << 16,
+ "SRC_H": mode.vdisplay << 16,
+ "CRTC_X": 0,
+ "CRTC_Y": 0,
+ "CRTC_W": mode.hdisplay,
+ "CRTC_H": mode.vdisplay,
+ "zorder": 0})
+
+req.commit_sync(allow_modeset = True)
input("press enter to exit\n")