Mesa (master): radeon: ensure cmdbuf space for state + AOS is available

Dave Airlie airlied at kemper.freedesktop.org
Mon Jul 6 10:44:12 UTC 2009


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Jul  6 20:35:15 2009 +1000

radeon: ensure cmdbuf space for state + AOS is available

The problem is if we find out later we don't have any cmdbuf space but
we've already written the arrays to the DMA buffer object, we end up
emitting the current cmdbuf which has references to the current DMA object
we then send that to the hw and we can't reference the arrays we just emitted
to the old DMA buffer. things go bad, crash boom.

This can probably be tuned further + swtcl probably needs some fixes

---

 src/mesa/drivers/dri/r300/r300_draw.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c
index 20fe8db..fe8014b 100644
--- a/src/mesa/drivers/dri/r300/r300_draw.c
+++ b/src/mesa/drivers/dri/r300/r300_draw.c
@@ -417,6 +417,12 @@ static GLboolean r300TryDrawPrims(GLcontext *ctx,
 
 	r300FixupIndexBuffer(ctx, ib, bo, &nr_bo);
 
+	/* ensure we have the cmd buf space in advance to cover
+ 	 * the state + DMA AOS pointers */
+	rcommonEnsureCmdBufSpace(&r300->radeon,
+                           r300->radeon.hw.max_state_size + (50*sizeof(int)),
+                           __FUNCTION__);
+
 	r300SetVertexFormat(ctx, arrays, max_index + 1, bo, &nr_bo);
 
 	if (r300->fallback)




More information about the mesa-commit mailing list