From: Dave Airlie Date: Mon, 6 Jul 2009 10:35:15 +0000 (+1000) Subject: radeon: ensure cmdbuf space for state + AOS is available X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d66de6c341a859a30ef010c527f9a0c5865b5d65;p=mesa.git 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 --- diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c index 20fe8dbf17f..fe8014b3588 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)