summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2007-05-17 15:36:43 -0700
committerEric Anholt <[email protected]>2007-05-17 15:36:43 -0700
commitb12b24a430e2d328cbe102612b8a152e5c925cbf (patch)
tree80137ebffa8dbc64e506c936d2a90f0295d18a4f /src
parent1f08f5d97068ea89f0fa527520a2ccb0a69ea50b (diff)
Restore missing intel_batchbuffer_reset() which was needed.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_batchbuffer.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
index 55e40d5d97d..67fca371a7e 100644
--- a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
@@ -80,12 +80,16 @@ intel_dump_batchbuffer(GLuint offset, GLuint * ptr, GLuint count)
/*======================================================================
* Public functions
*/
-struct intel_batchbuffer *
-intel_batchbuffer_alloc(struct intel_context *intel)
+void
+intel_batchbuffer_reset(struct intel_batchbuffer *batch)
{
- struct intel_batchbuffer *batch = calloc(sizeof(*batch), 1);
+ struct intel_context *intel = batch->intel;
+
+ if (batch->buf != NULL) {
+ dri_bo_unreference(batch->buf);
+ batch->buf = NULL;
+ }
- batch->intel = intel;
batch->buf = dri_bo_alloc(intel->intelScreen->bufmgr, "batchbuffer",
intel->intelScreen->maxBatchSize, 4096,
DRM_BO_FLAG_MEM_TT |
@@ -94,9 +98,17 @@ intel_batchbuffer_alloc(struct intel_context *intel)
batch->map = batch->buf->virtual;
batch->size = intel->intelScreen->maxBatchSize;
batch->ptr = batch->map;
+}
+
+struct intel_batchbuffer *
+intel_batchbuffer_alloc(struct intel_context *intel)
+{
+ struct intel_batchbuffer *batch = calloc(sizeof(*batch), 1);
+ batch->intel = intel;
batch->last_fence = NULL;
intel_batchbuffer_reset(batch);
+
return batch;
}