[Mesa-dev] [PATCH] r200: revalidate after radeon_update_renderbuffers

Daniel Vetter daniel.vetter at ffwll.ch
Fri Oct 8 13:35:57 PDT 2010


This seems to mitigate a crash in glxgears when I resize the window
like crazy. libdrm complains that the depthbuffer is not validated
(frontbuffer rendering, so the frontbuffer doesn't change). Problem
not fully solved, though: After a while of constantly resizing the
window the kernel cs checker complains:

[drm:r100_cs_track_check] *ERROR* [drm] Buffer too small for z buffer (need 1302400 have 1257472) !
[drm:r100_cs_track_check] *ERROR* [drm] zbuffer (592 4 0 550)
[drm:radeon_cs_ioctl] *ERROR* Invalid command stream !

So this is probably just a gross hack. Comments from people with
more clue than me higly welcome ;)

Patch not tested on anything else than my rv270. Oh, and this is
on a Mac Mini G4 ppc machine.

Yours, Daniel

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 src/mesa/drivers/dri/r200/r200_tcl.c               |    2 ++
 .../drivers/dri/radeon/radeon_common_context.c     |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c
index 4ae0f30..b1fd9d1 100644
--- a/src/mesa/drivers/dri/r200/r200_tcl.c
+++ b/src/mesa/drivers/dri/r200/r200_tcl.c
@@ -265,6 +265,8 @@ void r200TclPrimitive( GLcontext *ctx,
    GLuint newprim = hw_prim | R200_VF_TCL_OUTPUT_VTX_ENABLE;
 
    radeon_prepare_render(&rmesa->radeon);
+   if (rmesa->radeon.NewGLState)
+      if (!r200ValidateState( ctx ))
 
    if (newprim != rmesa->tcl.hw_primitive ||
        !discrete_prim[hw_prim&0xf]) {
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c
index 85e4988..e6cbfc2 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c
@@ -780,6 +780,8 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable,
 		}
 	}
 
+	radeon->NewGLState |= _NEW_BUFFERS;
+
 	driUpdateFramebufferSize(radeon->glCtx, drawable);
 }
 
-- 
1.7.1



More information about the mesa-dev mailing list