summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-20 08:46:32 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-20 08:46:32 +0300
commit365091ec413d8814b38d183adb7f0d0ee1109cbe (patch)
treeb48d3de809d31abc833c08d0fbdae83a9049eb31
parente17e6f5c37b702092d8d4f97dd70f237c366708f (diff)
Add Framebuffer::flush()
-rw-r--r--kms++/inc/kms++/framebuffer.h2
-rw-r--r--kms++/src/framebuffer.cpp10
2 files changed, 12 insertions, 0 deletions
diff --git a/kms++/inc/kms++/framebuffer.h b/kms++/inc/kms++/framebuffer.h
index cbf705d..faf2e71 100644
--- a/kms++/inc/kms++/framebuffer.h
+++ b/kms++/inc/kms++/framebuffer.h
@@ -13,6 +13,8 @@ public:
uint32_t width() const { return m_width; }
uint32_t height() const { return m_height; }
+
+ void flush();
protected:
Framebuffer(Card& card, uint32_t width, uint32_t height);
diff --git a/kms++/src/framebuffer.cpp b/kms++/src/framebuffer.cpp
index a7f589c..1ce8f2a 100644
--- a/kms++/src/framebuffer.cpp
+++ b/kms++/src/framebuffer.cpp
@@ -31,6 +31,16 @@ Framebuffer::Framebuffer(Card& card, uint32_t id)
card.m_framebuffers.push_back(this);
}
+void Framebuffer::flush()
+{
+ drmModeClip clip { };
+ clip.x1 = clip.y1 = 0;
+ clip.x2 = width();
+ clip.y2 = height();
+
+ drmModeDirtyFB(card().fd(), id(), &clip, 1);
+}
+
Framebuffer::~Framebuffer()
{
auto& fbs = card().m_framebuffers;