From: Thomas Zimmermann <tzimmermann@suse.de>
To: oushixiong1025@163.com,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Shixiong Ou <oushixiong@kylinos.cn>
Subject: Re: [PATCH] drm/modeset-helper: Add blend mode property to the legacy primary plane
Date: Wed, 2 Sep 2026 09:20:22 +0200 [thread overview]
Message-ID: <ca60aed1-df30-458e-81df-49b4902af768@suse.de> (raw)
In-Reply-To: <20260902031232.165532-1-oushixiong1025@163.com>
Hi
Am 02.09.26 um 05:12 schrieb oushixiong1025@163.com:
> From: Shixiong Ou <oushixiong@kylinos.cn>
>
> The primary plane created by drm_crtc_init() exposes ARGB8888, which
> has an alpha channel, but never gets a "pixel blend mode" property, so
> drm_mode_config_validate() warns for every driver using this helper
> (radeon, gma500, legacy amdgpu DCE). Advertise only
> DRM_MODE_BLEND_PREMULTI, the mode userspace always assumed when the
> property was absent.
I'd like to suggest a different strategy. The helper drm_crtc_init() is
deprecated and there are only 3 drivers left that call it: amdgpu,
gma500 and radeon. It would be better to make a series for each that
integrates the helper into the driver and adapts the format array to the
hardware/driver's actual functionality. For gma500 at least, I'm pretty
sure it does not support ARGB on its primary plane.
There's also work happening already for fixing amdgpu blend properties IIRC.
Best regards
Thomas
>
> Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
> Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
> ---
> drivers/gpu/drm/drm_modeset_helper.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_modeset_helper.c b/drivers/gpu/drm/drm_modeset_helper.c
> index e54584da4c3d..4c59e82af2f1 100644
> --- a/drivers/gpu/drm/drm_modeset_helper.c
> +++ b/drivers/gpu/drm/drm_modeset_helper.c
> @@ -23,6 +23,7 @@
> #include <linux/export.h>
>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_blend.h>
> #include <drm/drm_client_event.h>
> #include <drm/drm_fourcc.h>
> #include <drm/drm_framebuffer.h>
> @@ -160,6 +161,17 @@ int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
> */
> primary->format_default = true;
>
> + /*
> + * safe_modeset_formats[] includes ARGB8888, which has an alpha
> + * channel. Advertise the blend mode userspace has always assumed
> + * for such planes when the "pixel blend mode" property was absent,
> + * to satisfy drm_mode_config_validate().
> + */
> + ret = drm_plane_create_blend_mode_property(primary,
> + BIT(DRM_MODE_BLEND_PREMULTI));
> + if (ret)
> + goto err_drm_plane_cleanup;
> +
> ret = drm_crtc_init_with_planes(dev, crtc, primary, NULL, funcs, NULL);
> if (ret)
> goto err_drm_plane_cleanup;
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)
prev parent reply other threads:[~2026-09-02 7:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 3:12 oushixiong1025
2026-09-02 7:20 ` Thomas Zimmermann [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=ca60aed1-df30-458e-81df-49b4902af768@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=oushixiong1025@163.com \
--cc=oushixiong@kylinos.cn \
--cc=simona@ffwll.ch \
/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®