summaryrefslogtreecommitdiff
path: root/py/tests
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-01-27 10:40:03 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-01-27 11:04:19 +0200
commit8375acc53dd13ea4b958cfa3487c30cbd0f8b663 (patch)
tree9a2b71a9a78c11c1879f4450f73ff7ceb28dbf2a /py/tests
parent31070a67532095cf4f13e8bfcd5658ebb1d69c1c (diff)
py/tests: hpd test
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'py/tests')
-rwxr-xr-xpy/tests/hpd.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/py/tests/hpd.py b/py/tests/hpd.py
new file mode 100755
index 0000000..d26f260
--- /dev/null
+++ b/py/tests/hpd.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python3
+
+import pyudev
+import pykms
+
+card = pykms.Card()
+res = pykms.ResourceManager(card)
+conn = res.reserve_connector("hdmi")
+
+context = pyudev.Context()
+
+dev = pyudev.Devices.from_name(context, 'drm', 'card0')
+
+monitor = pyudev.Monitor.from_netlink(context)
+monitor.filter_by('drm')
+
+for device in iter(monitor.poll, None):
+ if 'HOTPLUG' in device:
+ conn.refresh()
+ mode = conn.get_modes()
+ print("HPD")
+ print(mode)