diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2020-02-14 13:29:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-14 13:29:43 +0200 |
commit | 7c5e645112a899ad018219365c3898b0e896353f (patch) | |
tree | bf433d405c0b26c188153c9f2958c04d35927406 /py/tests/global_alpha_test.py | |
parent | ada382fa5153dce6e4b8449c9e46c827c170eb95 (diff) | |
parent | 0891b9428b26a5ae208cc7cd1da70bd13eb688e9 (diff) |
Merge pull request #50 from jsarha/py-tests-tidss-updates-v3
Py tests tidss updates v3
Diffstat (limited to 'py/tests/global_alpha_test.py')
-rwxr-xr-x | py/tests/global_alpha_test.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/py/tests/global_alpha_test.py b/py/tests/global_alpha_test.py index 6981b72..33fd12e 100755 --- a/py/tests/global_alpha_test.py +++ b/py/tests/global_alpha_test.py @@ -2,12 +2,22 @@ import pykms import time - +import argparse + +parser = argparse.ArgumentParser(description='Plane "alpha"-property test.') +parser.add_argument('--connector', '-c', dest='connector', default="", + required=False, help='connector to output') +parser.add_argument('--mode', '-m', dest='modename', + required=False, help='Video mode name to use') +args = parser.parse_args() card = pykms.Card() res = pykms.ResourceManager(card) -conn = res.reserve_connector("") +conn = res.reserve_connector(args.connector) crtc = res.reserve_crtc(conn) -mode = conn.get_default_mode() +if args.modename == None: + mode = conn.get_default_mode() +else: + mode = conn.get_mode(args.modename) modeb = mode.to_blob(card) format = pykms.PixelFormat.ARGB8888 plane1 = res.reserve_generic_plane(crtc, format) @@ -24,6 +34,8 @@ pykms.draw_test_pattern(fb2); alpha = 0 +card.disable_planes() + req = pykms.AtomicReq(card) req.add(conn, "CRTC_ID", crtc.id) req.add(crtc, {"ACTIVE": 1, @@ -34,13 +46,16 @@ req.add_plane(plane2, fb2, crtc) r = req.commit_sync(allow_modeset = True) assert r == 0, "Initial commit failed: %d" % r +input("press enter start\n") + while alpha <= 0xFFFF: print("alpha %d" % (alpha >> 8)) req = pykms.AtomicReq(card) req.add(plane2, {"alpha": alpha }) r = req.commit_sync() assert r == 0, "alpha change commit failed: %d" % r - alpha = alpha + 0xFF - time.sleep(0.1) + alpha = alpha + 0x101 + time.sleep(0.03) input("press enter exit\n") +card.disable_planes() |