From f1a098203be8c44a52ed5d2a72982a3f634d4df6 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 2 Jan 2017 16:42:09 +0200 Subject: py: Move helpers to the pykms module Instead of forcing applications to import the helpers manually, move them to pykms by turning it into a python module. Signed-off-by: Laurent Pinchart --- py/tests/helpers.py | 54 ----------------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 py/tests/helpers.py (limited to 'py/tests/helpers.py') diff --git a/py/tests/helpers.py b/py/tests/helpers.py deleted file mode 100644 index fd67d41..0000000 --- a/py/tests/helpers.py +++ /dev/null @@ -1,54 +0,0 @@ -import pykms - -def add_props(areq, ob, map): - for key, value in map.items(): - areq.add(ob, key, value) - -def props(o): - o.refresh_props() - map = o.prop_map - for propid,propval in map.items(): - prop = o.card.get_prop(propid) - print("%-15s %d (%#x)" % (prop.name, propval, propval)) - -def set_prop(ob, prop, value): - if ob.card.has_atomic: - areq = pykms.AtomicReq(ob.card) - areq.add(ob, prop, value) - if areq.commit_sync() != 0: - print("commit failed") - else: - if ob.set_prop_value(prop, value) != 0: - print("setting property failed") - -def set_props(ob, map): - if ob.card.has_atomic: - areq = pykms.AtomicReq(ob.card) - - for key, value in map.items(): - areq.add(ob, key, value) - - if areq.commit_sync() != 0: - print("commit failed") - else: - for propid,propval in map.items(): - if ob.set_prop_value(propid, propval) != 0: - print("setting property failed") - -red = pykms.RGB(255, 0, 0) -green = pykms.RGB(0, 255, 0) -blue = pykms.RGB(0, 0, 255) -yellow = pykms.RGB(255, 255, 0) -purple = pykms.RGB(255, 0, 255) -white = pykms.RGB(255, 255, 255) -cyan = pykms.RGB(0, 255, 255) - -def disable_planes(card): - areq = pykms.AtomicReq(card) - - for p in card.planes: - areq.add(p, "FB_ID", 0) - areq.add(p, "CRTC_ID", 0) - - if areq.commit_sync() != 0: - print("disabling planes failed") -- cgit v1.2.3