16d6cf87dd6759934c148f0757a5af5d3a577cdf
1 #pragma once
3 #include <kms++/mappedframebuffer.h>
4 #include <kms++/pixelformats.h>
6 struct omap_bo;
8 namespace kms
9 {
10 class OmapCard;
12 class OmapFramebuffer : public MappedFramebuffer
13 {
14 public:
15 OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, const std::string& fourcc);
16 OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, PixelFormat format);
17 virtual ~OmapFramebuffer();
19 uint32_t width() const { return Framebuffer::width(); }
20 uint32_t height() const { return Framebuffer::height(); }
22 PixelFormat format() const { return m_format; }
23 unsigned num_planes() const { return m_num_planes; }
25 uint32_t handle(unsigned plane) const { return m_planes[plane].handle; }
26 uint32_t stride(unsigned plane) const { return m_planes[plane].stride; }
27 uint32_t size(unsigned plane) const { return m_planes[plane].size; }
28 uint32_t offset(unsigned plane) const { return m_planes[plane].offset; }
29 uint8_t* map(unsigned plane);
30 int prime_fd(unsigned plane);
32 private:
33 OmapCard& m_omap_card;
35 struct FramebufferPlane {
36 struct omap_bo* omap_bo;
37 uint32_t handle;
38 int prime_fd;
39 uint32_t size;
40 uint32_t stride;
41 uint32_t offset;
42 uint8_t* map;
43 };
45 void Create();
46 void Destroy();
48 unsigned m_num_planes;
49 struct FramebufferPlane m_planes[3];
51 PixelFormat m_format;
52 };
53 }