radeon: balance dma buffer mapping
authorPauli Nieminen <suokkos@gmail.com>
Tue, 18 Aug 2009 18:30:51 +0000 (14:30 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Tue, 18 Aug 2009 18:32:45 +0000 (14:32 -0400)
In radeonRefillCurrentDmaRegion() make sure we
unmap the previous buffer.

src/mesa/drivers/dri/radeon/radeon_dma.c

index b2376ea28b5a6e3ace8785985148a78659ebd4a3..30191845b98b54accbaad07369fc38844fe0d151 100644 (file)
@@ -180,6 +180,10 @@ void radeonRefillCurrentDmaRegion(radeonContextPtr rmesa, int size)
                rmesa->dma.flush(rmesa->glCtx);
        }
 
+       /* unmap old reserved bo */
+       if (!is_empty_list(&rmesa->dma.reserved))
+               radeon_bo_unmap(first_elem(&rmesa->dma.reserved)->bo);
+
        if (is_empty_list(&rmesa->dma.free)) {
                struct radeon_dma_bo *dma_bo = CALLOC(sizeof(struct radeon_dma_bo));
                assert(dma_bo);