Skip to contentSkip to conversation

radeon: allow write_reloc with unaccounted buffers to cope with Mesa R200 bug

PATCH In review Marek Olšák 2 participants 3 messages Aug 1, 2014 – Aug 4, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 radeon: allow write_reloc with unaccounted buffers to cope with Mesa R200 bug

From: Marek Olšák <[email protected]>

---

I'm not really interested in studying the R200 driver to fix it. This has to suffice.

 radeon/radeon_cs_gem.c | 9 +++++++++
 1 file changed, 9 insertions(+)
radeon/radeon_cs_gem.c +9 -0
index b87c6b1..bcfa05b 100644
@@ -178,6 +178,15 @@ static int cs_gem_write_reloc(struct radeon_cs_int *cs,
     uint32_t idx;
     unsigned i;
 
+    if (!boi->space_accounted) {
+        struct radeon_cs *rcs = (struct radeon_cs*)cs;
+        int r;
+
+        radeon_cs_space_add_persistent_bo(rcs, bo, read_domain, write_domain);
+        r = radeon_cs_space_check(rcs);
+        if (r)
+            return r;
+    }
     assert(boi->space_accounted);
 
     /* check domains */
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Marek Olšák

From: Marek Olšák <[email protected]>

---

I'm not really interested in studying the R200 driver to fix it. This has to suffice.

Quoted 27 lines
 radeon/radeon_cs_gem.c | 9 +++++++++
 1 file changed, 9 insertions(+)
radeon/radeon_cs_gem.c +9 -1
index b87c6b1..bcfa05b 100644
@@ -178,6 +178,15 @@ static int cs_gem_write_reloc(struct radeon_cs_int *cs,
     uint32_t idx;
     unsigned i;
 
+    if (!boi->space_accounted) {
+        struct radeon_cs *rcs = (struct radeon_cs*)cs;
+        int r;
+
+        radeon_cs_space_add_persistent_bo(rcs, bo, read_domain, write_domain);
+        r = radeon_cs_space_check(rcs);
+        if (r)
+            return r;
+    }
     assert(boi->space_accounted);
 
     /* check domains */
--

1.9.1

Quoted 4 lines

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

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

#2 lore raw

Actually, please disregard this patch. I have found and fixed the real problem in mesa/r200.

Marek

Quoted 33 lines · Alex Deucher
Quoted 6 lines · Marek Olšák

From: Marek Olšák <[email protected]>

---

I'm not really interested in studying the R200 driver to fix it. This has to suffice.

Quoted 23 lines
 radeon/radeon_cs_gem.c | 9 +++++++++
 1 file changed, 9 insertions(+)
radeon/radeon_cs_gem.c +9 -0
index b87c6b1..bcfa05b 100644
@@ -178,6 +178,15 @@ static int cs_gem_write_reloc(struct radeon_cs_int *cs,
     uint32_t idx;
     unsigned i;
 
+    if (!boi->space_accounted) {
+        struct radeon_cs *rcs = (struct radeon_cs*)cs;
+        int r;
+
+        radeon_cs_space_add_persistent_bo(rcs, bo, read_domain, write_domain);
+        r = radeon_cs_space_check(rcs);
+        if (r)
+            return r;
+    }
     assert(boi->space_accounted);
 
Quoted 8 lines
Quoted 8 lines
radeon/radeon_cs_gem.c +0 -1
     /* check domains */
--

1.9.1

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

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