From 719f72a065f07c59e77a25b1f23daccb5369cf81 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 31 May 2017 12:42:51 +0300 Subject: cam.py: fix initial modeset --- py/tests/cam.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'py') diff --git a/py/tests/cam.py b/py/tests/cam.py index 57d0c1a..c813b2f 100755 --- a/py/tests/cam.py +++ b/py/tests/cam.py @@ -8,11 +8,6 @@ w = 640 h = 480 fmt = pykms.PixelFormat.YUYV - -# This hack makes drm initialize the fbcon, setting up the default connector -card = pykms.Card() -card = 0 - card = pykms.Card() res = pykms.ResourceManager(card) conn = res.reserve_connector() @@ -20,6 +15,13 @@ crtc = res.reserve_crtc(conn) plane = res.reserve_overlay_plane(crtc, fmt) mode = conn.get_default_mode() +modeb = mode.to_blob(card) + +req = pykms.AtomicReq(card) +req.add(conn, "CRTC_ID", crtc.id) +req.add(crtc, {"ACTIVE": 1, + "MODE_ID": modeb.id}) +req.commit_sync(allow_modeset = True) NUM_BUFS = 5 -- cgit v1.2.3