Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] amdgpu: missing EDID override check in rgb_output_is_limited_range()
--

commit 8529835fe6f32deeb33be0fa62706033cd8f1243
Author: Johannes Wüller <[email protected]>

    drm/amd: fix HDMI signal type for EDID overrides

This commit updates AMD display code to trust the physical connector type
over the EDID for HDMI capabilities when an EDID override is active. This
fixes cases where the overriding EDID does not advertise HDMI capabilities.

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> index ad3383169d83f..2bce57b060374 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> @@ -2134,7 +2134,14 @@ VISIBLE_IF_KUNIT void create_eml_sink(struct 
> amdgpu_dm_connector *aconnector)
>               return;
>       }
>  
> -     if (connector->display_info.is_hdmi)
> +     /*
> +      * If an EDID override is active, it may not advertise HDMI capability
> +      * even though the physical connector is HDMI. Trust the connector type.
> +      */
> +     if (connector->display_info.is_hdmi ||
> +         (connector->edid_overridden &&
> +          (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
> +           connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)))

[Severity: Medium]
Does this same logic need to be applied to rgb_output_is_limited_range()
in the same file?

Looking at rgb_output_is_limited_range(), it relies directly on
display_info.is_hdmi to determine the default RGB range:

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c:rgb_output_is_limited_range()
{
        switch (connector_state->hdmi.broadcast_rgb) {
        ...
        default:
                return connector_state->connector->display_info.is_hdmi &&
                       dc_crtc_timing->vic > 1;
}

If a user supplies an EDID override without HDMI capabilities for a physical
HDMI connector, display_info.is_hdmi evaluates to false here. This causes
the function to incorrectly default to Full Range RGB instead of Limited
Range RGB for standard TV formats (VIC > 1). This results in incorrect
color range output (crushed blacks and clipped whites).

Could this override check also be added to rgb_output_is_limited_range()
so TV formats correctly output limited range RGB?

>               init_params.sink_signal = SIGNAL_TYPE_HDMI_TYPE_A;
>  
>       aconnector->drm_edid = drm_edid;

-- 
Sashiko AI review · 
https://sashiko.dev/#/patchset/[email protected]?part=2

Reply via email to