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 2/3] drm: rcar-du: Add DRM_MODE_BLEND_PREMULTI support
Date: Wed, 10 Aug 2022 17:37:10 +0900 [thread overview]
Message-ID: <20220810083711.219642-3-taki@igel.co.jp> (raw)
In-Reply-To: <20220810083711.219642-1-taki@igel.co.jp>
R-Car DU driver implicitly supports DRM_MODE_BLEND_COVERAGE only.
This adds a support for DRM_MODE_BLEND_PREMULTI. As a consequence,
DRM_MODE_BLEND_PREMULTI becomes the default. If DRM_MODE_BLEND_COVERAGE
is desired, it should be set explicitly.
This behavior comes from how DRM blend mode is supported.
drm_plane_create_blend_mode_property() creates the blend mode property
with the default value of DRM_MODE_BLEND_PREMULTI. This default value
cannot be modified from the atomic driver.
Signed-off-by: Takanari Hayama <taki@igel.co.jp>
---
drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
index 8eb9b2b097ae..b9580fcfec7a 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -167,6 +167,8 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
+ fb->offsets[i];
+ cfg.premult = (state->state.pixel_blend_mode == DRM_MODE_BLEND_PREMULTI);
+
format = rcar_du_format_info(state->format->fourcc);
cfg.pixelformat = format->v4l2;
@@ -444,6 +446,10 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
num_planes - 1);
}
+ drm_plane_create_blend_mode_property(&plane->plane,
+ BIT(DRM_MODE_BLEND_PREMULTI) |
+ BIT(DRM_MODE_BLEND_COVERAGE));
+
vsp->num_planes++;
}
--
2.25.1
next prev parent 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 ` [PATCH v2 1/3] media: vsp1: add premultiplied alpha support Takanari Hayama
2022-08-10 17:41 ` 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 ` Takanari Hayama [this message]
2022-08-19 2:08 ` [PATCH v2 2/3] drm: rcar-du: Add DRM_MODE_BLEND_PREMULTI support 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-3-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).