summaryrefslogtreecommitdiff
path: root/kms++
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2021-07-19 18:13:09 +0200
committerNoralf Trønnes <noralf@tronnes.org>2021-07-19 18:26:41 +0200
commit43e03aacfa211eb56037b68da66e79b162491c1b (patch)
tree603676f85dee08acf3c77d9adc29aef61aca078f /kms++
parent5afc8d918f2c084acd65027604868dfde43395cf (diff)
framebuffer: Support partial flushing
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Diffstat (limited to 'kms++')
-rw-r--r--kms++/inc/kms++/framebuffer.h1
-rw-r--r--kms++/src/framebuffer.cpp11
2 files changed, 12 insertions, 0 deletions
diff --git a/kms++/inc/kms++/framebuffer.h b/kms++/inc/kms++/framebuffer.h
index 6f77b98..1bd477c 100644
--- a/kms++/inc/kms++/framebuffer.h
+++ b/kms++/inc/kms++/framebuffer.h
@@ -41,6 +41,7 @@ public:
uint32_t width() const override { return m_width; }
uint32_t height() const override { return m_height; }
+ void flush(uint32_t x, uint32_t y, uint32_t width, uint32_t height);
void flush();
protected:
diff --git a/kms++/src/framebuffer.cpp b/kms++/src/framebuffer.cpp
index f1cba3b..72e1a73 100644
--- a/kms++/src/framebuffer.cpp
+++ b/kms++/src/framebuffer.cpp
@@ -34,6 +34,17 @@ Framebuffer::Framebuffer(Card& card, uint32_t id)
card.m_framebuffers.push_back(this);
}
+void Framebuffer::flush(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
+{
+ drmModeClip clip{};
+ clip.x1 = x;
+ clip.y1 = y;
+ clip.x2 = x + width;
+ clip.y2 = y + height;
+
+ drmModeDirtyFB(card().fd(), id(), &clip, 1);
+}
+
void Framebuffer::flush()
{
drmModeClip clip{};