Mesa (r6xx-rewrite): make sure ctx->Driver.Flush is valid before calling it

Alex Deucher agd5f at kemper.freedesktop.org
Wed Jul 15 15:31:54 UTC 2009


Module: Mesa
Branch: r6xx-rewrite
Commit: a0d4a12614fce072fa1eb5516e626909171c95e1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a0d4a12614fce072fa1eb5516e626909171c95e1

Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Wed Jul 15 11:31:24 2009 -0400

make sure ctx->Driver.Flush is valid before calling it

---

 src/mesa/drivers/dri/radeon/radeon_common.c |    6 ++++--
 src/mesa/drivers/dri/radeon/radeon_fbo.c    |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c
index 1848b71..59ae781 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common.c
@@ -999,7 +999,8 @@ again:
 	if (ret == RADEON_CS_SPACE_OP_TO_BIG)
 		return GL_FALSE;
 	if (ret == RADEON_CS_SPACE_FLUSH) {
-		ctx->Driver.Flush(ctx); /* +r6/r7 */
+		if (ctx->Driver.Flush)
+			ctx->Driver.Flush(ctx); /* +r6/r7 */
 		if (flushed)
 			return GL_FALSE;
 		flushed = 1;
@@ -1121,7 +1122,8 @@ void radeonFinish(GLcontext * ctx)
 	struct gl_framebuffer *fb = ctx->DrawBuffer;
 	int i;
 
-	ctx->Driver.Flush(ctx); /* +r6/r7 */
+	if (ctx->Driver.Flush)
+		ctx->Driver.Flush(ctx); /* +r6/r7 */
 
 	if (radeon->radeonScreen->kernel_mm) {
 		for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 8fa665e..ea18f1e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -165,7 +165,8 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
       return GL_FALSE;
    }
 
-  ctx->Driver.Flush(ctx); /* +r6/r7 */
+  if (ctx->Driver.Flush)
+	  ctx->Driver.Flush(ctx); /* +r6/r7 */
 
   if (rrb->bo)
     radeon_bo_unref(rrb->bo);
@@ -381,7 +382,8 @@ radeon_framebuffer_renderbuffer(GLcontext * ctx,
                                GLenum attachment, struct gl_renderbuffer *rb)
 {
 
-   ctx->Driver.Flush(ctx); /* +r6/r7 */
+	if (ctx->Driver.Flush)
+		ctx->Driver.Flush(ctx); /* +r6/r7 */
 
    _mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb);
    radeon_draw_buffer(ctx, fb);




More information about the mesa-commit mailing list