Skip to contentSkip to conversation

radeon_cs_setup_bo: Fix accounting if caller specified write and read domains.

PATCH In review Michel Dänzer 2 participants 2 messages Feb 8, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 radeon_cs_setup_bo: Fix accounting if caller specified write and read domains.

From: Michel Dänzer <[email protected]>

Only account for the write domain in that case.

Should fix https://bugs.freedesktop.org/show_bug.cgi?id=43893 .

---
 radeon/radeon_cs_space.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
radeon/radeon_cs_space.c +9 -6
index 208e1bb..be047a7 100644
@@ -65,13 +65,16 @@ static inline int radeon_cs_setup_bo(struct radeon_cs_space_check *sc, struct ra
     }
 
     if (bo->space_accounted == 0) {
-        if (write_domain == RADEON_GEM_DOMAIN_VRAM)
-            sizes->op_vram_write += bo->size;
-        else if (write_domain == RADEON_GEM_DOMAIN_GTT)
-            sizes->op_gart_write += bo->size;
-        else
+        if (write_domain) {
+            if (write_domain == RADEON_GEM_DOMAIN_VRAM)
+                sizes->op_vram_write += bo->size;
+            else if (write_domain == RADEON_GEM_DOMAIN_GTT)
+                sizes->op_gart_write += bo->size;
+            sc->new_accounted = write_domain;
+        } else {
             sizes->op_read += bo->size;
-        sc->new_accounted = (read_domains << 16) | write_domain;
+            sc->new_accounted = read_domains << 16;
+        }
     } else {
         uint16_t old_read, old_write;
 
Signature · 6 lines
1.7.9

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

2012/2/8 Michel Dänzer <[email protected]>:

Quoted 7 lines

From: Michel Dänzer <[email protected]>

Only account for the write domain in that case.

Should fix https://bugs.freedesktop.org/show_bug.cgi?id=43893 .

Quoted 38 lines

---
 radeon/radeon_cs_space.c |   15 +++++++++------

 1 files changed, 9 insertions(+), 6 deletions(-)
radeon/radeon_cs_space.c +9 -7
index 208e1bb..be047a7 100644
@@ -65,13 +65,16 @@ static inline int radeon_cs_setup_bo(struct radeon_cs_space_check *sc, struct ra
     }
 
     if (bo->space_accounted == 0) {
-        if (write_domain == RADEON_GEM_DOMAIN_VRAM)
-            sizes->op_vram_write += bo->size;
-        else if (write_domain == RADEON_GEM_DOMAIN_GTT)
-            sizes->op_gart_write += bo->size;
-        else
+        if (write_domain) {
+            if (write_domain == RADEON_GEM_DOMAIN_VRAM)
+                sizes->op_vram_write += bo->size;
+            else if (write_domain == RADEON_GEM_DOMAIN_GTT)
+                sizes->op_gart_write += bo->size;
+            sc->new_accounted = write_domain;
+        } else {
             sizes->op_read += bo->size;
-        sc->new_accounted = (read_domains << 16) | write_domain;
+            sc->new_accounted = read_domains << 16;
+        }
     } else {
         uint16_t old_read, old_write;
 
--

1.7.9

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel