i965: Replace dri_bo_release with drm_intel_bo_unreference.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 15 Oct 2013 23:09:22 +0000 (16:09 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 17 Oct 2013 21:27:03 +0000 (14:27 -0700)
dri_bo_release is a helper function that calls drm_intel_bo_unreference
but then also sets the pointer to NULL.  This is unnecessary, since
brw_destroy_context is called from intelDestroyContext, which also frees
brw completely.

If you're still trying to access them, you've got bigger problems.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_vtbl.c

index d78af8b34961fddc6462a5a55b84b8fa41dd91b3..7f34083c2d99c4bd7aef4e4c57d1e69a15bd88fb 100644 (file)
 
 #include "glsl/ralloc.h"
 
-static void
-dri_bo_release(drm_intel_bo **bo)
-{
-   drm_intel_bo_unreference(*bo);
-   *bo = NULL;
-}
-
-
 /**
  * called from intelDestroyContext()
  */
@@ -80,9 +72,9 @@ brw_destroy_context(struct brw_context *brw)
    brw_destroy_state(brw);
    brw_draw_destroy( brw );
 
-   dri_bo_release(&brw->curbe.curbe_bo);
-   dri_bo_release(&brw->vs.base.const_bo);
-   dri_bo_release(&brw->wm.base.const_bo);
+   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);