summaryrefslogtreecommitdiff
path: root/libkms++
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-03-15 11:46:09 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-03-15 11:57:49 +0200
commit83d27aa30549194068fef320f735245a7735a5ea (patch)
tree05d8d4e6bb36c1b902f9fcb19a79ea9b9573ed28 /libkms++
parent79394ef6686cd525471c20f9bda0b8c983b63010 (diff)
Add IMappedFramebuffer and remove MappedBuffer
Diffstat (limited to 'libkms++')
-rw-r--r--libkms++/dumbframebuffer.h5
-rw-r--r--libkms++/framebuffer.h18
2 files changed, 22 insertions, 1 deletions
diff --git a/libkms++/dumbframebuffer.h b/libkms++/dumbframebuffer.h
index 226a8dc..6b3ee64 100644
--- a/libkms++/dumbframebuffer.h
+++ b/libkms++/dumbframebuffer.h
@@ -5,13 +5,16 @@
namespace kms
{
-class DumbFramebuffer : public Framebuffer
+class DumbFramebuffer : public Framebuffer, public IMappedFramebuffer
{
public:
DumbFramebuffer(Card& card, uint32_t width, uint32_t height, const std::string& fourcc);
DumbFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format);
virtual ~DumbFramebuffer();
+ uint32_t width() const { return Framebuffer::width(); }
+ uint32_t height() const { return Framebuffer::height(); }
+
PixelFormat format() const { return m_format; }
unsigned num_planes() const { return m_num_planes; }
diff --git a/libkms++/framebuffer.h b/libkms++/framebuffer.h
index 77a6c32..25659c6 100644
--- a/libkms++/framebuffer.h
+++ b/libkms++/framebuffer.h
@@ -1,6 +1,7 @@
#pragma once
#include "drmobject.h"
+#include "pixelformats.h"
namespace kms
{
@@ -19,4 +20,21 @@ private:
uint32_t m_width;
uint32_t m_height;
};
+
+class IMappedFramebuffer {
+public:
+ virtual ~IMappedFramebuffer() { }
+
+ virtual uint32_t width() const = 0;
+ virtual uint32_t height() const = 0;
+
+ virtual PixelFormat format() const = 0;
+ virtual unsigned num_planes() const = 0;
+
+ virtual uint32_t stride(unsigned plane) const = 0;
+ virtual uint32_t size(unsigned plane) const = 0;
+ virtual uint32_t offset(unsigned plane) const = 0;
+ virtual uint8_t* map(unsigned plane) = 0;
+};
+
}