summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-03-07 17:23:40 +1100
committerDave Airlie <airlied@redhat.com>2009-03-07 17:23:40 +1100
commitf881035fd84add859b3e3dc4721eddd027005f49 (patch)
tree674584b53dab68a8e2f519f335fe7044a0a34ec2 /src/mesa
parent760068cc8d5b443c4c6545870fa4f7eda7c6e775 (diff)
rs690: fix r300 swtcl bug in DMA code.
When we finish emitting swtcl objects, we request space in the cmdbuf, and flush if no space exists. However in this case we also flush the DMA buffer we just put the vertices we wanted to send in. This checks in advance if we have space in the buffer.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_dma.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c
index 393b12182d..92878a5c2e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_dma.c
+++ b/src/mesa/drivers/dri/radeon/radeon_dma.c
@@ -275,7 +275,7 @@ void rcommon_flush_last_swtcl_prim( GLcontext *ctx )
if (RADEON_DEBUG & DEBUG_IOCTL)
- fprintf(stderr, "%s\n", __FUNCTION__);
+ fprintf(stderr, "%s %p\n", __FUNCTION__, dma->current);
dma->flush = NULL;
if (dma->current) {
@@ -300,12 +300,19 @@ rcommonAllocDmaLowVerts( radeonContextPtr rmesa, int nverts, int vsize )
{
GLuint bytes = vsize * nverts;
void *head;
-
+restart:
if (!rmesa->dma.current || rmesa->dma.current_vertexptr + bytes > rmesa->dma.current->size) {
radeonRefillCurrentDmaRegion(rmesa, bytes);
}
if (!rmesa->dma.flush) {
+ /* make sure we have enough space to use this in cmdbuf */
+ rcommonEnsureCmdBufSpace(&rmesa->radeon,
+ rmesa->hw.max_state_size + (12*sizeof(int)),
+ __FUNCTION__);
+ /* if cmdbuf flushed DMA restart */
+ if (!rmesa->dma.current)
+ goto restart;
rmesa->glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
rmesa->dma.flush = rcommon_flush_last_swtcl_prim;
}