diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-06-06 19:56:26 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-06-07 17:04:28 +0300 |
commit | ded84bf2620313b701af9c88b0f6c6ada2c70eaa (patch) | |
tree | fc836815746d044f46fc99dac0782e8472ac2eb3 /py/helpers.py | |
parent | a688d32d209a45627da3e80128a933d70f5d48b6 (diff) |
py: fix scripts when there's no current crtc
Diffstat (limited to 'py/helpers.py')
-rw-r--r-- | py/helpers.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/py/helpers.py b/py/helpers.py index fd67d41..e92163c 100644 --- a/py/helpers.py +++ b/py/helpers.py @@ -52,3 +52,15 @@ 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") |