From: Dave Airlie Date: Wed, 4 Feb 2009 03:16:03 +0000 (+1000) Subject: r300: make dma buffer reuse much more sensible X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=711cbf30a1ce72338ca9f1c0f71bd530754a4bd9;p=mesa.git r300: make dma buffer reuse much more sensible --- 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; }