i965: Merge brw_destroy_context() into intelDestroyContext().
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 15 Oct 2013 23:13:45 +0000 (16:13 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 17 Oct 2013 21:27:03 +0000 (14:27 -0700)
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 <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_vtbl.c

index a5ba3533bd4ec618020e10d8fb7a59ed3161b5c3..3a6016197ff5cd762a45f7e1d328f0fcd6da7951 100644 (file)
@@ -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);
index 81fc1b9d5fc23b9f7a60d02cf1c8fbdb386f10fb..3b95922d997d1e03088a479326ae8dd71fbf8dde 100644 (file)
@@ -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,
index 7f34083c2d99c4bd7aef4e4c57d1e69a15bd88fb..a02259e9a7a24d163bf755a48c6e4309bb3f8b94 100644 (file)
 
 #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);