Mesa (master): r300: fix swtcl bo leak problem.

Dave Airlie airlied at kemper.freedesktop.org
Tue Nov 24 01:57:35 UTC 2009


Module: Mesa
Branch: master
Commit: 2176b3ed9ab832122e56aed3242dfda102a5fec6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2176b3ed9ab832122e56aed3242dfda102a5fec6

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Nov 24 11:56:45 2009 +1000

r300: fix swtcl bo leak problem.

We can get a lot of swtcl bo allocations - need to probably abstract
this a bit further.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/mesa/drivers/dri/radeon/radeon_dma.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c
index 2a1bd73..89a9997 100644
--- a/src/mesa/drivers/dri/radeon/radeon_dma.c
+++ b/src/mesa/drivers/dri/radeon/radeon_dma.c
@@ -451,9 +451,11 @@ rcommonAllocDmaLowVerts( radeonContextPtr rmesa, int nverts, int vsize )
                 rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
                 rmesa->dma.current_vertexptr );
 
-	rmesa->swtcl.bo = first_elem(&rmesa->dma.reserved)->bo;
-	radeon_bo_ref(rmesa->swtcl.bo);
-	radeon_bo_map(rmesa->swtcl.bo, 1);
+	if (!rmesa->swtcl.bo) {
+		rmesa->swtcl.bo = first_elem(&rmesa->dma.reserved)->bo;
+		radeon_bo_ref(rmesa->swtcl.bo);
+		radeon_bo_map(rmesa->swtcl.bo, 1);
+	}
 
 	head = (rmesa->swtcl.bo->ptr + rmesa->dma.current_vertexptr);
 	rmesa->dma.current_vertexptr += bytes;




More information about the mesa-commit mailing list