radeon: use bo_wait to wait for all buffers to be rendered to
authorDave Airlie <airlied@redhat.com>
Tue, 13 Jan 2009 06:50:15 +0000 (16:50 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 13 Jan 2009 06:50:15 +0000 (16:50 +1000)
Not 100% sure this is correct, but its what Intel does and its better than
CP_IDLE.

src/mesa/drivers/dri/r300/radeon_ioctl.c

index c8d6bf99bc75272425b14c64397d364c3e869921..8712317050820bd3b1193a4fdf1c16d660147877 100644 (file)
@@ -366,10 +366,19 @@ void radeonFlush(GLcontext * ctx)
 void radeonFinish(GLcontext * ctx)
 {
        radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+       struct gl_framebuffer *fb = ctx->DrawBuffer;
+       int i;
 
        radeonFlush(ctx);
 
-       if (radeon->do_irqs) {
+       if (radeon->radeonScreen->kernel_mm) {
+               for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
+                       struct radeon_renderbuffer *rrb;
+                       rrb = (struct radeon_renderbuffer *)fb->_ColorDrawBuffers[i];
+                       if (rrb->bo)
+                           radeon_bo_wait(rrb->bo);
+               }
+       } else if (radeon->do_irqs) {
                LOCK_HARDWARE(radeon);
                radeonEmitIrqLocked(radeon);
                UNLOCK_HARDWARE(radeon);