From fb11a337350b4901164751ba74140616363f0bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Tue, 1 Oct 2019 13:53:58 -0700 Subject: [PATCH] drm/i915/psr: Blacklist PSR2 in a specific panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As reported in the bug bellow, enabling PSR2 is causing some glitches in this specific panel, visually looks like panel is not showing some selective update blocks. We have panels of the same model in our CI(fi-icl-u3 and fi-icl-u2) and I have one in my desk but all of them behave as expected so it is probably some panel batch or model variantion problem. So here, searching in EDID for the monitor string TK6R7 that is only present in panels of this notebook model and not enabling PSR2 when it is found. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111701 Reported-by: Sultan Alsawaf Signed-off-by: José Roberto de Souza --- drivers/gpu/drm/i915/display/intel_psr.c | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index b3c7eef53bf3..34b823333251 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -534,6 +534,44 @@ transcoder_has_psr2(struct drm_i915_private *dev_priv, enum transcoder trans) return trans == TRANSCODER_EDP; } +static bool +panel_in_psr2_blacklist(struct intel_dp *intel_dp, + struct intel_crtc_state *crtc_state) +{ + struct intel_connector *intel_connector = intel_dp->attached_connector; + struct edid *edid = intel_connector->detect_edid; + int i; + static const char * const monitor_str_blacklist[] = { + "TK6R7" + }; + + if (!edid) + return false; + + for (i = 0; i < ARRAY_SIZE(edid->detailed_timings); i++) { + const char *edid_str; + u8 type; + int j; + + if (edid->detailed_timings[i].pixel_clock) + continue; + + type = edid->detailed_timings[i].data.other_data.type; + if (type != EDID_DETAIL_MONITOR_STRING) + continue; + + edid_str = edid->detailed_timings[i].data.other_data.data.str.str; + + for (j = 0; j < ARRAY_SIZE(monitor_str_blacklist); j++) { + if (!strncmp(edid_str, monitor_str_blacklist[j], + sizeof(struct detailed_data_string))) + return true; + } + } + + return false; +} + static bool intel_psr2_config_valid(struct intel_dp *intel_dp, struct intel_crtc_state *crtc_state) { @@ -596,6 +634,11 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp, return false; } + if (panel_in_psr2_blacklist(intel_dp, crtc_state)) { + DRM_DEBUG_KMS("PSR2 not enabled, panel in PSR2 blacklist\n"); + return false; + } + return true; } -- 2.23.0