summaryrefslogtreecommitdiff
path: root/kms++
diff options
context:
space:
mode:
Diffstat (limited to 'kms++')
-rw-r--r--kms++/inc/kms++/dumbframebuffer.h4
-rw-r--r--kms++/inc/kms++/extframebuffer.h4
-rw-r--r--kms++/inc/kms++/framebuffer.h35
-rw-r--r--kms++/inc/kms++/kms++.h1
-rw-r--r--kms++/inc/kms++/mappedframebuffer.h23
-rw-r--r--kms++/inc/kms++/omap/omapframebuffer.h4
-rw-r--r--kms++/src/dumbframebuffer.cpp2
-rw-r--r--kms++/src/extframebuffer.cpp4
-rw-r--r--kms++/src/mappedframebuffer.cpp20
-rw-r--r--kms++/src/omap/omapframebuffer.cpp2
10 files changed, 28 insertions, 71 deletions
diff --git a/kms++/inc/kms++/dumbframebuffer.h b/kms++/inc/kms++/dumbframebuffer.h
index 15d25d1..fb99d0e 100644
--- a/kms++/inc/kms++/dumbframebuffer.h
+++ b/kms++/inc/kms++/dumbframebuffer.h
@@ -1,12 +1,12 @@
#pragma once
-#include "mappedframebuffer.h"
+#include "framebuffer.h"
#include "pixelformats.h"
namespace kms
{
-class DumbFramebuffer : public MappedFramebuffer
+class DumbFramebuffer : public Framebuffer
{
public:
DumbFramebuffer(Card& card, uint32_t width, uint32_t height, const std::string& fourcc);
diff --git a/kms++/inc/kms++/extframebuffer.h b/kms++/inc/kms++/extframebuffer.h
index 1ec614f..5f0660c 100644
--- a/kms++/inc/kms++/extframebuffer.h
+++ b/kms++/inc/kms++/extframebuffer.h
@@ -1,12 +1,12 @@
#pragma once
-#include "mappedframebuffer.h"
+#include "framebuffer.h"
#include "pixelformats.h"
namespace kms
{
-class ExtFramebuffer : public MappedFramebuffer
+class ExtFramebuffer : public Framebuffer
{
public:
ExtFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format,
diff --git a/kms++/inc/kms++/framebuffer.h b/kms++/inc/kms++/framebuffer.h
index faf2e71..3d43d08 100644
--- a/kms++/inc/kms++/framebuffer.h
+++ b/kms++/inc/kms++/framebuffer.h
@@ -5,7 +5,24 @@
namespace kms
{
-class Framebuffer : public DrmObject
+class IFramebuffer {
+public:
+ virtual ~IFramebuffer() { }
+
+ virtual uint32_t width() const = 0;
+ virtual uint32_t height() const = 0;
+
+ virtual PixelFormat format() const { throw std::runtime_error("not implemented"); }
+ virtual unsigned num_planes() const { throw std::runtime_error("not implemented"); }
+
+ virtual uint32_t stride(unsigned plane) const { throw std::runtime_error("not implemented"); }
+ virtual uint32_t size(unsigned plane) const { throw std::runtime_error("not implemented"); }
+ virtual uint32_t offset(unsigned plane) const { throw std::runtime_error("not implemented"); }
+ virtual uint8_t* map(unsigned plane) { throw std::runtime_error("not implemented"); }
+ virtual int prime_fd(unsigned plane) { throw std::runtime_error("not implemented"); }
+};
+
+class Framebuffer : public DrmObject, public IFramebuffer
{
public:
Framebuffer(Card& card, uint32_t id);
@@ -23,20 +40,4 @@ private:
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;
-};
-
}
diff --git a/kms++/inc/kms++/kms++.h b/kms++/inc/kms++/kms++.h
index 6fc6977..3365ef7 100644
--- a/kms++/inc/kms++/kms++.h
+++ b/kms++/inc/kms++/kms++.h
@@ -8,7 +8,6 @@
#include "framebuffer.h"
#include "dumbframebuffer.h"
#include "extframebuffer.h"
-#include "mappedframebuffer.h"
#include "plane.h"
#include "property.h"
#include "blob.h"
diff --git a/kms++/inc/kms++/mappedframebuffer.h b/kms++/inc/kms++/mappedframebuffer.h
deleted file mode 100644
index 2905136..0000000
--- a/kms++/inc/kms++/mappedframebuffer.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#pragma once
-
-#include "framebuffer.h"
-
-namespace kms
-{
-
-class MappedFramebuffer : public Framebuffer, public IMappedFramebuffer
-{
-public:
- virtual ~MappedFramebuffer() { }
-
-protected:
- MappedFramebuffer(Card& card, uint32_t id);
- MappedFramebuffer(Card& card, uint32_t width, uint32_t height);
-
-public:
- virtual uint32_t width() const = 0;
- virtual uint32_t height() const = 0;
-
-};
-
-}
diff --git a/kms++/inc/kms++/omap/omapframebuffer.h b/kms++/inc/kms++/omap/omapframebuffer.h
index d1152b5..70bf946 100644
--- a/kms++/inc/kms++/omap/omapframebuffer.h
+++ b/kms++/inc/kms++/omap/omapframebuffer.h
@@ -1,6 +1,6 @@
#pragma once
-#include <kms++/mappedframebuffer.h>
+#include <kms++/framebuffer.h>
#include <kms++/pixelformats.h>
struct omap_bo;
@@ -9,7 +9,7 @@ namespace kms
{
class OmapCard;
-class OmapFramebuffer : public MappedFramebuffer
+class OmapFramebuffer : public Framebuffer
{
public:
enum Flags
diff --git a/kms++/src/dumbframebuffer.cpp b/kms++/src/dumbframebuffer.cpp
index 9de7ee1..b21e8ff 100644
--- a/kms++/src/dumbframebuffer.cpp
+++ b/kms++/src/dumbframebuffer.cpp
@@ -25,7 +25,7 @@ DumbFramebuffer::DumbFramebuffer(Card &card, uint32_t width, uint32_t height, co
}
DumbFramebuffer::DumbFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format)
- :MappedFramebuffer(card, width, height), m_format(format)
+ :Framebuffer(card, width, height), m_format(format)
{
Create();
}
diff --git a/kms++/src/extframebuffer.cpp b/kms++/src/extframebuffer.cpp
index f50c36e..c1f562e 100644
--- a/kms++/src/extframebuffer.cpp
+++ b/kms++/src/extframebuffer.cpp
@@ -14,7 +14,7 @@ namespace kms
ExtFramebuffer::ExtFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format,
vector<uint32_t> handles, vector<uint32_t> pitches, vector<uint32_t> offsets)
- : MappedFramebuffer(card, width, height)
+ : Framebuffer(card, width, height)
{
m_format = format;
@@ -44,7 +44,7 @@ ExtFramebuffer::ExtFramebuffer(Card& card, uint32_t width, uint32_t height, Pixe
ExtFramebuffer::ExtFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format,
vector<int> fds, vector<uint32_t> pitches, vector<uint32_t> offsets)
- : MappedFramebuffer(card, width, height)
+ : Framebuffer(card, width, height)
{
int r;
diff --git a/kms++/src/mappedframebuffer.cpp b/kms++/src/mappedframebuffer.cpp
deleted file mode 100644
index 21e082f..0000000
--- a/kms++/src/mappedframebuffer.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <kms++/kms++.h>
-
-using namespace std;
-
-namespace kms
-{
-
-MappedFramebuffer::MappedFramebuffer(Card& card, uint32_t id)
- : Framebuffer(card, id)
-{
-
-}
-
-MappedFramebuffer::MappedFramebuffer(Card& card, uint32_t width, uint32_t height)
- : Framebuffer(card, width, height)
-{
-
-}
-
-}
diff --git a/kms++/src/omap/omapframebuffer.cpp b/kms++/src/omap/omapframebuffer.cpp
index b27ca22..f33a286 100644
--- a/kms++/src/omap/omapframebuffer.cpp
+++ b/kms++/src/omap/omapframebuffer.cpp
@@ -32,7 +32,7 @@ OmapFramebuffer::OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height
}
OmapFramebuffer::OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, PixelFormat format, Flags flags)
- :MappedFramebuffer(card, width, height), m_omap_card(card), m_format(format)
+ :Framebuffer(card, width, height), m_omap_card(card), m_format(format)
{
Create(flags);
}