Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] Unconditionally advertising DRM_MODE_BLEND_PIXEL_NONE for planes 
lacking a blend_set function misrepresents hardware capabilities and causes an 
invalid default state.
--

--- Patch [1]: [PATCH] drm/nouveau/kms/nv50-: Unconditionally create blend_mode 
prop for wndws ---
commit 65d6020658fcfef6b7934d20f776a5e3e0b49e2b
Author: Lyude Paul <[email protected]>

drm/nouveau/kms/nv50-: Unconditionally create blend_mode prop for wndws

This commit unconditionally calls drm_plane_create_blend_mode_property()
for all window types, including cursors, to prevent a warning when a
pixel format with alpha is exposed but the blend mode is not set up.

> diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c 
> b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
> @@ -860,6 +860,7 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct 
> drm_device *dev,
>       struct nv50_disp *disp = nv50_disp(dev);
>       struct nv50_wndw *wndw;
>       const u64 *format_modifiers;
> +     unsigned int blend_modes = BIT(DRM_MODE_BLEND_PIXEL_NONE);
>       int nformat;
>       int ret;

[ ... ]

> @@ -922,6 +918,10 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct 
> drm_device *dev,
>                       return ret;
>       }
>  
> +     ret = drm_plane_create_blend_mode_property(&wndw->plane, blend_modes);
> +     if (ret)
> +             return ret;

[Severity: High]
Does this cause a UAPI mismatch by exposing only DRM_MODE_BLEND_PIXEL_NONE
for cursor planes or other planes lacking a blend_set function?

In the DRM core, __drm_atomic_helper_plane_state_init() hardcodes the
default plane_state->pixel_blend_mode to DRM_MODE_BLEND_PREMULTI.

If nv50_wndw_new_() initializes blend_modes to only allow PIXEL_NONE, the
resulting property state will contain a default value (PREMULTI) that is
not part of its valid enum list.

Could this cause strict compositors like Weston to crash or fail
initialization when they validate the property values against the allowed
dictionary?

Will this also cause userspace to falsely assume the hardware cursor lacks
alpha blending support?

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

Reply via email to