Skip to contentSkip to conversation

drm/atomic: Set plane-state pixel_blend_mode to default

PATCH In review Thomas Zimmermann 1 participant 2 messages Sep 1 – Sep 3

Subsystems (2)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH 1/1 drm/atomic: Set plane-state pixel_blend_mode to default

Initialize the plane state's pixel_blend_mode value to the plane property's default value. Resolves an inconsistency on planes that do not support PREMULTI.

Fixes 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
Cc Leandro Ribeiro <[email protected]>
Cc Pekka Paalanen <[email protected]>
Cc Daniel Stone <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>

---
It's not clear what Fixes should point to, so I picked the commit that introduced the stricter validation of the blend-mode property.

---
 drivers/gpu/drm/drm_atomic_state_helper.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic_state_helper.c +7 -1
index d90d1d7c9cf9..0325caee528a 100644
@@ -278,7 +278,13 @@ void __drm_atomic_helper_plane_state_init(struct drm_plane_state *plane_state,
 	plane_state->rotation = DRM_MODE_ROTATE_0;
 
 	plane_state->alpha = DRM_BLEND_ALPHA_OPAQUE;
-	plane_state->pixel_blend_mode = DRM_MODE_BLEND_PREMULTI;
+
+	if (plane->blend_mode_property) {
+		if (!drm_object_property_get_default_value(&plane->base,
+							   plane->blend_mode_property,
+							   &val))
+			plane_state->pixel_blend_mode = val;
+	}
 
 	if (plane->color_encoding_property) {
 		if (!drm_object_property_get_default_value(&plane->base,
Signature · 1 line
2.55.0
author maintainer
#1 lore raw

Am 01.09.26 um 14:25 schrieb Thomas Zimmermann:

Quoted 3 lines

Initialize the plane state's pixel_blend_mode value to the plane property's default value. Resolves an inconsistency on planes that do not support PREMULTI.

Never mind. It's a duplicate of

https://lore.kernel.org/dri-devel/2026090341-appraisal-jot-6aec@gregkh/T/#m10bbb3677bbc65b9f358751f174a5fd3d2d319e7

Quoted 35 lines
Fixes 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
Cc Leandro Ribeiro <[email protected]>
Cc Pekka Paalanen <[email protected]>
Cc Daniel Stone <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>

---
It's not clear what Fixes should point to, so I picked the commit that introduced the stricter validation of the blend-mode property.

---
  drivers/gpu/drm/drm_atomic_state_helper.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic_state_helper.c +7 -1
index d90d1d7c9cf9..0325caee528a 100644
@@ -278,7 +278,13 @@ void __drm_atomic_helper_plane_state_init(struct drm_plane_state *plane_state,
  	plane_state->rotation = DRM_MODE_ROTATE_0;
 
  	plane_state->alpha = DRM_BLEND_ALPHA_OPAQUE;
-	plane_state->pixel_blend_mode = DRM_MODE_BLEND_PREMULTI;
+
+	if (plane->blend_mode_property) {
+		if (!drm_object_property_get_default_value(&plane->base,
+							   plane->blend_mode_property,
+							   &val))
+			plane_state->pixel_blend_mode = val;
+	}
 
  	if (plane->color_encoding_property) {
  		if (!drm_object_property_get_default_value(&plane->base,
Signature · 6 lines
--
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)