aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2015-11-11 11:46:22 -0500
committerPaulo Zanoni <paulo.r.zanoni@intel.com>2015-12-03 08:38:11 -0500
commitee7d6cfa4b15aafa1d87f913572f30dd64cdd85a (patch)
tree8198a7ef33520aa1667dbac4ad61c0efe619603a
parent820bcabbf0acce7f3e7b72ed5e51b0a1d9c2046d (diff)
drm/i915: only recompress FBC after flushing a drawing operation
There's no need to stop and restart FBC, which is quite expensive as we have to revalidate the CRTC state. After flushing a drawing operation we know the CRTC state hasn't changed, so a nuke (recompress) should be fine. v2: Make it simpler (Chris). v3: Rewrite the patch again due to patch order changes. v4: Rewrite commit message (Chris). Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/
-rw-r--r--drivers/gpu/drm/i915/intel_fbc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index af621de700fb..a1988a486b92 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -935,8 +935,12 @@ void intel_fbc_flush(struct drm_i915_private *dev_priv,
935 dev_priv->fbc.busy_bits &= ~frontbuffer_bits; 935 dev_priv->fbc.busy_bits &= ~frontbuffer_bits;
936 936
937 if (!dev_priv->fbc.busy_bits && dev_priv->fbc.enabled) { 937 if (!dev_priv->fbc.busy_bits && dev_priv->fbc.enabled) {
938 __intel_fbc_deactivate(dev_priv); 938 if (origin != ORIGIN_FLIP && dev_priv->fbc.active) {
939 __intel_fbc_update(dev_priv->fbc.crtc); 939 intel_fbc_recompress(dev_priv);
940 } else {
941 __intel_fbc_deactivate(dev_priv);
942 __intel_fbc_update(dev_priv->fbc.crtc);
943 }
940 } 944 }
941 945
942 mutex_unlock(&dev_priv->fbc.lock); 946 mutex_unlock(&dev_priv->fbc.lock);