[Mesa-dev] [PATCH 1/2] i965: remove if conditions from scratch_bo unref

Kenneth Graunke kenneth at whitecape.org
Fri Oct 27 10:19:56 UTC 2017


On Friday, October 27, 2017 2:56:45 AM PDT Tapani Pälli wrote:
> brw_bo_unreference handles NULL case
> 
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_context.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> index c8de074638..39b2a938f6 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -1061,16 +1061,12 @@ intelDestroyContext(__DRIcontext * driContextPriv)
>     brw_draw_destroy(brw);
>  
>     brw_bo_unreference(brw->curbe.curbe_bo);
> -   if (brw->vs.base.scratch_bo)
> -      brw_bo_unreference(brw->vs.base.scratch_bo);
> -   if (brw->tcs.base.scratch_bo)
> -      brw_bo_unreference(brw->tcs.base.scratch_bo);
> -   if (brw->tes.base.scratch_bo)
> -      brw_bo_unreference(brw->tes.base.scratch_bo);
> -   if (brw->gs.base.scratch_bo)
> -      brw_bo_unreference(brw->gs.base.scratch_bo);
> -   if (brw->wm.base.scratch_bo)
> -      brw_bo_unreference(brw->wm.base.scratch_bo);
> +
> +   brw_bo_unreference(brw->vs.base.scratch_bo);
> +   brw_bo_unreference(brw->tcs.base.scratch_bo);
> +   brw_bo_unreference(brw->tes.base.scratch_bo);
> +   brw_bo_unreference(brw->gs.base.scratch_bo);
> +   brw_bo_unreference(brw->wm.base.scratch_bo);
>  
>     brw_destroy_hw_context(brw->bufmgr, brw->hw_ctx);
>  
> 

Series is:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171027/17d2f908/attachment.sig>


More information about the mesa-dev mailing list