From 2176b3ed9ab832122e56aed3242dfda102a5fec6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 24 Nov 2009 11:56:45 +1000 Subject: [PATCH] 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 --- src/mesa/drivers/dri/radeon/radeon_dma.c | 8 +++++--- 1 file 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 2a1bd7357a3..89a99974e29 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; -- 2.30.2