r200: revalidate after radeon_update_renderbuffers
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 10 Oct 2010 15:04:42 +0000 (17:04 +0200)
committerAlex Deucher <alexdeucher@gmail.com>
Mon, 11 Oct 2010 19:16:44 +0000 (15:16 -0400)
By calling radeon_draw_buffers (which sets the necessary flags
in radeon->NewGLState) and revalidating if NewGLState is non-zero
in r200TclPrimitive. This fixes an assert in libdrm (the color-/
depthbuffer was changed but not yet validated) and and stops the
kernel cs checker from complaining about them (when they're too
small).

Thanks to Mario Kleiner for the hint to call radeon_draw_buffer
(instead of my half-broken hack).

v2: Also fix the swtcl r200 path.

Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
src/mesa/drivers/dri/r200/r200_swtcl.c
src/mesa/drivers/dri/r200/r200_tcl.c
src/mesa/drivers/dri/radeon/radeon_common_context.c

index dbf4ad477db30e7c883aa0befe76f1d3c37c5a23..effe6fb933a236c1a42bc488e761b4d53cf156c2 100644 (file)
@@ -613,6 +613,9 @@ static void r200RasterPrimitive( GLcontext *ctx, GLuint hwprim )
    r200ContextPtr rmesa = R200_CONTEXT(ctx);
 
    radeon_prepare_render(&rmesa->radeon);
+   if (rmesa->radeon.NewGLState)
+      r200ValidateState( ctx );
+
 
    if (rmesa->radeon.swtcl.hw_primitive != hwprim) {
       /* need to disable perspective-correct texturing for point sprites */
index 4ae0f304918673d67ada3a7188a03b3f230e0ab6..ba54177476f620653e272df135717fa9ab2db590 100644 (file)
@@ -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)
+      r200ValidateState( ctx );
 
    if (newprim != rmesa->tcl.hw_primitive ||
        !discrete_prim[hw_prim&0xf]) {
index 85e4988c53f788b88cbd90ed262606cfa5e83988..8804b9ce0f758cd2c13711e221b5841ae8c2b715 100644 (file)
@@ -521,6 +521,7 @@ void radeon_prepare_render(radeonContextPtr radeon)
     __DRIcontext *driContext = radeon->dri.context;
     __DRIdrawable *drawable;
     __DRIscreen *screen;
+    struct radeon_framebuffer *draw;
 
     screen = driContext->driScreenPriv;
     if (!screen->dri2.loader)
@@ -531,9 +532,10 @@ void radeon_prepare_render(radeonContextPtr radeon)
        if (drawable->lastStamp != drawable->dri2.stamp)
            radeon_update_renderbuffers(driContext, drawable, GL_FALSE);
 
-       /* Intel driver does the equivalent of this, no clue if it is needed:
-        * radeon_draw_buffer(radeon->glCtx, &(drawable->driverPrivate)->base);
-        */
+       /* Intel driver does the equivalent of this, no clue if it is needed:*/
+       draw = drawable->driverPrivate;
+       radeon_draw_buffer(radeon->glCtx, &draw->base);
+
        driContext->dri2.draw_stamp = drawable->dri2.stamp;
     }