diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-08-14 11:10:34 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-08-15 14:42:55 +0300 |
commit | 05cc861d51149c719bcef145365e89a00ddb6cde (patch) | |
tree | 20e37f135e20065ab40c3a7c2eb4a3e11a6be9b4 /kms++/src | |
parent | f184e59f04705dae7c2e6be706e9fa7fec0c6474 (diff) |
AtomicReq: add add_display() helper
Diffstat (limited to 'kms++/src')
-rw-r--r-- | kms++/src/atomicreq.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kms++/src/atomicreq.cpp b/kms++/src/atomicreq.cpp index f2809af..28128f2 100644 --- a/kms++/src/atomicreq.cpp +++ b/kms++/src/atomicreq.cpp @@ -60,6 +60,31 @@ void AtomicReq::add(kms::DrmPropObject* ob, const map<string, uint64_t>& values) add(ob, kvp.first, kvp.second); } +void AtomicReq::add_display(Connector* conn, Crtc* crtc, Blob* videomode, Plane* primary, Framebuffer* fb) +{ + add(conn, { + { "CRTC_ID", crtc->id() }, + }); + + add(crtc, { + { "ACTIVE", 1 }, + { "MODE_ID", videomode->id() }, + }); + + add(primary, { + { "FB_ID", fb->id() }, + { "CRTC_ID", crtc->id() }, + { "SRC_X", 0 << 16 }, + { "SRC_Y", 0 << 16 }, + { "SRC_W", fb->width() << 16 }, + { "SRC_H", fb->height() << 16 }, + { "CRTC_X", 0 }, + { "CRTC_Y", 0 }, + { "CRTC_W", fb->width() }, + { "CRTC_H", fb->height() }, + }); +} + int AtomicReq::test(bool allow_modeset) { uint32_t flags = DRM_MODE_ATOMIC_TEST_ONLY; |