summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;