drm/i915/hdmi: Unify "4:2:0 also" logic between .mode_valid() and .compute_config()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 15 Oct 2021 13:39:05 +0000 (16:39 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 21 Oct 2021 19:22:58 +0000 (22:22 +0300)
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ä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211015133921.4609-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_hdmi.c

index e97c835..18e7ef1 100644 (file)
@@ -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;