From c3e5d3b13f9f074efe9797897ffb6429a2e8c6fe Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 9 Dec 2019 15:07:48 +0200 Subject: improve hpd.py --- py/tests/hpd.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/py/tests/hpd.py b/py/tests/hpd.py index d26f260..185d784 100755 --- a/py/tests/hpd.py +++ b/py/tests/hpd.py @@ -4,8 +4,7 @@ import pyudev import pykms card = pykms.Card() -res = pykms.ResourceManager(card) -conn = res.reserve_connector("hdmi") +conns = card.connectors context = pyudev.Context() @@ -16,7 +15,8 @@ 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) + for conn in conns: + conn.refresh() + modes = conn.get_modes() + print(" ", conn.fullname, ["{}x{}".format(m.hdisplay, m.vdisplay) for m in modes]) -- cgit v1.2.3