[PATCH 04/26] drm/i915: only nuke FBC when a drawing operation triggers a flush

Paulo Zanoni
2015-10-27T16:50:47Z

There's no need to stop and restart FBC: a nuke should be fine. The
specific check for ORIGIN_FLIP is not needed anymore since we have an
early return for the ORIGIN_FLIP && dev_priv->fbc.enabled case.

v2: Make it simpler (Chris).

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

diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index ac87136..7d8e996 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -1091,12 +1091,10 @@ void intel_fbc_flush(struct drm_i915_private *dev_priv,
dev_priv->fbc.busy_bits &= ~frontbuffer_bits;

if (!dev_priv->fbc.busy_bits) {
- if (origin == ORIGIN_FLIP) {
- __intel_fbc_update(dev_priv);
- } else {
- __intel_fbc_disable(dev_priv);
+ if (dev_priv->fbc.enabled)
+ intel_fbc_recompress(dev_priv);
+ else
__intel_fbc_update(dev_priv);
- }
}

mutex_unlock(&dev_priv->fbc.lock);