intel: Supply the correct buffers to gem
authorJakob Bornecrantz <wallbraker@gmail.com>
Wed, 28 Jan 2009 22:22:28 +0000 (23:22 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Wed, 28 Jan 2009 22:28:09 +0000 (23:28 +0100)
src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c

index e83a4c42cd039cc41b044d7ccf559027c1e58bf1..b7bc3ee1c95f1647e6e8ed8f0e5ed5da1f9658f8 100644 (file)
@@ -66,13 +66,15 @@ intel_be_offset_relocation(struct intel_be_batchbuffer *batch,
        assert(batch->base.relocs < batch->base.max_relocs);
 
        offset = (unsigned)(batch->base.ptr - batch->base.map);
-       batch->base.ptr += 4;
 
-       ret = drm_intel_bo_emit_reloc(bo, pre_add,
-                                     batch->bo, offset,
+       ret = drm_intel_bo_emit_reloc(batch->bo, offset,
+                                     bo, pre_add,
                                      read_domains,
                                      write_domain);
 
+       ((uint32_t*)batch->base.ptr)[0] = bo->offset = pre_add;
+       batch->base.ptr += 4;
+
        if (!ret)
                batch->base.relocs++;