i965: make intel_batchbuffer_free() take a batchbuffer as argument
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 3 Jan 2017 07:39:27 +0000 (08:39 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Wed, 4 Jan 2017 07:14:26 +0000 (08:14 +0100)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/intel_batchbuffer.c
src/mesa/drivers/dri/i965/intel_batchbuffer.h

index 45490a0f5cf839e482e29ab5ed9f3e185bf319ae..f248fac6181f8acb28f1d6e7c89710da0bf8f3b4 100644 (file)
@@ -1199,7 +1199,7 @@ intelDestroyContext(__DRIcontext * driContextPriv)
       _swrast_DestroyContext(&brw->ctx);
 
    brw_fini_pipe_control(brw);
-   intel_batchbuffer_free(brw);
+   intel_batchbuffer_free(&brw->batch);
 
    drm_intel_bo_unreference(brw->throttle_batch[1]);
    drm_intel_bo_unreference(brw->throttle_batch[0]);
index 9a3782000a60475a75787bdecf766c39e1afc4c1..71e0ed08da47557021c77c155ab70c544e42eb90 100644 (file)
@@ -99,11 +99,11 @@ intel_batchbuffer_reset_to_saved(struct brw_context *brw)
 }
 
 void
-intel_batchbuffer_free(struct brw_context *brw)
+intel_batchbuffer_free(struct intel_batchbuffer *batch)
 {
-   free(brw->batch.cpu_map);
-   drm_intel_bo_unreference(brw->batch.last_bo);
-   drm_intel_bo_unreference(brw->batch.bo);
+   free(batch->cpu_map);
+   drm_intel_bo_unreference(batch->last_bo);
+   drm_intel_bo_unreference(batch->bo);
 }
 
 void
index aca8fa1665b19a7e7a4ad068ecc027117bd3ea1d..d0ddf75866cd5bb1b5cc8f268e0a32010682c1b2 100644 (file)
@@ -40,7 +40,7 @@ struct intel_batchbuffer;
 
 void intel_batchbuffer_emit_render_ring_prelude(struct brw_context *brw);
 void intel_batchbuffer_init(struct brw_context *brw);
-void intel_batchbuffer_free(struct brw_context *brw);
+void intel_batchbuffer_free(struct intel_batchbuffer *batch);
 void intel_batchbuffer_save_state(struct brw_context *brw);
 void intel_batchbuffer_reset_to_saved(struct brw_context *brw);
 void intel_batchbuffer_require_space(struct brw_context *brw, GLuint sz,