radeon/r200/r300/r600: fix blit BO buffer validation
authorDave Airlie <airlied@redhat.com>
Wed, 3 Mar 2010 06:27:21 +0000 (16:27 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 3 Mar 2010 06:28:53 +0000 (16:28 +1000)
there is no need for these to be persistent since we flush the CS
at the end of the blit, and we don't reuse these buffers at all.

on my r600 the Wine DX9 test suite doesn't crash at least anymore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/drivers/dri/r200/r200_blit.c
src/mesa/drivers/dri/r300/r300_blit.c
src/mesa/drivers/dri/r600/r600_blit.c
src/mesa/drivers/dri/radeon/radeon_blit.c

index e446d532cf7a03ea14502263f4652370aa84667b..56b08a21bd5c200e2c166bdbeb6b6b767c374944 100644 (file)
@@ -211,11 +211,15 @@ static GLboolean validate_buffers(struct r200_context *r200,
                                   struct radeon_bo *dst_bo)
 {
     int ret;
-    radeon_cs_space_add_persistent_bo(r200->radeon.cmdbuf.cs,
-                                      src_bo, RADEON_GEM_DOMAIN_VRAM, 0);
+    ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs,
+                                        src_bo, RADEON_GEM_DOMAIN_VRAM, 0);
+    if (ret)
+        return GL_FALSE;
 
-    radeon_cs_space_add_persistent_bo(r200->radeon.cmdbuf.cs,
-                                      dst_bo, 0, RADEON_GEM_DOMAIN_VRAM);
+    ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs,
+                                        dst_bo, 0, RADEON_GEM_DOMAIN_VRAM);
+    if (ret)
+        return GL_FALSE;
 
     ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs,
                                         first_elem(&r200->radeon.dma.reserved)->bo,
index 54ac2510e7a1f5419e22c4ed772c7ac90dfab5fb..35fd06734f89793da4020594701d473413afb5ec 100644 (file)
@@ -373,11 +373,15 @@ static GLboolean validate_buffers(struct r300_context *r300,
                                   struct radeon_bo *dst_bo)
 {
     int ret;
-    radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs,
-                                      src_bo, RADEON_GEM_DOMAIN_VRAM, 0);
+    ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs,
+                                        src_bo, RADEON_GEM_DOMAIN_VRAM, 0);
+    if (ret)
+        return GL_FALSE;
 
-    radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs,
-                                      dst_bo, 0, RADEON_GEM_DOMAIN_VRAM);
+    ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs,
+                                        dst_bo, 0, RADEON_GEM_DOMAIN_VRAM);
+    if (ret)
+        return GL_FALSE;
 
     ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs,
                                         first_elem(&r300->radeon.dma.reserved)->bo,
index 4bb77a398f966b29bf18a0049d1667dab982830b..8eafd42e8fb2fc9e84ccaf52717c5f3620ee50f5 100644 (file)
@@ -1532,14 +1532,16 @@ static GLboolean validate_buffers(context_t *rmesa,
                                   struct radeon_bo *dst_bo)
 {
     int ret;
-    radeon_cs_space_add_persistent_bo(rmesa->radeon.cmdbuf.cs,
-                                      src_bo, RADEON_GEM_DOMAIN_VRAM, 0);
 
-    radeon_cs_space_add_persistent_bo(rmesa->radeon.cmdbuf.cs,
-                                      dst_bo, 0, RADEON_GEM_DOMAIN_VRAM);
+    ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs,
+                                       src_bo, RADEON_GEM_DOMAIN_VRAM, 0);
+    if (ret)
+        return GL_FALSE;
 
-    radeon_cs_space_add_persistent_bo(rmesa->radeon.cmdbuf.cs,
-                                      rmesa->blit_bo, RADEON_GEM_DOMAIN_GTT, 0);
+    ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs,
+                                        dst_bo, 0, RADEON_GEM_DOMAIN_VRAM);
+    if (ret)
+        return GL_FALSE;
 
     ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs,
                                        rmesa->blit_bo,
index 0df4fbb33c530c7d9e3d81b569b4ad5323727a3d..34b9af406361a6afa9bd999a3e8dbee8f8f667ee 100644 (file)
@@ -204,11 +204,15 @@ static GLboolean validate_buffers(struct r100_context *r100,
                                   struct radeon_bo *dst_bo)
 {
     int ret;
-    radeon_cs_space_add_persistent_bo(r100->radeon.cmdbuf.cs,
-                                      src_bo, RADEON_GEM_DOMAIN_VRAM, 0);
+    ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs,
+                                        src_bo, RADEON_GEM_DOMAIN_VRAM, 0);
+    if (ret)
+        return GL_FALSE;
 
-    radeon_cs_space_add_persistent_bo(r100->radeon.cmdbuf.cs,
-                                      dst_bo, 0, RADEON_GEM_DOMAIN_VRAM);
+    ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs,
+                                        dst_bo, 0, RADEON_GEM_DOMAIN_VRAM);
+    if (ret)
+        return GL_FALSE;
 
     ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs,
                                         first_elem(&r100->radeon.dma.reserved)->bo,