diff mbox

[12/12] drm/i915: only nuke FBC when a drawing operation triggers a flush

Message ID 1447444424-17168-13-git-send-email-paulo.r.zanoni@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zanoni, Paulo R Nov. 13, 2015, 7:53 p.m. UTC
There's no need to stop and restart FBC: a nuke should be fine.

v2: Make it simpler (Chris).
v3: Rewrite the patch again due to patch order changes.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_fbc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Chris Wilson Nov. 13, 2015, 10:51 p.m. UTC | #1
On Fri, Nov 13, 2015 at 05:53:44PM -0200, Paulo Zanoni wrote:

drm/i915: Only trigger a FBC recompress after flushing a drawing operation

> There's no need to stop and restart FBC: a nuke should be fine.

There's no need to stop and restart FBC, which is quite expensive as we
have to revalidate the CRTC state and reallocate resources, after flushing
a drawing operation (as the CRTC state hasn't changed). A nuke (recompress)
should be fine.

> v2: Make it simpler (Chris).
> v3: Rewrite the patch again due to patch order changes.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

If you can make the changelog understandable,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index b80f232..207cf23 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -923,8 +923,12 @@  void intel_fbc_flush(struct drm_i915_private *dev_priv,
 	dev_priv->fbc.busy_bits &= ~frontbuffer_bits;
 
 	if (!dev_priv->fbc.busy_bits && dev_priv->fbc.enabled) {
-		__intel_fbc_deactivate(dev_priv);
-		__intel_fbc_update(dev_priv->fbc.crtc);
+		if (origin != ORIGIN_FLIP && dev_priv->fbc.active) {
+			intel_fbc_recompress(dev_priv);
+		} else {
+			__intel_fbc_deactivate(dev_priv);
+			__intel_fbc_update(dev_priv->fbc.crtc);
+		}
 	}
 
 	mutex_unlock(&dev_priv->fbc.lock);