diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-05-30 13:56:28 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-05-30 14:22:00 +0300 |
commit | 2d86678f0a78abf67cdef6be375f7d787c4f017d (patch) | |
tree | db8602f4f75448706155145b5345dc3009d9fa23 /kms++ | |
parent | af3f9890cc3927d92de4048bc238d62866784a35 (diff) |
omapfb: add enum Flags for OmapFB
Diffstat (limited to 'kms++')
-rw-r--r-- | kms++/inc/kms++/omap/omapframebuffer.h | 12 | ||||
-rw-r--r-- | kms++/src/omap/omapframebuffer.cpp | 12 |
2 files changed, 15 insertions, 9 deletions
diff --git a/kms++/inc/kms++/omap/omapframebuffer.h b/kms++/inc/kms++/omap/omapframebuffer.h index dcaaa4f..02ac79f 100644 --- a/kms++/inc/kms++/omap/omapframebuffer.h +++ b/kms++/inc/kms++/omap/omapframebuffer.h @@ -12,8 +12,14 @@ class OmapCard; class OmapFramebuffer : public MappedFramebuffer { public: - OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, const std::string& fourcc, bool tiled = false); - OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, PixelFormat format, bool tiled = false); + enum Flags + { + None = 0, + Tiled = 1 << 0, + }; + + OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, const std::string& fourcc, Flags flags = Flags::None); + OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, PixelFormat format, Flags flags = Flags::None); virtual ~OmapFramebuffer(); uint32_t width() const { return Framebuffer::width(); } @@ -42,7 +48,7 @@ private: uint8_t* map; }; - void Create(bool tiled); + void Create(Flags buffer_flags); void Destroy(); unsigned m_num_planes; diff --git a/kms++/src/omap/omapframebuffer.cpp b/kms++/src/omap/omapframebuffer.cpp index 9997933..4aa1cdb 100644 --- a/kms++/src/omap/omapframebuffer.cpp +++ b/kms++/src/omap/omapframebuffer.cpp @@ -26,15 +26,15 @@ using namespace std; namespace kms { -OmapFramebuffer::OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, const string& fourcc, bool tiled) - : OmapFramebuffer(card, width, height, FourCCToPixelFormat(fourcc), tiled) +OmapFramebuffer::OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, const string& fourcc, Flags flags) + : OmapFramebuffer(card, width, height, FourCCToPixelFormat(fourcc), flags) { } -OmapFramebuffer::OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, PixelFormat format, bool tiled) +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) { - Create(tiled); + Create(flags); } OmapFramebuffer::~OmapFramebuffer() @@ -42,7 +42,7 @@ OmapFramebuffer::~OmapFramebuffer() Destroy(); } -void OmapFramebuffer::Create(bool tiled) +void OmapFramebuffer::Create(Flags buffer_flags) { const PixelFormatInfo& format_info = get_pixel_format_info(m_format); @@ -58,7 +58,7 @@ void OmapFramebuffer::Create(bool tiled) uint32_t stride; - if (!tiled) { + if (!(buffer_flags & Flags::Tiled)) { stride = width() * pi.bitspp / 8; uint32_t size = stride * height() / pi.ysub; |