drm/i915: Run psr_setup unconditionally
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 11 Jul 2014 17:30:09 +0000 (10:30 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 23 Jul 2014 05:05:14 +0000 (07:05 +0200)
Due to runtime pm and system s/r we need to restore hw state every
time we enable a pipe again. Hence trying to avoid that is just
pointless book-keeping which Rodrigo then tried to work around by
manually adding psr_setup calls to our resume code.

Much simpler to just remove code instead.

v2: Properly bail out of psr exit if psr isn't enabled. Spotted by
Rodrigo.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_dp.c

index 1c6640118a7084b61733156d4ee8d3bc6e0017b3..c5d157becc4f1d3b26ffecf7a627f11da89efd54 100644 (file)
@@ -661,7 +661,6 @@ struct i915_drrs {
 struct i915_psr {
        bool sink_support;
        bool source_ok;
-       bool setup_done;
        bool enabled;
        bool active;
        struct delayed_work work;
index ec080e5f3e245f4d9f904ff5333f45fdb4b70fcd..6359005180f014582c240660c2b822280546dcf4 100644 (file)
@@ -1681,9 +1681,6 @@ static void intel_edp_psr_setup(struct intel_dp *intel_dp)
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct edp_vsc_psr psr_vsc;
 
-       if (dev_priv->psr.setup_done)
-               return;
-
        /* Prepare VSC packet as per EDP 1.3 spec, Table 3.10 */
        memset(&psr_vsc, 0, sizeof(psr_vsc));
        psr_vsc.sdp_header.HB0 = 0;
@@ -1695,8 +1692,6 @@ static void intel_edp_psr_setup(struct intel_dp *intel_dp)
        /* Avoid continuous PSR exit by masking memup and hpd */
        I915_WRITE(EDP_PSR_DEBUG_CTL(dev), EDP_PSR_DEBUG_MASK_MEMUP |
                   EDP_PSR_DEBUG_MASK_HPD | EDP_PSR_DEBUG_MASK_LPSP);
-
-       dev_priv->psr.setup_done = true;
 }
 
 static void intel_edp_psr_enable_sink(struct intel_dp *intel_dp)
@@ -1928,7 +1923,7 @@ void intel_edp_psr_exit(struct drm_device *dev)
        if (!HAS_PSR(dev))
                return;
 
-       if (!dev_priv->psr.setup_done)
+       if (!dev_priv->psr.enabled)
                return;
 
        cancel_delayed_work_sync(&dev_priv->psr.work);