Skip to content

Commit 8e2dcdf

Browse files
Sasha Levingregkh
authored andcommitted
drm/msm/dp: account for widebus and yuv420 during mode validation
[ Upstream commit df9cf85 ] Widebus allows the DP controller to operate in 2 pixel per clock mode. The mode validation logic validates the mode->clock against the max DP pixel clock. However the max DP pixel clock limit assumes widebus is already enabled. Adjust the mode validation logic to only compare the adjusted pixel clock which accounts for widebus against the max DP pixel clock. Also fix the mode validation logic for YUV420 modes as in that case as well, only half the pixel clock is needed. Cc: stable@vger.kernel.org Fixes: 757a2f3 ("drm/msm/dp: enable widebus feature for display port") Fixes: 6db6e56 ("drm/msm/dp: change clock related programming for YUV420 over DP") Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Dale Whinham <daleyo@gmail.com> Patchwork: https://patchwork.freedesktop.org/patch/635789/ Link: https://lore.kernel.org/r/20250206-dp-widebus-fix-v2-1-cb89a0313286@quicinc.com Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 287b9ce commit 8e2dcdf

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

drivers/gpu/drm/msm/dp/dp_display.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -928,16 +928,17 @@ enum drm_mode_status dp_bridge_mode_valid(struct drm_bridge *bridge,
928928
return -EINVAL;
929929
}
930930

931-
if (mode->clock > DP_MAX_PIXEL_CLK_KHZ)
932-
return MODE_CLOCK_HIGH;
933-
934931
dp_display = container_of(dp, struct dp_display_private, dp_display);
935932
link_info = &dp_display->panel->link_info;
936933

937-
if (drm_mode_is_420_only(&dp->connector->display_info, mode) &&
938-
dp_display->panel->vsc_sdp_supported)
934+
if ((drm_mode_is_420_only(&dp->connector->display_info, mode) &&
935+
dp_display->panel->vsc_sdp_supported) ||
936+
msm_dp_wide_bus_available(dp))
939937
mode_pclk_khz /= 2;
940938

939+
if (mode_pclk_khz > DP_MAX_PIXEL_CLK_KHZ)
940+
return MODE_CLOCK_HIGH;
941+
941942
mode_bpp = dp->connector->display_info.bpc * num_components;
942943
if (!mode_bpp)
943944
mode_bpp = default_bpp;

drivers/gpu/drm/msm/dp/dp_drm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ static enum drm_mode_status edp_bridge_mode_valid(struct drm_bridge *bridge,
257257
return -EINVAL;
258258
}
259259

260-
if (mode->clock > DP_MAX_PIXEL_CLK_KHZ)
260+
if (msm_dp_wide_bus_available(dp))
261+
mode_pclk_khz /= 2;
262+
263+
if (mode_pclk_khz > DP_MAX_PIXEL_CLK_KHZ)
261264
return MODE_CLOCK_HIGH;
262265

263266
/*

0 commit comments

Comments
 (0)