Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Takanari Hayama <taki@igel.co.jp>
Cc: dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org,
	kieran.bingham+renesas@ideasonboard.com
Subject: Re: [PATCH 3/3] drm: rcar-du: Add DRM blend mode support
Date: Sun, 31 Jul 2022 01:38:05 +0300	[thread overview]
Message-ID: <YuWyzTixSHGDTcjb@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20220704025231.3911138-4-taki@igel.co.jp>

Hi Hayama-san,

Thank you for the patch.

On Mon, Jul 04, 2022 at 11:52:31AM +0900, Takanari Hayama wrote:
> R-Car DU supports different blend modes via VSP1. Add DRM blend mode
> supports to make it configurable.
> 
> As drm_plane_create_blend_mode_property() creates the blend mode
> property with the default value of DRM_MODE_BLEND_PREMULTI, it changes
> the default blending behavior on R-Car DU. The rcar-du's blend mode was
> same as DRM_MODE_BLEND_COVERAGE, i.e., pixel color values have not been
> pre-multitplied.

If that's what KMS userspace requires I'm fine with it.

> Signed-off-by: Takanari Hayama <taki@igel.co.jp>

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

but I expect this patch to change based on my suggestions for 2/3.

> ---
>  drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 17 +++++++++++++++++
>  1 file changed, 17 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..283327046aa5 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
> @@ -170,6 +170,18 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
>  	format = rcar_du_format_info(state->format->fourcc);
>  	cfg.pixelformat = format->v4l2;
>  
> +	switch (state->state.pixel_blend_mode) {
> +	case DRM_MODE_BLEND_PREMULTI:
> +		cfg.blend_mode = VSP1_DU_BLEND_MODE_PREMULTI;
> +		break;
> +	case DRM_MODE_BLEND_COVERAGE:
> +		cfg.blend_mode = VSP1_DU_BLEND_MODE_COVERAGE;
> +		break;
> +	case DRM_MODE_BLEND_PIXEL_NONE:
> +		cfg.blend_mode = VSP1_DU_BLEND_MODE_PIXEL_NONE;
> +		break;
> +	}
> +
>  	vsp1_du_atomic_update(plane->vsp->vsp, crtc->vsp_pipe,
>  			      plane->index, &cfg);
>  }
> @@ -444,6 +456,11 @@ 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_PIXEL_NONE) |
> +					BIT(DRM_MODE_BLEND_PREMULTI) |
> +					BIT(DRM_MODE_BLEND_COVERAGE));
> +
>  		vsp->num_planes++;
>  	}
>  

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2022-07-30 22:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04  2:52 [PATCH 0/3] Add DRM pixel blend mode support to R-Car DU Takanari Hayama
2022-07-04  2:52 ` [PATCH 1/3] media: vsp1: save pixel alpha info in vsp1_rwpf Takanari Hayama
2022-07-30 21:10   ` Laurent Pinchart
2022-07-04  2:52 ` [PATCH 2/3] media: vsp1: add blend mode support Takanari Hayama
2022-07-30 22:36   ` Laurent Pinchart
2022-08-01  8:37     ` Takanari Hayama
2022-07-04  2:52 ` [PATCH 3/3] drm: rcar-du: Add DRM " Takanari Hayama
2022-07-30 22:38   ` Laurent Pinchart [this message]

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=YuWyzTixSHGDTcjb@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-renesas-soc@vger.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