Thank you for your contribution! Sashiko AI review found 2 potential issue(s) 
to consider:
- [Medium] Missing generic bounds validation for `min_requested_bpc` against 
`max_bpc` in core DRM atomic check.
- [Low] The newly introduced 'min_requested_bpc' field is not printed in 
debugfs atomic state dumps.
--

--- Patch [1]: [PATCH v2 1/2] drm/connector: Introduce "min bpc" connector 
property ---
commit c6fed32ee27d744d2ae9e2fb7635ec916f3ea61f
Author: Nicolas Frattaroli <[email protected]>

    drm/connector: Introduce "min bpc" connector property
    
    Add a new KMS connector property called "min bpc". Its purpose is to
    allow userspace to mandate that the output bit depth ends up greater
    than or equal to a specified depth, or else have the commit fail. This
    is useful for checking for output depth degradation in combination with
    atomic test commits.

> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index a0cf0268de483..35f395d46f6b9 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1267,6 +1267,11 @@ struct drm_connector_state {
>        */
>       u8 max_requested_bpc;
>  
> +     /**
> +      * @min_requested_bpc: Minimum output bit depth requested by userspace
> +      */
> +     u8 min_requested_bpc;
> +

[Severity: Low]
Does this omit printing the newly added min_requested_bpc?

When a developer or user reads /sys/kernel/debug/dri/*/state to inspect the
atomic KMS configuration, drm_atomic_connector_print_state() in
drivers/gpu/drm/drm_atomic.c prints max_requested_bpc but doesn't seem to
print min_requested_bpc, which could lead to incomplete state dumps.

[Severity: Medium]
Does the DRM core need to validate that min_requested_bpc <= max_bpc?

The core drm_atomic_connector_check() function in drivers/gpu/drm/drm_atomic.c
calculates state->max_bpc but doesn't verify that
state->min_requested_bpc <= state->max_bpc. 

If userspace sets the "min bpc" property to a value higher than max_bpc and
issues an atomic commit, this impossible constraint isn't rejected by the DRM
core.

This forces every driver implementing this property to manually check for this
contradiction. If a driver fails to do so, it may silently configure a bit
depth lower than min_requested_bpc, violating the explicit uAPI contract
that the commit must fail if the minimum bit depth cannot be met.

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

Reply via email to