Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] The cursor plane's initial atomic state for the blend mode property is 
set to an unsupported value (`DRM_MODE_BLEND_PREMULTI`), which breaks atomic 
state restoration.
--

commit 1ab10188d3825ff30d7b2814879afdf8a8dc65e6
Author: Qinyun Tan <[email protected]>
Subject: drm/ast: create blend mode property on cursor plane

This patch adds a blend mode property to the ast cursor plane to satisfy the
drm_mode_config_validate() warning about missing blend modes on planes
exposing an alpha pixel format. The newly created property only advertises
DRM_MODE_BLEND_COVERAGE.

> diff --git a/drivers/gpu/drm/ast/ast_cursor.c 
> b/drivers/gpu/drm/ast/ast_cursor.c
> index fd19c45f2abe2..690d4cd1db5ee 100644
> --- a/drivers/gpu/drm/ast/ast_cursor.c
> +++ b/drivers/gpu/drm/ast/ast_cursor.c

[ ... ]

> @@ -355,6 +356,8 @@ int ast_cursor_plane_init(struct ast_device *ast)
>       }
>       drm_plane_helper_add(cursor_plane, &ast_cursor_plane_helper_funcs);
>       drm_plane_enable_fb_damage_clips(cursor_plane);
> +     drm_plane_create_blend_mode_property(cursor_plane,
> +                                          BIT(DRM_MODE_BLEND_COVERAGE));

[Severity: High]
Does this mismatch with the default reset hook and break atomic state
restoration?

The cursor plane uses DRM_GEM_SHADOW_PLANE_FUNCS in ast_cursor_plane_funcs,
which defaults to drm_gem_reset_shadow_plane(). That function calls the
core DRM helper __drm_atomic_helper_plane_state_init(), which hardcodes
plane_state->pixel_blend_mode = DRM_MODE_BLEND_PREMULTI. The driver does
not provide a custom .reset hook to override this default.

Since the blend mode property is created here to strictly support only
DRM_MODE_BLEND_COVERAGE, it doesn't support the DRM_MODE_BLEND_PREMULTI
value assigned by the default reset hook.

Because of this mismatch, userspace state queries will return an invalid
enum value that is not in the property's valid enum mask. If a compositor
attempts to save and restore this exact state using the atomic ioctl,
drm_property_change_valid_get() will reject it with -EINVAL. This could
break compositor initialization, virtual terminal switching, and
read-modify-write atomic commits on the cursor plane.

Could we add a custom reset hook to initialize the blend mode to
DRM_MODE_BLEND_COVERAGE, or include DRM_MODE_BLEND_PREMULTI in the
property's valid enum mask?

>  
>       return 0;
>  }

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to