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@keithp.com>
This commit is contained in:
Keith Packard 2008-10-09 18:18:34 -07:00
parent d09d938bf2
commit 140451abb4
1 changed files with 3 additions and 1 deletions

View File

@ -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;