Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] State mismatch between blend mode property and atomic state 
initialization rejects atomic commits.
--

commit e4c1ccbb76c983c05930b35bbb7291c8273016d7
Author: Huacai Chen <[email protected]>

drm/loongson: Create blend mode property for cursor plane

This commit adds a blend mode property for cursor planes, exposing only
the DRM_MODE_BLEND_COVERAGE mode since the hardware does not support
DRM_MODE_BLEND_PREMULTI.

> diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c 
> b/drivers/gpu/drm/loongson/lsdc_plane.c
> index bea42215796d4..bcc0ffa17bdf2 100644
> --- a/drivers/gpu/drm/loongson/lsdc_plane.c
> +++ b/drivers/gpu/drm/loongson/lsdc_plane.c
[ ... ]
> @@ -765,7 +766,7 @@ int ls7a1000_cursor_plane_init(struct drm_device *ddev,
>  
>       drm_plane_helper_add(plane, &ls7a1000_cursor_plane_helper_funcs);
>  
> -     return 0;
> +     return drm_plane_create_blend_mode_property(plane, 
> BIT(DRM_MODE_BLEND_COVERAGE));
>  }

[Severity: High]
Will this cause atomic commits to fail during modesetting?

This adds a blend mode property supporting only COVERAGE, but the driver's
plane functions use the default reset hook:

drivers/gpu/drm/loongson/lsdc_plane.c:lsdc_plane_funcs {
        ...
        .reset = drm_atomic_helper_plane_reset,
        ...
}

The default drm_atomic_helper_plane_reset() unconditionally initializes
the plane state to PREMULTI.

Because PREMULTI is not registered as a supported enum value in the plane's
blend mode property mask, when compositors query the current properties and
submit them back, validation fails in drm_property_change_valid_get()
returning -EINVAL.

Should the driver provide a custom reset hook that initializes the state to
DRM_MODE_BLEND_COVERAGE instead?

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

Reply via email to