summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-01-30 22:14:02 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-01-30 22:14:02 +0100
commit47ee6237fe86a8621744bbd6cecb8b5e58848b05 (patch)
tree4d10ea430e42ff69f1e1780623536f3c9b2ee4da /shared-core
parentf1edb7ad91d8b92057ffa02eb162e3740d05a147 (diff)
i915: Avoid calling drm_fence_flush_old excessively.
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/i915_dma.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index 15fb8117..a012f68e 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -494,7 +494,8 @@ static int i915_dispatch_cmdbuffer(struct drm_device * dev,
i915_emit_breadcrumb(dev);
#ifdef I915_HAVE_FENCE
- drm_fence_flush_old(dev, 0, dev_priv->counter);
+ if (unlikely((dev_priv->counter & 0xFF) == 0))
+ drm_fence_flush_old(dev, 0, dev_priv->counter);
#endif
return 0;
}
@@ -548,7 +549,8 @@ static int i915_dispatch_batchbuffer(struct drm_device * dev,
i915_emit_breadcrumb(dev);
#ifdef I915_HAVE_FENCE
- drm_fence_flush_old(dev, 0, dev_priv->counter);
+ if (unlikely((dev_priv->counter & 0xFF) == 0))
+ drm_fence_flush_old(dev, 0, dev_priv->counter);
#endif
return 0;
}
@@ -621,7 +623,7 @@ void i915_dispatch_flip(struct drm_device * dev, int planes, int sync)
i915_emit_breadcrumb(dev);
#ifdef I915_HAVE_FENCE
- if (!sync)
+ if (unlikely(!sync && ((dev_priv->counter & 0xFF) == 0)))
drm_fence_flush_old(dev, 0, dev_priv->counter);
#endif
}