diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2017-01-02 16:42:09 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-01-03 10:46:42 +0200 |
commit | f1a098203be8c44a52ed5d2a72982a3f634d4df6 (patch) | |
tree | c916f481fb22a3002d56541346b15532fe46da83 /py/tests/trans-test.py | |
parent | b11baff09f78a4a383f817ec35208ae8966ab832 (diff) |
py: Move helpers to the pykms module
Instead of forcing applications to import the helpers manually, move
them to pykms by turning it into a python module.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'py/tests/trans-test.py')
-rwxr-xr-x | py/tests/trans-test.py | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/py/tests/trans-test.py b/py/tests/trans-test.py index 8c1f964..c2d08c1 100755 --- a/py/tests/trans-test.py +++ b/py/tests/trans-test.py @@ -1,7 +1,6 @@ #!/usr/bin/python3 import pykms -from helpers import * import time # This hack makes drm initialize the fbcon, setting up the default connector @@ -20,7 +19,7 @@ for p in card.planes: continue planes.append(p) -disable_planes(card) +card.disable_planes() w = mode.hdisplay h = mode.vdisplay @@ -41,7 +40,7 @@ def test_am5_trans_dest(): pykms.draw_rect(fb, 0, 0, fb.width, fb.height, cyan) pykms.draw_rect(fb, 250, 100, 200, 200, yellow) - set_props(crtc, { + crtc.set_props({ "trans-key-mode": 1, "trans-key": purple.rgb888, "background": 0, @@ -55,7 +54,7 @@ def test_am5_trans_dest(): plane = planes[i] fb = fbs[i] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_W": fb.width << 16, @@ -80,7 +79,7 @@ def test_am5_trans_src(): pykms.draw_rect(fb, 0, 0, fb.width, fb.height, cyan) pykms.draw_rect(fb, 100, 100, 500, 500, purple) - set_props(crtc, { + crtc.set_props({ "trans-key-mode": 2, "trans-key": purple.rgb888, "background": 0, @@ -94,7 +93,7 @@ def test_am5_trans_src(): plane = planes[i] fb = fbs[i] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_W": fb.width << 16, @@ -123,7 +122,7 @@ def test_am4_normal_trans_dst(): fb = fbs[2] pykms.draw_rect(fb, 0, 0, fb.width, fb.height, cyan) - set_props(crtc, { + crtc.set_props({ "trans-key-mode": 1, "trans-key": purple.rgb888, "background": 0, @@ -134,7 +133,7 @@ def test_am4_normal_trans_dst(): plane = planes[0] fb = fbs[0] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_W": fb.width << 16, @@ -147,7 +146,7 @@ def test_am4_normal_trans_dst(): plane = planes[1] fb = fbs[1] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_X": 0 << 16, @@ -164,7 +163,7 @@ def test_am4_normal_trans_dst(): plane = planes[2] fb = fbs[2] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_X": 0 << 16, @@ -195,7 +194,7 @@ def test_am4_normal_trans_src(): pykms.draw_rect(fb, 0, 0, fb.width, fb.height, cyan) pykms.draw_rect(fb, 100, 100, fb.width - 200, fb.height - 200, purple) - set_props(crtc, { + crtc.set_props({ "trans-key-mode": 2, "trans-key": purple.rgb888, "background": 0, @@ -206,7 +205,7 @@ def test_am4_normal_trans_src(): plane = planes[0] fb = fbs[0] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_W": fb.width << 16, @@ -219,7 +218,7 @@ def test_am4_normal_trans_src(): plane = planes[1] fb = fbs[1] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_X": 0 << 16, @@ -236,7 +235,7 @@ def test_am4_normal_trans_src(): plane = planes[2] fb = fbs[2] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_X": 0 << 16, @@ -267,7 +266,7 @@ def test_am4_alpha_trans_src(): pykms.draw_rect(fb, 0, 0, fb.width, fb.height, cyan) pykms.draw_rect(fb, 100, 100, fb.width - 200, fb.height - 200, purple) - set_props(crtc, { + crtc.set_props({ "trans-key-mode": 1, "trans-key": purple.rgb888, "background": 0, @@ -278,7 +277,7 @@ def test_am4_alpha_trans_src(): plane = planes[0] fb = fbs[0] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_W": fb.width << 16, @@ -291,7 +290,7 @@ def test_am4_alpha_trans_src(): plane = planes[1] fb = fbs[1] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_X": 0 << 16, @@ -308,7 +307,7 @@ def test_am4_alpha_trans_src(): plane = planes[2] fb = fbs[2] - set_props(plane, { + plane.set_props({ "FB_ID": fb.id, "CRTC_ID": crtc.id, "SRC_X": 0 << 16, |