summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2009-11-24 11:56:45 +1000
committerDave Airlie <[email protected]>2009-11-24 11:56:45 +1000
commit2176b3ed9ab832122e56aed3242dfda102a5fec6 (patch)
tree3c503a584d8d952654486b29e644a0884ece1283 /src
parentbd13e6e5e2403ada2098e3a07c0af4b4ba989ab7 (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_dma.c8
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 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;