mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Jose Nieto <jnieto.alaber@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org
Cc: Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/meson: plane: add pixel blend mode property
Date: Thu, 5 Nov 2026 16:47:17 +0100	[thread overview]
Message-ID: <62271e1c-7a4d-4fe2-a68e-41066e7849af@linaro.org> (raw)
In-Reply-To: <20261104155119.284708-1-jnieto.alaber@gmail.com>

On 11/4/26 16:51, Jose Nieto wrote:
> The primary plane exposes ARGB8888, a format with alpha, but never set up
> the pixel blend mode property. This makes the DRM core warn at boot:
> 
>    [PLANE:...:meson_primary_plane] pixel format with alpha exposed but
>    blend mode not setup. Please fix.
> 
> Advertise PIXEL_NONE and COVERAGE and derive OSD_REPLACE_EN from the
> requested blend mode. Formats without alpha (e.g. XRGB8888) keep the
> previous opaque behaviour.
> 
> Signed-off-by: Jose Nieto <jnieto.alaber@gmail.com>
> ---
>   drivers/gpu/drm/meson/meson_plane.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c
> index cf8c90158fcf..115849a0b0c8 100644
> --- a/drivers/gpu/drm/meson/meson_plane.c
> +++ b/drivers/gpu/drm/meson/meson_plane.c
> @@ -233,18 +233,13 @@ static void meson_plane_atomic_update(struct drm_plane *plane,
>   		}
>   	}
>   
> -	switch (fb->format->format) {
> -	case DRM_FORMAT_XRGB8888:
> -	case DRM_FORMAT_XBGR8888:
> -		/* For XRGB, replace the pixel's alpha by 0xFF */
> +	if (!fb->format->has_alpha ||
> +	    new_state->pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE)
> +		/* Ignore the pixel's alpha */
>   		priv->viu.osd1_ctrl_stat2 |= OSD_REPLACE_EN;
> -		break;
> -	case DRM_FORMAT_ARGB8888:
> -	case DRM_FORMAT_ABGR8888:
> -		/* For ARGB, use the pixel's alpha */
> +	else
> +		/* Use the pixel's alpha */
>   		priv->viu.osd1_ctrl_stat2 &= ~OSD_REPLACE_EN;
> -		break;
> -	}
>   
>   	/* Default scaler parameters */
>   	vsc_bot_rcv_num = 0;
> @@ -536,6 +531,7 @@ int meson_plane_create(struct meson_drm *priv)
>   	struct drm_plane *plane;
>   	const uint64_t *format_modifiers = format_modifiers_default;
>   	int ret;
> +	unsigned int blend_modes = BIT(DRM_MODE_BLEND_PIXEL_NONE) | BIT(DRM_MODE_BLEND_COVERAGE);
>   
>   	meson_plane = devm_kzalloc(priv->drm->dev, sizeof(*meson_plane),
>   				   GFP_KERNEL);
> @@ -566,6 +562,10 @@ int meson_plane_create(struct meson_drm *priv)
>   	/* For now, OSD Primary plane is always on the front */
>   	drm_plane_create_zpos_immutable_property(plane, 1);
>   
> +	ret = drm_plane_create_blend_mode_property(plane, blend_modes);
> +	if (ret)
> +		return ret;
> +
>   	priv->primary_plane = plane;
>   
>   	return 0;

Sounds good, thanks !


Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

      reply	other threads:[~2026-11-05 15:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 15:51 Jose Nieto
2026-11-05 15:47 ` Neil Armstrong [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=62271e1c-7a4d-4fe2-a68e-41066e7849af@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jbrunet@baylibre.com \
    --cc=jnieto.alaber@gmail.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®