Commit f4fdf376 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211015133921.4609-5-ville.syrjala@linux.intel.com


Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 59908256
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -2179,13 +2179,14 @@ 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)) {
		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;
}