From: Tomi Valkeinen Date: Fri, 27 May 2016 13:30:13 +0000 (+0300) Subject: AtomicReq: add helper to add multiple props X-Git-Url: https://git.ti.com/gitweb?p=android%2Fexternal-libkmsxx.git;a=commitdiff_plain;h=d17cb8f0e0a71f7f3b1dbd88ccc1349b3723dc1c;hp=ecb075e580912d201375338b01afc762792b9d0b AtomicReq: add helper to add multiple props --- 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& 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 #include +#include 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& values); int test(); int commit(void* data);