Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] The newly added DCUltraLite chip restricts the max cursor size to 
32x32, but the driver does not configure `drm->mode_config.cursor_width` or 
`cursor_height`. DRM core defaults to 64x64 when these fields are 0. This 
incorrectly exposes a `DRM_CAP_CURSOR_WIDTH` of 64 to userspace, causing atomic 
commits with 64x64 hardware cursors to be rejected with `-EINVAL`, breaking 
display compositors.
--

commit a3c0d8a714c977c54ec25009535f44e9ded7c881
Author: Joey Lu <[email protected]>

drm/verisilicon: add DCUltraLite chip identity to HWDB

The Nuvoton MA35D1 chip contains a DCUltraLite display controller with
model number 0x0 (sic, the model name contains no number either),
revision 0x5560 and customer ID 0x305.  It has a similar register map
with DC8000, only one display output and only 32x32 cursor supported.

> diff --git a/drivers/gpu/drm/verisilicon/vs_hwdb.c 
> b/drivers/gpu/drm/verisilicon/vs_hwdb.c
> index 91524d16f7785..7d630a667a3f0 100644
> --- a/drivers/gpu/drm/verisilicon/vs_hwdb.c
> +++ b/drivers/gpu/drm/verisilicon/vs_hwdb.c
> @@ -129,6 +129,16 @@ static struct vs_chip_identity vs_chip_identities[] = {
>               .max_cursor_size = 64,
>               .formats = &vs_formats_no_yuv444,
>       },
> +     {
> +             .model = 0x0,           /* DCUltraLite */
> +             .revision = 0x5560,
> +             .customer_id = 0x305,
> +
> +             .generation = VSDC_GEN_DC8000,
> +             .display_count = 1,
> +             .max_cursor_size = 32,

[Severity: High]
Does this code expose an incorrect DRM_CAP_CURSOR_WIDTH to userspace?

Looking at vs_mode_config_init() in drivers/gpu/drm/verisilicon/vs_drm.c,
the driver does not seem to configure drm->mode_config.cursor_width or
cursor_height:

drivers/gpu/drm/verisilicon/vs_drm.c:vs_mode_config_init() {
    ...
    drm->mode_config.helper_private = &vs_mode_config_helper_funcs;
}

When these fields are 0, the DRM core defaults to 64x64. This means userspace
compositors might query the capability, receive 64x64, and attempt to commit
a 64x64 hardware cursor.

If this new chip restricts the max cursor size to 32x32, will the driver's
atomic check reject the 64x64 state and break display compositors?

> +             .formats = &vs_formats_no_yuv444,
> +     },
>  };

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

Reply via email to