From: Ville Syrjälä Date: Fri, 15 Oct 2021 13:39:05 +0000 (+0300) Subject: drm/i915/hdmi: Unify "4:2:0 also" logic between .mode_valid() and .compute_config() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f4fdf37684ebf8ca122723ab6074d74299921064;p=linux.git drm/i915/hdmi: Unify "4:2:0 also" logic between .mode_valid() and .compute_config() Currently .mode_valid() and .compute_config() have their "4:2:0 also" logic inverted. Unify things so that we use the same logic on both sides. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015133921.4609-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula --- diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index e97c83535965f..18e7ef1258278 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2179,12 +2179,13 @@ static int intel_hdmi_compute_output_format(struct intel_encoder *encoder, ret = intel_hdmi_compute_clock(encoder, crtc_state); if (ret) { - if (!intel_hdmi_is_ycbcr420(crtc_state) && - connector->ycbcr_420_allowed && - drm_mode_is_420_also(&connector->display_info, adjusted_mode)) { - crtc_state->output_format = INTEL_OUTPUT_FORMAT_YCBCR420; - ret = intel_hdmi_compute_clock(encoder, crtc_state); - } + if (intel_hdmi_is_ycbcr420(crtc_state) || + !connector->ycbcr_420_allowed || + !drm_mode_is_420_also(&connector->display_info, adjusted_mode)) + return ret; + + crtc_state->output_format = INTEL_OUTPUT_FORMAT_YCBCR420; + ret = intel_hdmi_compute_clock(encoder, crtc_state); } return ret;