summaryrefslogtreecommitdiff
path: root/shared-core/i915_dma.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-02-28 15:23:19 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2007-02-28 15:23:19 +0100
commit1cdc1b6fbabffc0dd4d3c1f8405d9372a45480a2 (patch)
tree46602e8dc0664e621ac4ece9fd78d64ad69efb5c /shared-core/i915_dma.c
parentfd0fed3f1e10d7ff1205a485621767b650c6f5ff (diff)
i915: Don't emit waits for pending flips before emitting synchronous flips.
The assumption is that synchronous flips are not isolated usually, and waiting for all of them could result in stalling the pipeline for long periods of time. Also use i915_emit_mi_flush() instead of an old-fashioned way to achieve the same effect.
Diffstat (limited to 'shared-core/i915_dma.c')
-rw-r--r--shared-core/i915_dma.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index 883f3b9d..7078ec94 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -604,7 +604,6 @@ static void i915_do_dispatch_flip(drm_device_t * dev, int pipe, int sync)
void i915_dispatch_flip(drm_device_t * dev, int pipes, int sync)
{
drm_i915_private_t *dev_priv = dev->dev_private;
- u32 mi_wait = MI_WAIT_FOR_EVENT;
int i;
RING_LOCALS;
@@ -613,24 +612,23 @@ void i915_dispatch_flip(drm_device_t * dev, int pipes, int sync)
pipes, dev_priv->current_page,
dev_priv->sarea_priv->pf_current_page);
- if (pipes & 0x1)
- mi_wait |= MI_WAIT_FOR_PLANE_A_FLIP;
+ i915_emit_mi_flush(dev, MI_READ_FLUSH | MI_EXE_FLUSH);
- if (pipes & 0x2)
- mi_wait |= MI_WAIT_FOR_PLANE_B_FLIP;
+ if (!sync) {
+ u32 mi_wait = MI_WAIT_FOR_EVENT;
- i915_kernel_lost_context(dev);
+ /* Wait for pending flips to take effect */
+ if (pipes & 0x1)
+ mi_wait |= MI_WAIT_FOR_PLANE_A_FLIP;
- BEGIN_LP_RING(2);
- OUT_RING(INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE);
- OUT_RING(0);
- ADVANCE_LP_RING();
+ if (pipes & 0x2)
+ mi_wait |= MI_WAIT_FOR_PLANE_B_FLIP;
- /* Wait for pending flips to take effect */
- BEGIN_LP_RING(2);
- OUT_RING(mi_wait);
- OUT_RING(0);
- ADVANCE_LP_RING();
+ BEGIN_LP_RING(2);
+ OUT_RING(mi_wait);
+ OUT_RING(0);
+ ADVANCE_LP_RING();
+ }
for (i = 0; i < 2; i++)
if (pipes & (1 << i))