From 4effde5930f44e42a3eaa322efc426e47d97d6bc Mon Sep 17 00:00:00 2001 From: Rajkumar Subbiah Date: Sat, 18 Mar 2023 16:33:42 -0400 Subject: [PATCH] disp: msm: dp: check capability before enabling crc This is a partial revert of I67ace5c064b2b56d03732a78f334ea6b1b649608 which tries to enable Sink CRC irrespective of the sink's CRC capability to workaround an issue with a specific sinks which reports incorrect capability on first plugin. But this causes some MST dongles to misbehave causing one or both outputs to be blank. Change-Id: I70c70db8ac371fe0094a45780216a2518d688a36 Signed-off-by: Rajkumar Subbiah --- msm/dp/dp_panel.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/msm/dp/dp_panel.c b/msm/dp/dp_panel.c index 4e9cbb515c..1e491bec52 100644 --- a/msm/dp/dp_panel.c +++ b/msm/dp/dp_panel.c @@ -3113,15 +3113,17 @@ int dp_panel_sink_crc_enable(struct dp_panel *dp_panel, bool enable) panel = container_of(dp_panel, struct dp_panel_private, dp_panel); drm_aux = panel->aux->drm_aux; - ret = drm_dp_dpcd_readb(drm_aux, DP_TEST_SINK, &buf); - if (ret < 0) - return ret; + if (dp_panel->link_info.capabilities & DP_LINK_CAP_CRC) { + ret = drm_dp_dpcd_readb(drm_aux, DP_TEST_SINK, &buf); + if (ret < 0) + return ret; - ret = drm_dp_dpcd_writeb(drm_aux, DP_TEST_SINK, buf | DP_TEST_SINK_START); - if (ret < 0) - return ret; + ret = drm_dp_dpcd_writeb(drm_aux, DP_TEST_SINK, buf | DP_TEST_SINK_START); + if (ret < 0) + return ret; - drm_dp_dpcd_readb(drm_aux, DP_TEST_SINK, &buf); + drm_dp_dpcd_readb(drm_aux, DP_TEST_SINK, &buf); + } return rc; }