summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_batchbuffer.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2007-12-06 14:11:34 -0800
committerKeith Packard <keithp@keithp.com>2007-12-11 20:27:42 -0800
commitaeca22f97c5650108a315063ea76ad2204bb2ef5 (patch)
tree35d4ab3a5d88bb2f840014015f6d368f81dda52b /src/mesa/drivers/dri/intel/intel_batchbuffer.c
parent46c405663b20a33be7ed386ce61f66b9c2ee072b (diff)
Use previous buffer offsets to compute proposed relocations
This takes advantage of the DRM_BO_HINT_PRESUMED_OFFSET change and allows the kernel to avoid mapping and re-writing buffers when relocations occur.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_batchbuffer.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_batchbuffer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
index 21db0e7dcd..1deca8ca1d 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
@@ -246,7 +246,12 @@ intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch,
GLuint flags, GLuint delta)
{
dri_emit_reloc(batch->buf, flags, delta, batch->ptr - batch->map, buffer);
- batch->ptr += 4;
+ /*
+ * Using the old buffer offset, write in what the right data would be, in case
+ * the buffer doesn't move and we can short-circuit the relocation processing
+ * in the kernel
+ */
+ intel_batchbuffer_emit_dword (batch, buffer->offset + delta);
return GL_TRUE;
}