From 44e3ec3c05f0806f0940887ed9e30d94bf0748e0 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Sun, 21 Mar 2010 20:02:10 +0200 Subject: r200: Fix mixed indetion in r200TclFallback. --- src/mesa/drivers/dri/r200/r200_tcl.c | 41 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'src/mesa/drivers/dri/r200/r200_tcl.c') diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index f3f558b7de..41b68cc0ca 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -687,25 +687,24 @@ static char *getFallbackString(GLuint bit) void r200TclFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) { - r200ContextPtr rmesa = R200_CONTEXT(ctx); - GLuint oldfallback = rmesa->radeon.TclFallback; - - if (mode) { - rmesa->radeon.TclFallback |= bit; - if (oldfallback == 0) { - if (R200_DEBUG & RADEON_FALLBACKS) - fprintf(stderr, "R200 begin tcl fallback %s\n", - getFallbackString( bit )); - transition_to_swtnl( ctx ); - } - } - else { - rmesa->radeon.TclFallback &= ~bit; - if (oldfallback == bit) { - if (R200_DEBUG & RADEON_FALLBACKS) - fprintf(stderr, "R200 end tcl fallback %s\n", - getFallbackString( bit )); - transition_to_hwtnl( ctx ); - } - } + r200ContextPtr rmesa = R200_CONTEXT(ctx); + GLuint oldfallback = rmesa->radeon.TclFallback; + + if (mode) { + rmesa->radeon.TclFallback |= bit; + if (oldfallback == 0) { + if (R200_DEBUG & RADEON_FALLBACKS) + fprintf(stderr, "R200 begin tcl fallback %s\n", + getFallbackString( bit )); + transition_to_swtnl( ctx ); + } + } else { + rmesa->radeon.TclFallback &= ~bit; + if (oldfallback == bit) { + if (R200_DEBUG & RADEON_FALLBACKS) + fprintf(stderr, "R200 end tcl fallback %s\n", + getFallbackString( bit )); + transition_to_hwtnl( ctx ); + } + } } -- cgit v1.2.3 From 1968d8f31d0ac83557c9366dea39b15e92bb1516 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Sun, 21 Mar 2010 20:16:17 +0200 Subject: r200: Fix swtnl fallback to flush pending rendering before transition. Flush after transition would emit wrong state that could cause wrong state emited for pending rendering operation. Fixes wan once from extrement tuxracer that is using per vertex materials. --- src/mesa/drivers/dri/r200/r200_tcl.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/r200/r200_tcl.c') diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index 41b68cc0ca..f52e4fe917 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -691,20 +691,30 @@ void r200TclFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) GLuint oldfallback = rmesa->radeon.TclFallback; if (mode) { - rmesa->radeon.TclFallback |= bit; if (oldfallback == 0) { + /* We have to flush before transition */ + if ( rmesa->radeon.dma.flush ) + rmesa->radeon.dma.flush( rmesa->radeon.glCtx ); + if (R200_DEBUG & RADEON_FALLBACKS) fprintf(stderr, "R200 begin tcl fallback %s\n", getFallbackString( bit )); + rmesa->radeon.TclFallback |= bit; transition_to_swtnl( ctx ); - } + } else + rmesa->radeon.TclFallback |= bit; } else { - rmesa->radeon.TclFallback &= ~bit; if (oldfallback == bit) { + /* We have to flush before transition */ + if ( rmesa->radeon.dma.flush ) + rmesa->radeon.dma.flush( rmesa->radeon.glCtx ); + if (R200_DEBUG & RADEON_FALLBACKS) fprintf(stderr, "R200 end tcl fallback %s\n", getFallbackString( bit )); + rmesa->radeon.TclFallback &= ~bit; transition_to_hwtnl( ctx ); - } + } else + rmesa->radeon.TclFallback &= ~bit; } } -- 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_tcl.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