diff options
author | Kenneth Graunke <[email protected]> | 2013-10-15 16:13:45 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-10-17 14:27:03 -0700 |
commit | f8fef8ee92576b847a4e963f2bee9bc5d1f280ba (patch) | |
tree | b575767718d6a2dcb2ed61db6a0b798556398fe1 /src | |
parent | 7601ba649f1d5541e8d77a10701616521b3cd37a (diff) |
i965: Merge brw_destroy_context() into intelDestroyContext().
Now that i915 and i965 have been split, the separation between
intelDestroyContext and brw_destroy_context is kind of arbitrary.
This patch replaces the only brw->vtbl.destroy() call with the body
of brw_destroy_context (the only implementation of that virtual
function).
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 20 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vtbl.c | 29 |
3 files changed, 19 insertions, 32 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index a5ba3533bd4..3a6016197ff 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -694,7 +694,25 @@ intelDestroyContext(__DRIcontext * driContextPriv) _mesa_meta_free(&brw->ctx); - brw->vtbl.destroy(brw); + if (INTEL_DEBUG & DEBUG_SHADER_TIME) { + /* Force a report. */ + brw->shader_time.report_time = 0; + + brw_collect_and_report_shader_time(brw); + brw_destroy_shader_time(brw); + } + + brw_destroy_state(brw); + brw_draw_destroy(brw); + + drm_intel_bo_unreference(brw->curbe.curbe_bo); + drm_intel_bo_unreference(brw->vs.base.const_bo); + drm_intel_bo_unreference(brw->wm.base.const_bo); + + free(brw->curbe.last_buf); + free(brw->curbe.next_buf); + + drm_intel_gem_context_destroy(brw->hw_ctx); if (ctx->swrast_context) { _swsetup_DestroyContext(&brw->ctx); diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 81fc1b9d5fc..3b95922d997 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -922,8 +922,6 @@ struct brw_context struct { - void (*destroy) (struct brw_context * brw); - void (*update_texture_surface)(struct gl_context *ctx, unsigned unit, uint32_t *surf_offset, diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 7f34083c2d9..a02259e9a7a 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -55,37 +55,8 @@ #include "glsl/ralloc.h" -/** - * called from intelDestroyContext() - */ -static void -brw_destroy_context(struct brw_context *brw) -{ - if (INTEL_DEBUG & DEBUG_SHADER_TIME) { - /* Force a report. */ - brw->shader_time.report_time = 0; - - brw_collect_and_report_shader_time(brw); - brw_destroy_shader_time(brw); - } - - brw_destroy_state(brw); - brw_draw_destroy( brw ); - - drm_intel_bo_unreference(brw->curbe.curbe_bo); - drm_intel_bo_unreference(brw->vs.base.const_bo); - drm_intel_bo_unreference(brw->wm.base.const_bo); - - free(brw->curbe.last_buf); - free(brw->curbe.next_buf); - - drm_intel_gem_context_destroy(brw->hw_ctx); -} - void brwInitVtbl( struct brw_context *brw ) { - brw->vtbl.destroy = brw_destroy_context; - assert(brw->gen >= 4); if (brw->gen >= 7) { gen7_init_vtable_surface_functions(brw); |