Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] drm/msm/dp: PSR state mismatch causes blank screen for YUV420 modes
--

commit 1a1587a85fbd9d8b79a76366fd11f806251ab09b
Author: Xilin Wu <[email protected]>
Subject: drm/msm/dp: Signal BT.2020 RGB on DP and eDP

This commit exposes the DP Colorspace property and handles VSC packets
in the bridge atomic state. It disables PSR in the controller and sink
while colorimetry VSC packets are active, as they cannot share the
automatic PSR packet generator.

> diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c
> --- a/drivers/gpu/drm/msm/dp/dp_drm.c
> +++ b/drivers/gpu/drm/msm/dp/dp_drm.c
> @@ -208,12 +208,13 @@ static int msm_edp_bridge_atomic_check(struct 
> drm_bridge *drm_bridge,
>       if (WARN_ON(!conn_state))
>               return -ENODEV;
>  
> -     conn_state->self_refresh_aware = dp->psr_supported;
> +     conn_state->self_refresh_aware = dp->psr_supported &&
> +             conn_state->colorspace == DRM_MODE_COLORIMETRY_DEFAULT;

[Severity: High]
Does this logic create a state mismatch for YUV420 modes between software
and hardware?

In msm_dp_display_atomic_check(), state->vsc_enabled is correctly set to
true for YUV420 modes:

msm_dp_display_atomic_check() {
    ...
    state->vsc_enabled = drm_mode_is_420_only(info, mode) ||
                         state->colorspace != DRM_MODE_COLORIMETRY_DEFAULT;
    ...
}

When vsc_enabled is true, hardware PSR is then disabled in
msm_dp_display_post_enable():

msm_dp_display_post_enable() {
    ...
    if (msm_dp_display->psr_supported)
        msm_dp_ctrl_config_psr(dp->ctrl, dp->panel, !dp->panel->vsc_enabled);
    ...
}

However, msm_edp_bridge_atomic_check() only checks the colorspace against
DRM_MODE_COLORIMETRY_DEFAULT to determine if the connector is self-refresh
aware. Because it misses the check for YUV420 modes, the DRM core might
believe PSR is supported and active, while the driver explicitly disables
hardware PSR.

Could this cause the host to stop transmitting video data for self-refresh
while the panel is not actually in self-refresh mode, leading to a blank
screen or PSR entry timeouts?

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

Reply via email to