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.

Signed-off-by: Thomas Zimmermann <[email protected]>
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(-)

diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c 
b/drivers/gpu/drm/drm_atomic_state_helper.c
index d90d1d7c9cf9..0325caee528a 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -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,
-- 
2.55.0

Reply via email to