radeon: don't re-add BOs to validate list
authorDave Airlie <airlied@redhat.com>
Thu, 18 Jun 2009 03:12:21 +0000 (13:12 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 18 Jun 2009 03:16:06 +0000 (13:16 +1000)
if its on the list its on the list don't go readding it.

multitexturing from the same texture could cause this.

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

index 32fe4d5645bb10e2302e1fd4c9876000f9cd4a26..7bd4a6f14f2cffc2e2e0a7650ceccdd8fcca0366 100644 (file)
@@ -999,6 +999,13 @@ void radeon_validate_reset_bos(radeonContextPtr radeon)
 
 void radeon_validate_bo(radeonContextPtr radeon, struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain)
 {
+       int i;
+       for (i = 0; i < radeon->state.validated_bo_count; i++) {
+               if (radeon->state.bos[i].bo == bo &&
+                   radeon->state.bos[i].read_domains == read_domains &&
+                   radeon->state.bos[i].write_domain == write_domain)
+                       return;
+       }
        radeon_bo_ref(bo);
        radeon->state.bos[radeon->state.validated_bo_count].bo = bo;
        radeon->state.bos[radeon->state.validated_bo_count].read_domains = read_domains;