diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-05-27 16:30:13 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-05-27 17:24:14 +0300 |
commit | d17cb8f0e0a71f7f3b1dbd88ccc1349b3723dc1c (patch) | |
tree | 61a1326dea02a7d7aa511db7531151538a82d967 /libkms++ | |
parent | ecb075e580912d201375338b01afc762792b9d0b (diff) |
AtomicReq: add helper to add multiple props
Diffstat (limited to 'libkms++')
-rw-r--r-- | libkms++/atomicreq.cpp | 6 | ||||
-rw-r--r-- | libkms++/atomicreq.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libkms++/atomicreq.cpp b/libkms++/atomicreq.cpp index 0e627a8..0d895da 100644 --- a/libkms++/atomicreq.cpp +++ b/libkms++/atomicreq.cpp @@ -56,6 +56,12 @@ void AtomicReq::add(DrmObject* ob, const string& prop, uint64_t value) add(ob, m_card.get_prop(prop), value); } +void AtomicReq::add(DrmObject* ob, const map<string, uint64_t>& values) +{ + for(const auto& kvp : values) + add(ob, kvp.first, kvp.second); +} + int AtomicReq::test() { uint32_t flags = DRM_MODE_ATOMIC_TEST_ONLY; diff --git a/libkms++/atomicreq.h b/libkms++/atomicreq.h index d9aeb08..77a9dde 100644 --- a/libkms++/atomicreq.h +++ b/libkms++/atomicreq.h @@ -2,6 +2,7 @@ #include <cstdint> #include <string> +#include <map> struct _drmModeAtomicReq; @@ -21,6 +22,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); + void add(DrmObject *ob, const std::map<std::string, uint64_t>& values); int test(); int commit(void* data); |