dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Takanari Hayama <taki@igel.co.jp>
To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Cc: Takanari Hayama <taki@igel.co.jp>,
	airlied@linux.ie, kieran.bingham+renesas@ideasonboard.com,
	laurent.pinchart@ideasonboard.com, mchehab@kernel.org
Subject: [PATCH v2 1/3] media: vsp1: add premultiplied alpha support
Date: Wed, 10 Aug 2022 17:37:09 +0900	[thread overview]
Message-ID: <20220810083711.219642-2-taki@igel.co.jp> (raw)
In-Reply-To: <20220810083711.219642-1-taki@igel.co.jp>

To support DRM blend mode in R-Car DU driver, we must be able to pass
a plane with the premultiplied alpha. Adding a new property to
vsp1_du_atomic_config allows the R-Car DU driver to pass the
premultiplied alpha plane.

Signed-off-by: Takanari Hayama <taki@igel.co.jp>
---
 drivers/media/platform/renesas/vsp1/vsp1_drm.c | 2 ++
 include/media/vsp1.h                           | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drm.c b/drivers/media/platform/renesas/vsp1/vsp1_drm.c
index 0c2507dc03d6..019e18976bd8 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_drm.c
@@ -856,6 +856,8 @@ int vsp1_du_atomic_update(struct device *dev, unsigned int pipe_index,
 	rpf->mem.addr[1] = cfg->mem[1];
 	rpf->mem.addr[2] = cfg->mem[2];
 
+	rpf->format.flags = (cfg->premult) ? V4L2_PIX_FMT_FLAG_PREMUL_ALPHA : 0;
+
 	vsp1->drm->inputs[rpf_index].crop = cfg->src;
 	vsp1->drm->inputs[rpf_index].compose = cfg->dst;
 	vsp1->drm->inputs[rpf_index].zpos = cfg->zpos;
diff --git a/include/media/vsp1.h b/include/media/vsp1.h
index cc1b0d42ce95..48f4a5023d81 100644
--- a/include/media/vsp1.h
+++ b/include/media/vsp1.h
@@ -51,6 +51,7 @@ int vsp1_du_setup_lif(struct device *dev, unsigned int pipe_index,
  * @dst: destination rectangle on the display (integer coordinates)
  * @alpha: alpha value (0: fully transparent, 255: fully opaque)
  * @zpos: Z position of the plane (from 0 to number of planes minus 1)
+ * @premult: true for premultiplied alpha
  */
 struct vsp1_du_atomic_config {
 	u32 pixelformat;
@@ -60,6 +61,7 @@ struct vsp1_du_atomic_config {
 	struct v4l2_rect dst;
 	unsigned int alpha;
 	unsigned int zpos;
+	bool premult;
 };
 
 /**
-- 
2.25.1


  reply	other threads:[~2022-08-10  8:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10  8:37 [PATCH v2 0/3] Add DRM pixel blend mode support to R-Car DU Takanari Hayama
2022-08-10  8:37 ` Takanari Hayama [this message]
2022-08-10 17:41   ` [PATCH v2 1/3] media: vsp1: add premultiplied alpha support Sergey Shtylyov
2022-08-16  6:01     ` Takanari Hayama
2022-08-19  2:01   ` Laurent Pinchart
2022-08-19  2:04     ` Takanari Hayama
2022-08-19  2:38     ` Laurent Pinchart
2022-09-06 11:10       ` Mauro Carvalho Chehab
2022-08-10  8:37 ` [PATCH v2 2/3] drm: rcar-du: Add DRM_MODE_BLEND_PREMULTI support Takanari Hayama
2022-08-19  2:08   ` Laurent Pinchart
2022-08-19  3:05     ` Takanari Hayama
2022-08-10  8:37 ` [PATCH v2 3/3] drm: rcar-du: Add DRM_MODE_BLEND_PIXEL_NONE support Takanari Hayama
2022-08-19  2:10   ` Laurent Pinchart

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=20220810083711.219642-2-taki@igel.co.jp \
    --to=taki@igel.co.jp \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).