[Mesa-dev] [PATCH] gallium/postprocess: Fix resource freeing

Alex Deucher alexdeucher at gmail.com
Wed Aug 31 13:11:04 UTC 2016


On Wed, Aug 31, 2016 at 2:22 AM, Thomas Hellstrom <thellstrom at vmware.com> wrote:
> The code was triggering asserts in DEBUG builds of the SVGA driver since
> the reference count of the resource was never decremented before destroy.
>
> Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
> Reviewed-by: Brian Paul <brianp at vmware.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>


> ---
>  src/gallium/auxiliary/postprocess/pp_mlaa.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/auxiliary/postprocess/pp_mlaa.c b/src/gallium/auxiliary/postprocess/pp_mlaa.c
> index 502fcf1..0edd01f 100644
> --- a/src/gallium/auxiliary/postprocess/pp_mlaa.c
> +++ b/src/gallium/auxiliary/postprocess/pp_mlaa.c
> @@ -353,13 +353,11 @@ void
>  pp_jimenezmlaa_free(struct pp_queue_t *ppq, unsigned int n)
>  {
>     if (ppq->areamaptex) {
> -      ppq->p->screen->resource_destroy(ppq->p->screen, ppq->areamaptex);
> -      ppq->areamaptex = NULL;
> +      pipe_resource_reference(&ppq->areamaptex, NULL);
>     }
>
>     if (ppq->constbuf) {
> -      ppq->p->screen->resource_destroy(ppq->p->screen, ppq->constbuf);
> -      ppq->constbuf = NULL;
> +      pipe_resource_reference(&ppq->constbuf, NULL);
>     }
>  }
>
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list