mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/modeset-helper: Add blend mode property to the legacy primary plane
@ 2026-09-02  3:12 oushixiong1025
  2026-09-02  7:20 ` Thomas Zimmermann
  0 siblings, 1 reply; 2+ messages in thread
From: oushixiong1025 @ 2026-09-02  3:12 UTC (permalink / raw)
  To: Maarten Lankhorst
  Cc: Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	dri-devel, linux-kernel, Shixiong Ou

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.

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;
-- 
2.25.1


No virus found
		Checked by Hillstone Network AntiVirus


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-02  7:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-02  3:12 [PATCH] drm/modeset-helper: Add blend mode property to the legacy primary plane oushixiong1025
2026-09-02  7:20 ` Thomas Zimmermann

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®