All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-renesas-soc@vger.kernel.org
Subject: [PATCH 3/8] dumbfb: Add support tri- or quadri-planar buffers
Date: Thu,  6 Aug 2020 05:18:01 +0300	[thread overview]
Message-ID: <20200806021807.21863-4-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20200806021807.21863-1-laurent.pinchart@ideasonboard.com>

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>
---
 kms++/src/dumbframebuffer.cpp | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/kms++/src/dumbframebuffer.cpp b/kms++/src/dumbframebuffer.cpp
index 3448fb149df2..18f3f152943d 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);
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2020-08-06  2:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-06  2:17 [PATCH 0/8] kmsxx: Various fixes and improvements Laurent Pinchart
2020-08-06  2:17 ` [PATCH 1/8] card: Add a method to retrieve the device minor Laurent Pinchart
2020-08-06  7:46   ` Tomi Valkeinen
2020-08-10  5:54     ` Laurent Pinchart
2020-08-10  6:48       ` Tomi Valkeinen
2020-08-06  9:55   ` Sergei Shtylyov
2020-08-06  2:18 ` [PATCH 2/8] card: Rename has_has_universal_planes to has_universal_planes Laurent Pinchart
2020-08-06  2:18 ` Laurent Pinchart [this message]
2020-08-06  2:18 ` [PATCH 4/8] dumbfb: Fix pitch for tri-planar formats Laurent Pinchart
2020-08-06  9:21   ` Tomi Valkeinen
2020-08-08 22:14     ` Laurent Pinchart
2020-08-10  6:16       ` Tomi Valkeinen
2020-08-10  6:28         ` Tomi Valkeinen
2020-08-06  2:18 ` [PATCH 5/8] pykmsbase: Add missing pixel formats Laurent Pinchart
2020-08-06  2:18 ` [PATCH 6/8] kms++: Add support for semiplanar YUV422 formats (NV16 and NV61) Laurent Pinchart
2020-08-06  2:18 ` [PATCH 7/8] kms++: Add support for the planar YUV formats Laurent Pinchart
2020-08-06  2:18 ` [PATCH 8/8] kms++: Add support for missing 8 -and 16-bit RGB formats Laurent Pinchart
2020-08-06  9:33 ` [PATCH 0/8] kmsxx: Various fixes and improvements Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200806021807.21863-4-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.