[Beignet] [PATCH 2/5] Clear batch buffer pointer after unmap
Zhenyu Wang
zhenyuw at linux.intel.com
Thu Oct 23 00:19:23 PDT 2014
Fix libdrm warning about unmap the unmapped buffer, as when
batch terminate we will try to do unmap again, but batch has
already been unmapped.
Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
---
src/intel/intel_batchbuffer.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/intel/intel_batchbuffer.c b/src/intel/intel_batchbuffer.c
index d3da3cc..ba6b05f 100644
--- a/src/intel/intel_batchbuffer.c
+++ b/src/intel/intel_batchbuffer.c
@@ -118,8 +118,9 @@ intel_batchbuffer_flush(intel_batchbuffer_t *batch)
*(uint32_t*)batch->ptr = MI_BATCH_BUFFER_END;
batch->ptr += 4;
- dri_bo_unmap(batch->buffer);
used = batch->ptr - batch->map;
+ dri_bo_unmap(batch->buffer);
+ batch->ptr = batch->map = NULL;
if (!is_locked)
intel_driver_lock_hardware(batch->intel);
--
2.1.1
More information about the Beignet
mailing list