summaryrefslogtreecommitdiff
path: root/src/i830_batchbuffer.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-11-12 16:40:37 -0500
committerKristian Høgsberg <krh@redhat.com>2008-11-17 12:26:38 -0500
commitee87f7becc2138348ec0d948829db6e86cee86da (patch)
tree2fcf5e75603ecaecd222de2022907c6c3c9c401a /src/i830_batchbuffer.c
parent3dd7f0f9423bb891bc99cd3b77dc3d57e057a7ef (diff)
parenta5b1e62337d4e8840347bb186db48697f0690a19 (diff)
Merge commit 'origin/master' into dri2
Conflicts: src/i830_dri.c src/i830_driver.c src/i830_memory.c
Diffstat (limited to 'src/i830_batchbuffer.c')
-rw-r--r--src/i830_batchbuffer.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c
index 9ae2141b..9aa99ed9 100644
--- a/src/i830_batchbuffer.c
+++ b/src/i830_batchbuffer.c
@@ -156,7 +156,7 @@ intel_batch_teardown(ScrnInfoPtr pScrn)
}
void
-intel_batch_flush(ScrnInfoPtr pScrn)
+intel_batch_flush(ScrnInfoPtr pScrn, Bool flushed)
{
I830Ptr pI830 = I830PTR(pScrn);
int ret;
@@ -164,6 +164,17 @@ intel_batch_flush(ScrnInfoPtr pScrn)
if (pI830->batch_used == 0)
return;
+ /* If we're not using GEM, then emit a flush after each batch buffer */
+ if (pI830->memory_manager == NULL && !flushed) {
+ int flags = MI_WRITE_DIRTY_STATE | MI_INVALIDATE_MAP_CACHE;
+
+ if (IS_I965G(pI830))
+ flags = 0;
+
+ *(uint32_t *)(pI830->batch_ptr + pI830->batch_used) = MI_FLUSH | flags;
+ pI830->batch_used += 4;
+ }
+
/* Emit a padding dword if we aren't going to be quad-word aligned. */
if ((pI830->batch_used & 4) == 0) {
*(uint32_t *)(pI830->batch_ptr + pI830->batch_used) = MI_NOOP;
@@ -188,5 +199,6 @@ intel_batch_flush(ScrnInfoPtr pScrn)
* blockhandler. We could set this less often, but it's probably not worth
* the work.
*/
- pI830->need_mi_flush = TRUE;
+ if (pI830->memory_manager != NULL)
+ pI830->need_mi_flush = TRUE;
}