xf86-video-intel: 2 commits - src/i830_batchbuffer.c

Keith Packard keithp at kemper.freedesktop.org
Thu Oct 9 18:23:31 PDT 2008


 src/i830_batchbuffer.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 140451abb41fbd68d5aac4736c1cf1ec2805dd9e
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Oct 9 18:18:34 2008 -0700

    For non-DRM, add NOOPs after BATCH_BUFFER_START to verify completion
    
    In non-DRM mode, the driver waits for the hardware by checking the ring
    pointers; when the ring is empty, it assumes the hardware is idle. However,
    the hardware updates the ring pointers before executing a command, so if the
    MI_BATCH_BUFFER_START is the last command in the ring, the driver will think
    the hardware is idle while it may still be processing the contents of the
    batch buffer. Placing NOOPs after the BATCH_BUFFER_START allows the driver
    to know that the hardware has completed the batch buffer.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c
index b7b8f18..cd8f687 100644
--- a/src/i830_batchbuffer.c
+++ b/src/i830_batchbuffer.c
@@ -45,9 +45,11 @@ intel_nondrm_exec(dri_bo *bo, unsigned int used, void *priv)
     ScrnInfoPtr pScrn = priv;
     I830Ptr pI830 = I830PTR(pScrn);
 
-    BEGIN_LP_RING(2);
+    BEGIN_LP_RING(4);
     OUT_RING(MI_BATCH_BUFFER_START | (2 << 6));
     OUT_RING(bo->offset);
+    OUT_RING(MI_NOOP);
+    OUT_RING(MI_NOOP);
     ADVANCE_LP_RING();
 
     return 0;
commit d09d938bf26ea0c44352ff6e7a57ba43f4047fdb
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Oct 9 18:17:13 2008 -0700

    i830 nondrm batch buffer insertion was missing ADVANCE_LP_RING() call
    
    The ring commands to insert a batch buffer to the ring in i830 form were not
    terminated by a call to ADVANCE_LP_RING(). This surely would have caused
    chaos.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c
index 3727f0e..b7b8f18 100644
--- a/src/i830_batchbuffer.c
+++ b/src/i830_batchbuffer.c
@@ -64,6 +64,7 @@ intel_nondrm_exec_i830(dri_bo *bo, unsigned int used, void *priv)
     OUT_RING(bo->offset);
     OUT_RING(bo->offset + pI830->batch_used - 4);
     OUT_RING(MI_NOOP);
+    ADVANCE_LP_RING();
 
     return 0;
 }


More information about the xorg-commit mailing list