summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a688d32)
raw | patch | inline | side by side (parent: a688d32)
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Mon, 6 Jun 2016 16:56:26 +0000 (19:56 +0300) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 7 Jun 2016 14:04:28 +0000 (17:04 +0300) |
py/alpha-test.py | patch | blob | history | |
py/db.py | patch | blob | history | |
py/functest.py | patch | blob | history | |
py/gamma.py | patch | blob | history | |
py/helpers.py | patch | blob | history | |
py/iact.py | patch | blob | history | |
py/pykmsbase.cpp | patch | blob | history | |
py/test.py | patch | blob | history | |
py/trans-test.py | patch | blob | history |
diff --git a/py/alpha-test.py b/py/alpha-test.py
index 6957bb4277cd5be4bdf16cb59033820b3ab40955..113fab0ad73cdd597e55cc986280cd8a273b97d4 100755 (executable)
--- a/py/alpha-test.py
+++ b/py/alpha-test.py
conn = card.get_first_connected_connector()
mode = conn.get_default_mode()
-crtc = conn.get_current_crtc()
+crtc = get_crtc_for_connector(conn)
planes = []
for p in card.planes:
diff --git a/py/db.py b/py/db.py
index 315f99376fc065f67d6c2e12af33399a513bd9d1..60737650a95b9096f57fa3cf0e4711673dbf50ac 100755 (executable)
--- a/py/db.py
+++ b/py/db.py
import sys
import pykms
import selectors
+from helpers import *
bar_width = 20
bar_speed = 8
card = pykms.Card()
conn = card.get_first_connected_connector()
mode = conn.get_default_mode()
-crtc = conn.get_current_crtc()
+crtc = get_crtc_for_connector(conn)
fliphandler = FlipHandler()
diff --git a/py/functest.py b/py/functest.py
index 624f3202c2753fbefb08661f8eaea60f986e3584..c2548fa044f45defbed698a81c586a20e93fe33d 100755 (executable)
--- a/py/functest.py
+++ b/py/functest.py
#!/usr/bin/python3
import pykms
+from helpers import *
card = pykms.Card()
fb = pykms.DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24");
pykms.draw_test_pattern(fb);
-crtc = conn.get_current_crtc()
+crtc = get_crtc_for_connector(conn)
crtc.set_mode(conn, fb, mode)
diff --git a/py/gamma.py b/py/gamma.py
index 6dfd93541777020ab3e943c29a7d39ceb8f12d3f..e1daa43929beef7c745c5a01491a0a1768adfa59 100755 (executable)
--- a/py/gamma.py
+++ b/py/gamma.py
conn = card.get_first_connected_connector()
mode = conn.get_default_mode()
-crtc = conn.get_current_crtc()
-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 fd67d4160cb9214d77c9a8e43db0a392b0f879d2..e92163ceaac9c92015a8300da0ef859a0542d0fe 100644 (file)
--- a/py/helpers.py
+++ b/py/helpers.py
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")
diff --git a/py/iact.py b/py/iact.py
index 82511c3f0971392474510e64afc4bfd48df1db2a..cfb174575e091291256e923199c414613613387e 100755 (executable)
--- a/py/iact.py
+++ b/py/iact.py
fb = pykms.DumbFramebuffer(card, 200, 200, "XR24");
pykms.draw_test_pattern(fb);
-crtc = conn.get_current_crtc()
+crtc = get_crtc_for_connector(conn)
#crtc.set_mode(conn, fb, mode)
diff --git a/py/pykmsbase.cpp b/py/pykmsbase.cpp
index f31986a7af6e4e5b40593f675bff18aae3d9d3fe..efc760aabb3d0e8538de95b20448fc2eae1e716b 100644 (file)
--- a/py/pykmsbase.cpp
+++ b/py/pykmsbase.cpp
.def_property_readonly("fullname", &Connector::fullname)
.def("get_default_mode", &Connector::get_default_mode)
.def("get_current_crtc", &Connector::get_current_crtc)
+ .def("get_possible_crtcs", &Connector::get_possible_crtcs)
.def("get_modes", &Connector::get_modes)
.def("__repr__", [](const Connector& o) { return "<pykms.Connector " + to_string(o.id()) + ">"; })
;
.def("set_plane", &Crtc::set_plane)
.def_property_readonly("possible_planes", &Crtc::get_possible_planes)
.def_property_readonly("primary_plane", &Crtc::get_primary_plane)
+ .def_property_readonly("mode", &Crtc::mode)
+ .def_property_readonly("mode_valid", &Crtc::mode_valid)
.def("__repr__", [](const Crtc& o) { return "<pykms.Crtc " + to_string(o.id()) + ">"; })
;
diff --git a/py/test.py b/py/test.py
index 70d4887d364bcd619ab6b10fba3f1da05dd95de7..7625f101213e10aa3e07f9605464638eeaf239b1 100755 (executable)
--- a/py/test.py
+++ b/py/test.py
#!/usr/bin/python3
import pykms
+from helpers import *
card = pykms.Card()
fb = pykms.DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24");
pykms.draw_test_pattern(fb);
-crtc = conn.get_current_crtc()
+crtc = get_crtc_for_connector(conn)
crtc.set_mode(conn, fb, mode)
diff --git a/py/trans-test.py b/py/trans-test.py
index 96357379d866272ead2a41cb15a4c4b192117763..e80802bbd80794f2d76b091b3f75bbd4e95b3ac8 100755 (executable)
--- a/py/trans-test.py
+++ b/py/trans-test.py
conn = card.get_first_connected_connector()
mode = conn.get_default_mode()
-crtc = conn.get_current_crtc()
+crtc = get_crtc_for_connector(conn)
planes = []
for p in card.planes: