summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_common.c
diff options
context:
space:
mode:
authorPauli Nieminen <suokkos@gmail.com>2009-08-21 18:55:34 +0300
committerPauli Nieminen <suokkos@gmail.com>2009-08-21 19:12:31 +0300
commitd6b5464aaa93585376610ce8cace66ea3798723d (patch)
tree5b1352d7f6c2ed74e62a63376914b808fed5b574 /src/mesa/drivers/dri/radeon/radeon_common.c
parent12fe319c53187e9a316f8c26441040a84ae4efca (diff)
r300: Predict emit size for next rendering operation.
We do flush for cmd buffer in case there isn't enough space left for whole rendering operation. This protects dma regions from getting released in middle of state emit. Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_common.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c
index f0cf31c55f..6c3f7a57e5 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common.c
@@ -1189,14 +1189,16 @@ int rcommonFlushCmdBuf(radeonContextPtr rmesa, const char *caller)
*
* \param dwords The number of dwords we need to be free on the command buffer
*/
-void rcommonEnsureCmdBufSpace(radeonContextPtr rmesa, int dwords, const char *caller)
+int rcommonEnsureCmdBufSpace(radeonContextPtr rmesa, int dwords, const char *caller)
{
if ((rmesa->cmdbuf.cs->cdw + dwords + 128) > rmesa->cmdbuf.size
|| radeon_cs_need_flush(rmesa->cmdbuf.cs)) {
/* If we try to flush empty buffer there is too big rendering operation. */
assert(rmesa->cmdbuf.cs->cdw);
rcommonFlushCmdBuf(rmesa, caller);
+ return GL_TRUE;
}
+ return GL_FALSE;
}
void rcommonInitCmdBuf(radeonContextPtr rmesa)