drm/i915: Rely on TEST_SINK_START instead of tracking Sink CRC state on dev_priv.
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 5 Nov 2015 18:50:22 +0000 (10:50 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 18 Nov 2015 10:24:27 +0000 (11:24 +0100)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h

index 948a7b007a8750085e55d6c103299e8424c576ff..6c17b0b455da46efa213b857764004b477500ce1 100644 (file)
@@ -3985,7 +3985,6 @@ static int intel_dp_sink_crc_stop(struct intel_dp *intel_dp)
                ret = -ETIMEDOUT;
        }
 
-       intel_dp->sink_crc.started = false;
  out:
        hsw_enable_ips(intel_crtc);
        return ret;
@@ -3999,12 +3998,6 @@ static int intel_dp_sink_crc_start(struct intel_dp *intel_dp)
        u8 buf;
        int ret;
 
-       if (intel_dp->sink_crc.started) {
-               ret = intel_dp_sink_crc_stop(intel_dp);
-               if (ret)
-                       return ret;
-       }
-
        if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf) < 0)
                return -EIO;
 
@@ -4014,6 +4007,12 @@ static int intel_dp_sink_crc_start(struct intel_dp *intel_dp)
        if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0)
                return -EIO;
 
+       if (buf & DP_TEST_SINK_START) {
+               ret = intel_dp_sink_crc_stop(intel_dp);
+               if (ret)
+                       return ret;
+       }
+
        hsw_disable_ips(intel_crtc);
 
        if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK,
@@ -4023,7 +4022,6 @@ static int intel_dp_sink_crc_start(struct intel_dp *intel_dp)
        }
 
        intel_wait_for_vblank(dev, intel_crtc->pipe);
-       intel_dp->sink_crc.started = true;
        return 0;
 }
 
index 0d5f7cca279eda9b0b2da66f2ec8c40af168e5f3..f73e7a2c25cb92f22057e668a4bdd1452b72cb8f 100644 (file)
@@ -738,10 +738,6 @@ enum link_m_n_set {
        M2_N2
 };
 
-struct sink_crc {
-       bool started;
-};
-
 struct intel_dp {
        uint32_t output_reg;
        uint32_t aux_ch_ctl_reg;
@@ -759,7 +755,6 @@ struct intel_dp {
        /* sink rates as reported by DP_SUPPORTED_LINK_RATES */
        uint8_t num_sink_rates;
        int sink_rates[DP_MAX_SUPPORTED_RATES];
-       struct sink_crc sink_crc;
        struct drm_dp_aux aux;
        uint8_t train_set[4];
        int panel_power_up_delay;