summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2009-02-04 13:16:03 +1000
committerDave Airlie <[email protected]>2009-02-04 13:16:03 +1000
commit711cbf30a1ce72338ca9f1c0f71bd530754a4bd9 (patch)
treec3eb71202cfdcf76206c027f9d9377c992d62bba /src/mesa/drivers
parent55c8a79a339668dd661bb8adb615fbcb8075f51a (diff)
r300: make dma buffer reuse much more sensible
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/r300/r300_emit.c3
-rw-r--r--src/mesa/drivers/dri/radeon/common_misc.c8
2 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c
index c47f19ea11e..a8592440da5 100644
--- a/src/mesa/drivers/dri/r300/r300_emit.c
+++ b/src/mesa/drivers/dri/r300/r300_emit.c
@@ -337,8 +337,6 @@ int r300EmitArrays(GLcontext * ctx)
rmesa->state.aos_count = nr;
- radeon_bo_unmap(rmesa->radeon.dma.current);
-
return R300_FALLBACK_NONE;
}
@@ -357,7 +355,6 @@ void r300ReleaseArrays(GLcontext * ctx)
rmesa->state.aos[i].bo = NULL;
}
}
- radeonReleaseDmaRegion(&rmesa->radeon);
}
void r300EmitCacheFlush(r300ContextPtr rmesa)
diff --git a/src/mesa/drivers/dri/radeon/common_misc.c b/src/mesa/drivers/dri/radeon/common_misc.c
index 0779feea97f..62650e28929 100644
--- a/src/mesa/drivers/dri/radeon/common_misc.c
+++ b/src/mesa/drivers/dri/radeon/common_misc.c
@@ -621,6 +621,8 @@ int rcommonFlushCmdBuf(radeonContextPtr rmesa, const char *caller)
{
int ret;
+ radeonReleaseDmaRegion(rmesa);
+
LOCK_HARDWARE(rmesa);
ret = rcommonFlushCmdBufLocked(rmesa, caller);
UNLOCK_HARDWARE(rmesa);
@@ -2418,7 +2420,6 @@ void radeonRefillCurrentDmaRegion(radeonContextPtr rmesa, int size)
fprintf(stderr, "%s\n", __FUNCTION__);
if (rmesa->dma.flush) {
- radeon_bo_unmap(rmesa->dma.current);
rmesa->dma.flush(rmesa->glCtx);
}
@@ -2504,9 +2505,12 @@ void radeonAllocDmaRegion(radeonContextPtr rmesa,
void radeonReleaseDmaRegion(radeonContextPtr rmesa)
{
+ if (RADEON_DEBUG & DEBUG_IOCTL)
+ fprintf(stderr, "%s %p\n", __FUNCTION__, rmesa->dma.current);
if (rmesa->dma.current) {
rmesa->dma.nr_released_bufs++;
- radeon_bo_unref(rmesa->dma.current);
+ radeon_bo_unmap(rmesa->dma.current);
+ radeon_bo_unref(rmesa->dma.current);
}
rmesa->dma.current = NULL;
}