radeon: realloc dma if needed after revalidate
authorJerome Glisse <glisse@freedesktop.org>
Sat, 23 May 2009 19:57:25 +0000 (21:57 +0200)
committerJerome Glisse <glisse@freedesktop.org>
Sun, 24 May 2009 14:24:53 +0000 (16:24 +0200)
Revalidate can trigger flushing and dma buffer deallocation,
so retry allocation on such case.

src/mesa/drivers/dri/radeon/radeon_dma.c

index a357afe6798935b446e87bf7a351aae9c7894374..48b0d638183734b6634daeb5a3e32229b65b712e 100644 (file)
@@ -203,6 +203,12 @@ again_alloc:
        if (radeon_revalidate_bos(rmesa->glCtx) == GL_FALSE)
          fprintf(stderr,"failure to revalidate BOs - badness\n");
 
+       if (!rmesa->dma.current) {
+        /* Cmd buff have been flushed in radeon_revalidate_bos */
+               rmesa->dma.nr_released_bufs = 0;
+               goto again_alloc;
+       }
+
        radeon_bo_map(rmesa->dma.current, 1);
 }