drm/i915/psr: Restrict buffer tracking to the PSR pipe
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 18 Jun 2015 08:30:26 +0000 (10:30 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 23 Jun 2015 22:22:37 +0000 (00:22 +0200)
The current code tracks business across all pipes, but we're only
really interested in the one pipe DRRS is enabled on. Fairly tiny
optimization, but something I noticed while reading the code. But it
might matter a bit when e.g. showing a video or something only on the
external screen, while the panel is kept static.

Also regroup the code slightly: First compute new bitmasks, then take
appropriate actions.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
drivers/gpu/drm/i915/intel_psr.c

index 5ee0fa57ed1999b4a8432c89265d82bc2f90513e..e354ceacb628d85547eed486db638f13ba72a2d6 100644 (file)
@@ -663,11 +663,12 @@ void intel_psr_invalidate(struct drm_device *dev,
        crtc = dp_to_dig_port(dev_priv->psr.enabled)->base.base.crtc;
        pipe = to_intel_crtc(crtc)->pipe;
 
-       intel_psr_exit(dev);
-
        frontbuffer_bits &= INTEL_FRONTBUFFER_ALL_MASK(pipe);
-
        dev_priv->psr.busy_frontbuffer_bits |= frontbuffer_bits;
+
+       if (frontbuffer_bits)
+               intel_psr_exit(dev);
+
        mutex_unlock(&dev_priv->psr.lock);
 }
 
@@ -698,6 +699,8 @@ void intel_psr_flush(struct drm_device *dev,
 
        crtc = dp_to_dig_port(dev_priv->psr.enabled)->base.base.crtc;
        pipe = to_intel_crtc(crtc)->pipe;
+
+       frontbuffer_bits &= INTEL_FRONTBUFFER_ALL_MASK(pipe);
        dev_priv->psr.busy_frontbuffer_bits &= ~frontbuffer_bits;
 
        /*
@@ -716,7 +719,7 @@ void intel_psr_flush(struct drm_device *dev,
         * invalidating. Which means we need to manually fake this in
         * software for all flushes, not just when we've seen a preceding
         * invalidation through frontbuffer rendering. */
-       if (!HAS_DDI(dev))
+       if (frontbuffer_bits && !HAS_DDI(dev))
                intel_psr_exit(dev);
 
        if (!dev_priv->psr.active && !dev_priv->psr.busy_frontbuffer_bits)