drm/msm/dp: check if VSC SDP is supported in DP programming
authorPaloma Arellano <quic_parellan@quicinc.com>
Thu, 22 Feb 2024 19:39:53 +0000 (11:39 -0800)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Mon, 4 Mar 2024 09:34:21 +0000 (11:34 +0200)
In the DP driver, check if VSC SDP is supported and propagate this value
to dp_panel. In dp_display's dp_mode, the out_fmt_is_yuv_420 parameter
must also utilize this value since YUV420 is only allowed when VSC SDP
is supported.

Changes in v2:
- Move DP programming when VSC SDP is supported to this patch

Signed-off-by: Paloma Arellano <quic_parellan@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/579625/
Link: https://lore.kernel.org/r/20240222194025.25329-9-quic_parellan@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/dp/dp_display.c
drivers/gpu/drm/msm/dp/dp_panel.c
drivers/gpu/drm/msm/dp/dp_panel.h

index 4877050bd8b56f48bea88ea261671e303ac12732..3960c5fb7b61f8176b5cd777bbeb99dba598cb4a 100644 (file)
@@ -1550,8 +1550,10 @@ void dp_bridge_mode_set(struct drm_bridge *drm_bridge,
        struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge);
        struct msm_dp *dp = dp_bridge->dp_display;
        struct dp_display_private *dp_display;
+       struct dp_panel *dp_panel;
 
        dp_display = container_of(dp, struct dp_display_private, dp_display);
+       dp_panel = dp_display->panel;
 
        memset(&dp_display->dp_mode, 0x0, sizeof(struct dp_display_mode));
 
@@ -1572,7 +1574,8 @@ void dp_bridge_mode_set(struct drm_bridge *drm_bridge,
                !!(dp_display->dp_mode.drm_mode.flags & DRM_MODE_FLAG_NHSYNC);
 
        dp_display->dp_mode.out_fmt_is_yuv_420 =
-               drm_mode_is_420_only(&dp->connector->display_info, adjusted_mode);
+               drm_mode_is_420_only(&dp->connector->display_info, adjusted_mode) &&
+               dp_panel->vsc_sdp_supported;
 
        /* populate wide_bus_support to different layers */
        dp_display->ctrl->wide_bus_en =
index 8242541a81b956c76ad824bd667d0db49875ad67..c6e90c99bcc8c759a89dbd7efb01b3bdc831243b 100644 (file)
@@ -57,6 +57,7 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel)
        if (rc)
                return rc;
 
+       dp_panel->vsc_sdp_supported = drm_dp_vsc_sdp_supported(panel->aux, dpcd);
        link_info = &dp_panel->link_info;
        link_info->revision = dpcd[DP_DPCD_REV];
        major = (link_info->revision >> 4) & 0x0f;
index 6ec68be9f2366ba168a6fcfd49fb2cbfc5f82fec..e843f5062d1f62ae03006461fd1dd8bea759d0b1 100644 (file)
@@ -46,6 +46,7 @@ struct dp_panel {
        struct dp_display_mode dp_mode;
        struct dp_panel_psr psr_cap;
        bool video_test;
+       bool vsc_sdp_supported;
 
        u32 vic;
        u32 max_dp_lanes;