summaryrefslogtreecommitdiff
path: root/kms++/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-08-06 05:18:01 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2020-08-10 09:44:48 +0300
commit97aba6dc55aebf9ee61b71985cecc0ae90af756b (patch)
tree4e365cf58e3d4b3302b8dee221811f084b16d713 /kms++/src
parent3fbc35b1464520f84c0dcc9a30abd8648c7f88f0 (diff)
dumbfb: Add support tri- or quadri-planar buffers
The DumbFrameBuffer class supports up to 4 planes, as required by the DRM/KMS API, but only considers planes 0 and 1 when constructing the buffer. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'kms++/src')
-rw-r--r--kms++/src/dumbframebuffer.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/kms++/src/dumbframebuffer.cpp b/kms++/src/dumbframebuffer.cpp
index 3448fb1..18f3f15 100644
--- a/kms++/src/dumbframebuffer.cpp
+++ b/kms++/src/dumbframebuffer.cpp
@@ -56,9 +56,18 @@ DumbFramebuffer::DumbFramebuffer(Card& card, uint32_t width, uint32_t height, Pi
}
/* create framebuffer object for the dumb-buffer */
- uint32_t bo_handles[4] = { m_planes[0].handle, m_planes[1].handle };
- uint32_t pitches[4] = { m_planes[0].stride, m_planes[1].stride };
- uint32_t offsets[4] = { m_planes[0].offset, m_planes[1].offset };
+ uint32_t bo_handles[4] = {
+ m_planes[0].handle, m_planes[1].handle,
+ m_planes[2].handle, m_planes[3].handle,
+ };
+ uint32_t pitches[4] = {
+ m_planes[0].stride, m_planes[1].stride,
+ m_planes[2].stride, m_planes[3].stride,
+ };
+ uint32_t offsets[4] = {
+ m_planes[0].offset, m_planes[1].offset,
+ m_planes[2].offset, m_planes[3].offset,
+ };
uint32_t id;
r = drmModeAddFB2(card.fd(), width, height, (uint32_t)format,
bo_handles, pitches, offsets, &id, 0);