summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-02-02 17:28:43 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2007-02-19 15:08:40 +0100
commit34aa3393d04da1201815143c92a5bef83bf0d585 (patch)
tree5635073f15752784422fe9c4bd2c10bfb266ad38
parent078e4307266bcfdc7d4be1a70df65d35dda4d0d3 (diff)
i915: Page flipping enhancements.
Leave it to the client to wait for the flip to complete when necessary, but wait for a previous flip to complete before emitting another one. This should help avoid unnecessary stalling of the ring due to pending flips. Call i915_do_cleanup_pageflip() unconditionally in preclose.
-rw-r--r--shared-core/i915_dma.c14
-rw-r--r--shared-core/i915_drv.h1
2 files changed, 7 insertions, 8 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index 82fde7e7..18fe0881 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -570,6 +570,12 @@ static int i915_dispatch_flip(drm_device_t * dev)
OUT_RING(0);
ADVANCE_LP_RING();
+ /* Wait for a pending flip to take effect */
+ BEGIN_LP_RING(2);
+ OUT_RING(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_PLANE_A_FLIP);
+ OUT_RING(0);
+ ADVANCE_LP_RING();
+
BEGIN_LP_RING(6);
OUT_RING(CMD_OP_DISPLAYBUFFER_INFO | ASYNC_FLIP);
OUT_RING(0);
@@ -583,10 +589,6 @@ static int i915_dispatch_flip(drm_device_t * dev)
OUT_RING(0);
ADVANCE_LP_RING();
- BEGIN_LP_RING(2);
- OUT_RING(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_PLANE_A_FLIP);
- OUT_RING(0);
- ADVANCE_LP_RING();
i915_emit_breadcrumb(dev);
#ifdef I915_HAVE_FENCE
drm_fence_flush_old(dev, 0, dev_priv->counter);
@@ -856,9 +858,7 @@ void i915_driver_preclose(drm_device_t * dev, DRMFILE filp)
{
if (dev->dev_private) {
drm_i915_private_t *dev_priv = dev->dev_private;
- if (dev_priv->page_flipping) {
- i915_do_cleanup_pageflip(dev);
- }
+ i915_do_cleanup_pageflip(dev);
i915_mem_release(dev, filp, dev_priv->agp_heap);
}
}
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h
index f922d1f5..a81653a7 100644
--- a/shared-core/i915_drv.h
+++ b/shared-core/i915_drv.h
@@ -102,7 +102,6 @@ typedef struct drm_i915_private {
int back_offset;
int front_offset;
int current_page;
- int page_flipping;
int use_mi_batchbuffer_start;
wait_queue_head_t irq_queue;