From 0900544fb54cbc2127b8729393c9c1308cd218f9 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Sun, 21 Mar 2010 22:55:13 +0200 Subject: r200: Don't flush when closing elts in KMS. Flush in middle of rendering in KMS is not allowed because buffers are discarded in flush. Fixes crash when emiting split indices with RADEON_DEBUG=all. --- src/mesa/drivers/dri/r200/r200_cmdbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/r200/r200_cmdbuf.c') diff --git a/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/src/mesa/drivers/dri/r200/r200_cmdbuf.c index 2f2b8d94dc..382ae0daa4 100644 --- a/src/mesa/drivers/dri/r200/r200_cmdbuf.c +++ b/src/mesa/drivers/dri/r200/r200_cmdbuf.c @@ -189,7 +189,8 @@ void r200FlushElts(GLcontext *ctx) if (R200_ELT_BUF_SZ > elt_used) radeonReturnDmaRegion(&rmesa->radeon, R200_ELT_BUF_SZ - elt_used); - if (radeon_is_debug_enabled(RADEON_SYNC, RADEON_CRITICAL)) { + if (radeon_is_debug_enabled(RADEON_SYNC, RADEON_CRITICAL) + && !rmesa->radeon.radeonScreen->kernel_mm) { radeon_print(RADEON_SYNC, RADEON_NORMAL, "%s: Syncing\n", __FUNCTION__); radeonFinish( rmesa->radeon.glCtx ); } -- cgit v1.2.3 From 4ea694a26b99835d0b5bc814cf024850874a9a83 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Sun, 21 Mar 2010 23:23:21 +0200 Subject: r200: Fix emit size prediction to account elt splitting. Emit sizes prediction didn't account for render splitting in hwtnl path. --- src/mesa/drivers/dri/r200/r200_cmdbuf.c | 2 +- src/mesa/drivers/dri/r200/r200_tcl.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/r200/r200_cmdbuf.c') diff --git a/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/src/mesa/drivers/dri/r200/r200_cmdbuf.c index 382ae0daa4..ad43a8ca92 100644 --- a/src/mesa/drivers/dri/r200/r200_cmdbuf.c +++ b/src/mesa/drivers/dri/r200/r200_cmdbuf.c @@ -190,7 +190,7 @@ void r200FlushElts(GLcontext *ctx) radeonReturnDmaRegion(&rmesa->radeon, R200_ELT_BUF_SZ - elt_used); if (radeon_is_debug_enabled(RADEON_SYNC, RADEON_CRITICAL) - && !rmesa->radeon.radeonScreen->kernel_mm) { + && !rmesa->radeon.radeonScreen->kernel_mm) { radeon_print(RADEON_SYNC, RADEON_NORMAL, "%s: Syncing\n", __FUNCTION__); radeonFinish( rmesa->radeon.glCtx ); } diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index f52e4fe917..d43e14581e 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -404,8 +404,9 @@ static GLuint r200EnsureEmitSize( GLcontext * ctx , GLubyte* vimap_rev ) rendering code may decide convert to elts. In that case we have to make pessimistic prediction. and use larger of 2 paths. */ - const GLuint elts = ELTS_BUFSZ(nr_aos); - const GLuint index = INDEX_BUFSZ; + const GLuint elt_count =(VB->Primitive[i].count/GET_MAX_HW_ELTS() + 1); + const GLuint elts = ELTS_BUFSZ(nr_aos) * elt_count; + const GLuint index = INDEX_BUFSZ * elt_count; const GLuint vbuf = VBUF_BUFSZ; if ( (!VB->Elts && VB->Primitive[i].count >= MAX_CONVERSION_SIZE) || vbuf > index + elts) -- cgit v1.2.3