From: Imre Deak Date: Sat, 3 Oct 2020 00:18:44 +0000 (+0300) Subject: drm/i915: Check for unsupported DP link rates during initial commit X-Git-Tag: accepted/tizen/unified/20230118.172025~6402^2~29^2~829 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d6287a8481242cb0f324a2937258f240036dd17;p=platform%2Fkernel%2Flinux-rpi.git drm/i915: Check for unsupported DP link rates during initial commit Some BIOSes set an unsupported/imprecise DP link rate (for instance on TGL A stepping). Make sure that we do an encoder recompute and a modeset in this case. Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20201003001846.1271151-4-imre.deak@intel.com --- diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index d33a3d9..df5277c 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -3707,6 +3707,18 @@ bool intel_dp_initial_fastset_check(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state) { struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); + + /* + * If BIOS has set an unsupported or non-standard link rate for some + * reason force an encoder recompute and full modeset. + */ + if (intel_dp_rate_index(intel_dp->source_rates, intel_dp->num_source_rates, + crtc_state->port_clock) < 0) { + drm_dbg_kms(&i915->drm, "Forcing full modeset due to unsupported link rate\n"); + crtc_state->uapi.connectors_changed = true; + return false; + } /* * FIXME hack to force full modeset when DSC is being used.