From 8375acc53dd13ea4b958cfa3487c30cbd0f8b663 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 27 Jan 2017 10:40:03 +0200 Subject: py/tests: hpd test Signed-off-by: Tomi Valkeinen --- py/tests/hpd.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 py/tests/hpd.py (limited to 'py/tests') 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) -- cgit v1.2.3