Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] The macro `WNDW_BLEND_MODES` is defined as a bitwise OR of multiple 
values without enclosing parentheses, creating a latent bug due to operator 
precedence.
--

--- Patch [1]: [PATCH v3 1/3] drm/nouveau/kms/nv50-: Add .blend_modes to 
nv50_wndw_func ---
commit d67d01315e1f18573429becf6e45ab97a7ea2324
Author: Lyude Paul <[email protected]>

drm/nouveau/kms/nv50-: Add .blend_modes to nv50_wndw_func

This commit adds a .blend_modes field to the nv50_wndw_func struct and
various display structures. This introduces a way to look up supported
blend modes for different types of windows to expose a blend property
for all planes that can display color formats with an alpha channel.

[ ... ]
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.h 
> b/drivers/gpu/drm/nouveau/dispnv50/wndw.h
> index 90d100514bef2..81af5c3369d4c 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.h
> +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.h
[ ... ]
> @@ -139,4 +142,11 @@ int wndwca7e_new(struct nouveau_drm *, enum 
> drm_plane_type, int, s32,
>  
>  int nv50_wndw_new(struct nouveau_drm *, enum drm_plane_type, int index,
>                 struct nv50_wndw **);
> +
> +/* A set of blend modes supported by all wndws */
> +#define WNDW_BLEND_MODES               \
> +       BIT(DRM_MODE_BLEND_COVERAGE) \
> +     | BIT(DRM_MODE_BLEND_PREMULTI) \
> +     | BIT(DRM_MODE_BLEND_PIXEL_NONE)

[Severity: Low]
Does this multi-token macro need to be enclosed in parentheses?

If WNDW_BLEND_MODES is later used in an expression with operators that have
higher precedence than bitwise OR (such as flags & WNDW_BLEND_MODES),
it will evaluate incorrectly. Enclosing the entire expression in
parentheses would prevent future operator precedence issues.

> +
>  #endif
[ ... ]

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

Reply via email to