diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-06-14 22:20:50 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-06-16 21:45:26 +0300 |
commit | 7881bfd6586bd8ffa9b766cdba332c7a1015c9dd (patch) | |
tree | 1fe85dcc749aa5762ca342c2d94e28c245309efe | |
parent | 84d89b1659b6eb3e7707f2fe107b9cada516f053 (diff) |
py: use ResourceManager
-rwxr-xr-x | py/alpha-test.py | 6 | ||||
-rwxr-xr-x | py/db.py | 5 | ||||
-rwxr-xr-x | py/functest.py | 7 | ||||
-rwxr-xr-x | py/gamma.py | 6 | ||||
-rw-r--r-- | py/helpers.py | 12 | ||||
-rwxr-xr-x | py/iact.py | 7 | ||||
-rwxr-xr-x | py/test.py | 7 | ||||
-rwxr-xr-x | py/trans-test.py | 6 |
8 files changed, 21 insertions, 35 deletions
diff --git a/py/alpha-test.py b/py/alpha-test.py index 113fab0..c6ec8ee 100755 --- a/py/alpha-test.py +++ b/py/alpha-test.py @@ -9,10 +9,10 @@ card = pykms.Card() card = 0 card = pykms.Card() - -conn = card.get_first_connected_connector() +res = pykms.ResourceManager(card) +conn = res.reserve_connector() +crtc = res.reserve_crtc(conn) mode = conn.get_default_mode() -crtc = get_crtc_for_connector(conn) planes = [] for p in card.planes: @@ -41,9 +41,10 @@ class FlipHandler(pykms.PageFlipHandlerBase): card = pykms.Card() -conn = card.get_first_connected_connector() +res = pykms.ResourceManager(card) +conn = res.reserve_connector() +crtc = res.reserve_crtc(conn) mode = conn.get_default_mode() -crtc = get_crtc_for_connector(conn) fliphandler = FlipHandler() diff --git a/py/functest.py b/py/functest.py index c2548fa..44c29fb 100755 --- a/py/functest.py +++ b/py/functest.py @@ -4,16 +4,15 @@ import pykms from helpers import * card = pykms.Card() - -conn = card.get_first_connected_connector() +res = pykms.ResourceManager(card) +conn = res.reserve_connector() +crtc = res.reserve_crtc(conn) mode = conn.get_default_mode() fb = pykms.DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); pykms.draw_test_pattern(fb); -crtc = get_crtc_for_connector(conn) - crtc.set_mode(conn, fb, mode) print("OK") diff --git a/py/gamma.py b/py/gamma.py index e1daa43..a6b68cc 100755 --- a/py/gamma.py +++ b/py/gamma.py @@ -8,10 +8,10 @@ card = pykms.Card() card = 0 card = pykms.Card() - -conn = card.get_first_connected_connector() +res = pykms.ResourceManager(card) +conn = res.reserve_connector() +crtc = res.reserve_crtc(conn) mode = conn.get_default_mode() -crtc = get_crtc_for_connector(conn) fb = pykms.DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); pykms.draw_test_pattern(fb); diff --git a/py/helpers.py b/py/helpers.py index e92163c..fd67d41 100644 --- a/py/helpers.py +++ b/py/helpers.py @@ -52,15 +52,3 @@ def disable_planes(card): if areq.commit_sync() != 0: print("disabling planes failed") - -def get_crtc_for_connector(conn): - crtc = conn.get_current_crtc() - - if crtc != None: - return crtc - - for crtc in conn.get_possible_crtcs(): - if crtc.mode_valid == False: - return crtc - - raise RuntimeError("No free crtc found") @@ -9,16 +9,15 @@ from math import cos from helpers import * card = pykms.Card() - -conn = card.get_first_connected_connector() +res = pykms.ResourceManager(card) +conn = res.reserve_connector() +crtc = res.reserve_crtc(conn) mode = conn.get_default_mode() fb = pykms.DumbFramebuffer(card, 200, 200, "XR24"); pykms.draw_test_pattern(fb); -crtc = get_crtc_for_connector(conn) - #crtc.set_mode(conn, fb, mode) i = 0 @@ -4,16 +4,15 @@ import pykms from helpers import * card = pykms.Card() - -conn = card.get_first_connected_connector() +res = pykms.ResourceManager(card) +conn = res.reserve_connector() +crtc = res.reserve_crtc(conn) mode = conn.get_default_mode() fb = pykms.DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); pykms.draw_test_pattern(fb); -crtc = get_crtc_for_connector(conn) - crtc.set_mode(conn, fb, mode) input("press enter to exit\n") diff --git a/py/trans-test.py b/py/trans-test.py index e80802b..8c1f964 100755 --- a/py/trans-test.py +++ b/py/trans-test.py @@ -9,10 +9,10 @@ card = pykms.Card() card = 0 card = pykms.Card() - -conn = card.get_first_connected_connector() +res = pykms.ResourceManager(card) +conn = res.reserve_connector() +crtc = res.reserve_crtc(conn) mode = conn.get_default_mode() -crtc = get_crtc_for_connector(conn) planes = [] for p in card.planes: |