drm/i915: Clean up the mess around hdmi_12bpc_possible()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 26 Oct 2017 15:14:04 +0000 (18:14 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 27 Oct 2017 19:14:46 +0000 (22:14 +0300)
Move the crtc state related 12bpc checks into hdmi_12bpc_possible()
since that one already examines other parts of the crtc state.

Note that we can drop the !force_dvi check since
crtc_state->has_hdmi_sink already accounts for that.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171026151405.30710-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_hdmi.c

index 5132dc8147884f9ace0af2615f7047f63b15a9a2..aa486b8925cf57e7052de3c7f6a4f8da68c8b30e 100644 (file)
@@ -1336,6 +1336,12 @@ static bool hdmi_12bpc_possible(const struct intel_crtc_state *crtc_state)
        if (HAS_GMCH_DISPLAY(dev_priv))
                return false;
 
+       if (crtc_state->pipe_bpp <= 8*3)
+               return false;
+
+       if (!crtc_state->has_hdmi_sink)
+               return false;
+
        /*
         * HDMI 12bpc affects the clocks, so it's only possible
         * when not cloning with other encoder types.
@@ -1461,9 +1467,8 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
         * outputs. We also need to check that the higher clock still fits
         * within limits.
         */
-       if (pipe_config->pipe_bpp > 8*3 && pipe_config->has_hdmi_sink && !force_dvi &&
-           hdmi_port_clock_valid(intel_hdmi, clock_12bpc, true, force_dvi) == MODE_OK &&
-           hdmi_12bpc_possible(pipe_config)) {
+       if (hdmi_12bpc_possible(pipe_config) &&
+           hdmi_port_clock_valid(intel_hdmi, clock_12bpc, true, force_dvi) == MODE_OK) {
                DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
                desired_bpp = 12*3;