summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8d50744)
raw | patch | inline | side by side (parent: 8d50744)
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Thu, 26 May 2016 11:12:15 +0000 (14:12 +0300) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Thu, 26 May 2016 11:12:15 +0000 (14:12 +0300) |
py/gamma.py | patch | blob | history | |
py/helpers.py | patch | blob | history |
diff --git a/py/gamma.py b/py/gamma.py
index c8da18fcb1af665a693349b493245e30529c4467..7ecd19de1212f541f9fc412ff0629dedf03f0b33 100644 (file)
--- a/py/gamma.py
+++ b/py/gamma.py
gamma = pykms.Blob(card, arr);
-set_props(crtc, {
- "GAMMA_LUT": gamma.id,
-})
+set_prop(crtc, "GAMMA_LUT", gamma.id)
input("press enter to remove gamma\n")
-set_props(crtc, {
- "GAMMA_LUT": 0,
-})
+set_prop(crtc, "GAMMA_LUT", 0)
input("press enter to exit\n")
diff --git a/py/helpers.py b/py/helpers.py
index 456efcd83343fb8c420c5fb2e71c3bd80570071c..fd67d4160cb9214d77c9a8e43db0a392b0f879d2 100644 (file)
--- a/py/helpers.py
+++ b/py/helpers.py
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)