summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-05-30 13:51:49 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-05-30 13:52:34 +0300
commit9e233836840d9708d32dc5a0b15df631ea274e7a (patch)
tree6f1ce3322d09ce8a626b2cac623f4679484c4ad9
parent51cbdf3d3b4a1290cf2dfb6a9a80d9294ca35804 (diff)
AtomicReq: support 'allow_modeset'
-rw-r--r--libkms++/atomicreq.cpp15
-rw-r--r--libkms++/atomicreq.h6
2 files changed, 15 insertions, 6 deletions
diff --git a/libkms++/atomicreq.cpp b/libkms++/atomicreq.cpp
index 0d895da..3aa2ff6 100644
--- a/libkms++/atomicreq.cpp
+++ b/libkms++/atomicreq.cpp
@@ -62,24 +62,33 @@ void AtomicReq::add(DrmObject* ob, const map<string, uint64_t>& values)
add(ob, kvp.first, kvp.second);
}
-int AtomicReq::test()
+int AtomicReq::test(bool allow_modeset)
{
uint32_t flags = DRM_MODE_ATOMIC_TEST_ONLY;
+ if (allow_modeset)
+ flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
+
return drmModeAtomicCommit(m_card.fd(), m_req, flags, 0);
}
-int AtomicReq::commit(void* data)
+int AtomicReq::commit(void* data, bool allow_modeset)
{
uint32_t flags = DRM_MODE_PAGE_FLIP_EVENT | DRM_MODE_ATOMIC_NONBLOCK;
+ if (allow_modeset)
+ flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
+
return drmModeAtomicCommit(m_card.fd(), m_req, flags, data);
}
-int AtomicReq::commit_sync()
+int AtomicReq::commit_sync(bool allow_modeset)
{
uint32_t flags = 0;
+ if (allow_modeset)
+ flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
+
return drmModeAtomicCommit(m_card.fd(), m_req, flags, 0);
}
}
diff --git a/libkms++/atomicreq.h b/libkms++/atomicreq.h
index 77a9dde..6ebdbf8 100644
--- a/libkms++/atomicreq.h
+++ b/libkms++/atomicreq.h
@@ -24,9 +24,9 @@ public:
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);
- int commit_sync();
+ int test(bool allow_modeset = false);
+ int commit(void* data, bool allow_modeset = false);
+ int commit_sync(bool allow_modeset = false);
private:
Card& m_card;