From: Dave Airlie Date: Tue, 24 Nov 2009 01:56:45 +0000 (+1000) Subject: r300: fix swtcl bo leak problem. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2176b3ed9ab832122e56aed3242dfda102a5fec6;p=mesa.git 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 --- 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;