radeong: Make sure that we're not emitting relocations for local buffers.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 25 Jan 2010 19:04:55 +0000 (11:04 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 25 Jan 2010 19:30:39 +0000 (11:30 -0800)
Split from Marek's immd-mode patch.

src/gallium/winsys/drm/radeon/core/radeon_r300.c

index 0253bc2527e5974e83f0310c8a750535585c000b..d759beaba137b9eb484fe39c5250bc66b97046bc 100644 (file)
@@ -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",