From: Ville Syrjälä Date: Fri, 17 May 2024 14:53:53 +0000 (+0300) Subject: drm/i915: Use intel_dp_has_dsc() during .compute_config() X-Git-Tag: v6.11-rc1~141^2~20^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8de66736bcd87b89fff489a6fa2ad2312fc0de0d;p=thirdparty%2Flinux.git drm/i915: Use intel_dp_has_dsc() during .compute_config() Reuse intel_dp_has_dsc() during .compute_config() instead of repeating some of the checks again by hand. We'll be adding more checks to intel_dp_has_dsc() and this will make sure we cover both .mode_valid() and .compute_config() with them. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20240517145356.26103-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula --- diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 4364af21d5d8b..b19ffd160bf81 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -1435,11 +1435,13 @@ bool intel_dp_supports_fec(struct intel_dp *intel_dp, static bool intel_dp_supports_dsc(const struct intel_connector *connector, const struct intel_crtc_state *crtc_state) { + if (!intel_dp_has_dsc(connector)) + return false; + if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP) && !crtc_state->fec_enable) return false; - return intel_dsc_source_support(crtc_state) && - drm_dp_sink_supports_dsc(connector->dp.dsc_dpcd); + return intel_dsc_source_support(crtc_state); } static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp,