lib: Clean the batch buffer store after reset
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 6 Dec 2013 08:54:44 +0000 (16:54 +0800)
committerDamien Lespiau <damien.lespiau@intel.com>
Fri, 6 Dec 2013 13:00:22 +0000 (13:00 +0000)
Otherwise the stale data in the buffer

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
lib/intel_batchbuffer.c

index 06a5437..9ce7424 100644 (file)
@@ -50,6 +50,8 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch)
        batch->bo = drm_intel_bo_alloc(batch->bufmgr, "batchbuffer",
                                       BATCH_SZ, 4096);
 
+       memset(batch->buffer, 0, sizeof(batch->buffer));
+
        batch->ptr = batch->buffer;
 }