diff options
author | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-10-03 21:24:34 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-10-03 21:24:34 +0300 |
commit | 90f84543a2156a7c8cb8913e2dc4a0eadf7569a0 (patch) | |
tree | b073be5d6ebaad70d9f4d6ff5534d751375acfaa | |
parent | 53220741423db98d89dd99e7443f5f7108ef2505 (diff) |
atomicreq: add a shortcut
-rw-r--r-- | libkms++/atomicreq.cpp | 7 | ||||
-rw-r--r-- | libkms++/atomicreq.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libkms++/atomicreq.cpp b/libkms++/atomicreq.cpp index 236e501..7794913 100644 --- a/libkms++/atomicreq.cpp +++ b/libkms++/atomicreq.cpp @@ -21,6 +21,8 @@ static inline int drmModeAtomicCommit(int, drmModeAtomicReqPtr, int, void*) { re #endif // DRM_CLIENT_CAP_ATOMIC +using namespace std; + namespace kms { AtomicReq::AtomicReq(Card& card) @@ -47,6 +49,11 @@ void AtomicReq::add(DrmObject *ob, Property *prop, uint64_t value) add(ob->id(), prop->id(), value); } +void AtomicReq::add(DrmObject* ob, const string& prop, uint64_t value) +{ + add(ob, m_card.get_prop(prop), value); +} + int AtomicReq::test() { uint32_t flags = DRM_MODE_ATOMIC_TEST_ONLY; diff --git a/libkms++/atomicreq.h b/libkms++/atomicreq.h index 89797df..55dd7c9 100644 --- a/libkms++/atomicreq.h +++ b/libkms++/atomicreq.h @@ -1,6 +1,7 @@ #pragma once #include <cstdint> +#include <string> struct _drmModeAtomicReq; @@ -19,6 +20,7 @@ public: void add(uint32_t ob_id, uint32_t prop_id, uint64_t value); void add(DrmObject *ob, Property *prop, uint64_t value); + void add(DrmObject *ob, const std::string& prop, uint64_t value); int test(); int commit(void* data); |