diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-09-23 14:54:39 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-11-21 18:37:20 +0200 |
commit | cb747ea27451266c6d340a018aedcd0675a18b00 (patch) | |
tree | 15d7c859faca753f4823daadbd6d2e6ab2f2cb83 /kms++/inc | |
parent | db0699907acdcc5dad86bf15e98f0c5c97b6f3c5 (diff) |
Add OmapCard and OmapFramebuffer
Add OmapCard and OmapFramebuffer classes to utilize omap_bos. Only
non-tiled framebuffer is implemented for now.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'kms++/inc')
-rw-r--r-- | kms++/inc/kms++/omap/omapcard.h | 21 | ||||
-rw-r--r-- | kms++/inc/kms++/omap/omapframebuffer.h | 52 | ||||
-rw-r--r-- | kms++/inc/kms++/omap/omapkms++.h | 4 |
3 files changed, 77 insertions, 0 deletions
diff --git a/kms++/inc/kms++/omap/omapcard.h b/kms++/inc/kms++/omap/omapcard.h new file mode 100644 index 0000000..5c2f3a5 --- /dev/null +++ b/kms++/inc/kms++/omap/omapcard.h @@ -0,0 +1,21 @@ +#pragma once + +#include <kms++/card.h> + +struct omap_device; + +namespace kms +{ +class OmapCard : public Card +{ +public: + OmapCard(); + OmapCard(const std::string& device); + virtual ~OmapCard(); + + struct omap_device* dev() const { return m_omap_dev; } + +private: + struct omap_device* m_omap_dev; +}; +} diff --git a/kms++/inc/kms++/omap/omapframebuffer.h b/kms++/inc/kms++/omap/omapframebuffer.h new file mode 100644 index 0000000..b39ede6 --- /dev/null +++ b/kms++/inc/kms++/omap/omapframebuffer.h @@ -0,0 +1,52 @@ +#pragma once + +#include <kms++/mappedframebuffer.h> +#include <kms++/pixelformats.h> + +struct omap_bo; + +namespace kms +{ +class OmapCard; + +class OmapFramebuffer : public MappedFramebuffer +{ +public: + OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, PixelFormat format); + virtual ~OmapFramebuffer(); + + 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; } + + uint32_t handle(unsigned plane) const { return m_planes[plane].handle; } + uint32_t stride(unsigned plane) const { return m_planes[plane].stride; } + uint32_t size(unsigned plane) const { return m_planes[plane].size; } + uint32_t offset(unsigned plane) const { return m_planes[plane].offset; } + uint8_t* map(unsigned plane); + int prime_fd(unsigned plane); + +private: + OmapCard& m_omap_card; + + struct FramebufferPlane { + struct omap_bo* omap_bo; + uint32_t handle; + int prime_fd; + uint32_t size; + uint32_t stride; + uint32_t offset; + uint8_t* map; + }; + + void Create(); + void Destroy(); + + unsigned m_num_planes; + struct FramebufferPlane m_planes[3]; + + PixelFormat m_format; +}; +} diff --git a/kms++/inc/kms++/omap/omapkms++.h b/kms++/inc/kms++/omap/omapkms++.h new file mode 100644 index 0000000..0d86841 --- /dev/null +++ b/kms++/inc/kms++/omap/omapkms++.h @@ -0,0 +1,4 @@ +#pragma once + +#include <kms++/omap/omapcard.h> +#include <kms++/omap/omapframebuffer.h> |