dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Takanari Hayama <taki@igel.co.jp>
Cc: airlied@linux.ie, dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org,
	kieran.bingham+renesas@ideasonboard.com, mchehab@kernel.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v2 2/3] drm: rcar-du: Add DRM_MODE_BLEND_PREMULTI support
Date: Fri, 19 Aug 2022 05:08:12 +0300	[thread overview]
Message-ID: <Yv7wjIx+NLe5iqQn@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20220810083711.219642-3-taki@igel.co.jp>

Hello Hayama-san,

Thank you for the patch.

On Wed, Aug 10, 2022 at 05:37:10PM +0900, Takanari Hayama wrote:
> 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);

I'll drop the parentheses here too, and if you don't mind, I'll move
this down after setting cfg.pixelformat, as premult qualifies the format
so it's more logical in that reading order (no change on the behaviour
of course).

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +
>  	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++;
>  	}
>  

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2022-08-19  2:08 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 ` [PATCH v2 2/3] drm: rcar-du: Add DRM_MODE_BLEND_PREMULTI support Takanari Hayama
2022-08-19  2:08   ` Laurent Pinchart [this message]
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=Yv7wjIx+NLe5iqQn@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=taki@igel.co.jp \
    /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).