From 4ddd0d2ea64b452dbf2c6670356a29c3e05ff047 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 12 Jan 2018 14:55:09 +0200 Subject: alpha-test.py: fix --- py/tests/alpha-test.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/py/tests/alpha-test.py b/py/tests/alpha-test.py index 5873612..9ae1539 100755 --- a/py/tests/alpha-test.py +++ b/py/tests/alpha-test.py @@ -3,10 +3,6 @@ import pykms import time -# 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() @@ -14,14 +10,15 @@ crtc = res.reserve_crtc(conn) mode = conn.get_default_mode() planes = [] -for p in card.planes: - if p.supports_crtc(crtc) == False: - continue - planes.append(p) -if len(planes) != 3: - print("Need 3 planes!") - exit(1) +for i in range(3): + p = res.reserve_generic_plane(crtc) + + if p == None: + print("Need 3 planes!") + exit(1) + + planes.append(p) card.disable_planes() @@ -37,7 +34,6 @@ pykms.draw_rect(fbs[0], 50, 50, 200, 200, pykms.RGB(128, 255, 0, 0)) pykms.draw_rect(fbs[1], 150, 50, 200, 200, pykms.RGB(128, 0, 255, 0)) pykms.draw_rect(fbs[2], 50, 150, 200, 200, pykms.RGB(128, 0, 0, 255)) - crtc.set_props({ "trans-key-mode": 0, "trans-key": 0, -- cgit v1.2.3