summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_batchbuffer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-02-10 00:25:17 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-02-21 12:59:34 +0000
commit8a9e67b8df9836408270a4bc3660ec45b622ae56 (patch)
tree3c27a8a343439dc550364d5d057e68d2ea6b6d80 /src/mesa/drivers/dri/intel/intel_batchbuffer.c
parent40ee15407ab626f466a12c239fc39cb872bec804 (diff)
intel: Buffered upload
Rather than performing lots of little writes to update the common bo upon each update, write those into a static buffer and flush that when full (or at the end of the batch). Doing so gives a dramatic performance improvement over and above using mmaped access. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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, 2 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
index 28bf42e770..5564e3ea2c 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
@@ -27,6 +27,7 @@
#include "intel_context.h"
#include "intel_batchbuffer.h"
+#include "intel_buffer_objects.h"
#include "intel_decode.h"
#include "intel_reg.h"
#include "intel_bufmgr.h"
@@ -175,11 +176,7 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file,
if (intel->vtbl.finish_batch)
intel->vtbl.finish_batch(intel);
- if (intel->upload.bo) {
- drm_intel_bo_unreference(intel->upload.bo);
- intel->upload.bo = NULL;
- intel->upload.offset = 0;
- }
+ intel_upload_finish(intel);
/* Check that we didn't just wrap our batchbuffer at a bad time. */
assert(!intel->no_batch_wrap);