Mesa (master): radeong: Make sure that we' re not emitting relocations for local buffers.

Corbin Simpson csimpson at kemper.freedesktop.org
Mon Jan 25 19:30:52 UTC 2010


Module: Mesa
Branch: master
Commit: 1571602153128971ae9ed549d633d67aac65da14
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1571602153128971ae9ed549d633d67aac65da14

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Mon Jan 25 11:04:55 2010 -0800

radeong: Make sure that we're not emitting relocations for local buffers.

Split from Marek's immd-mode patch.

---

 src/gallium/winsys/drm/radeon/core/radeon_r300.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
index 0253bc2..d759bea 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
@@ -81,9 +81,13 @@ static void radeon_write_cs_reloc(struct radeon_winsys* winsys,
                                   uint32_t flags)
 {
     int retval = 0;
+    struct radeon_pipe_buffer* radeon_buffer =
+        (struct radeon_pipe_buffer*)pbuffer;
 
-    retval = radeon_cs_write_reloc(winsys->priv->cs,
-            ((struct radeon_pipe_buffer*)pbuffer)->bo, rd, wd, flags);
+    assert(!radeon_buffer->pb);
+
+    retval = radeon_cs_write_reloc(winsys->priv->cs, radeon_buffer->bo,
+                                   rd, wd, flags);
 
     if (retval) {
         debug_printf("radeon: Relocation of %p (%d, %d, %d) failed!\n",




More information about the mesa-commit mailing list