On Mon, 2013-03-04 at 13:17 -0500, j.gli...@gmail.com wrote: 
> From: Jerome Glisse <jgli...@redhat.com>
> 
> Some code calling the flush function gave a fence pointer that point
> to an old fence and should be unreference to avoid leaking fence.
> 
> Candidate for 9.1
> 
> Signed-off-by: Jerome Glisse <jgli...@redhat.com>
> ---
>  src/gallium/drivers/r600/r600_pipe.c         | 8 +++++---
>  src/gallium/drivers/radeonsi/radeonsi_pipe.c | 9 ++++++---
>  2 files changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/src/gallium/drivers/r600/r600_pipe.c 
> b/src/gallium/drivers/r600/r600_pipe.c
> index 78002ae..4bcfc67 100644
> --- a/src/gallium/drivers/r600/r600_pipe.c
> +++ b/src/gallium/drivers/r600/r600_pipe.c
> @@ -145,12 +145,14 @@ static void r600_flush_from_st(struct pipe_context *ctx,
>                              enum pipe_flush_flags flags)
>  {
>       struct r600_context *rctx = (struct r600_context *)ctx;
> -     struct r600_fence **rfence = (struct r600_fence**)fence;
> +     struct r600_fence *rfence;
>       unsigned fflags;
>  
>       fflags = flags & PIPE_FLUSH_END_OF_FRAME ? RADEON_FLUSH_END_OF_FRAME : 
> 0;
> -     if (rfence) {
> -             *rfence = r600_create_fence(rctx);
> +     if (fence) {
> +             rfence = r600_create_fence(rctx);
> +             ctx->screen->fence_reference(ctx->screen, fence,
> +                                             (struct pipe_fence_handle 
> *)rfence);

This change increases the reference count of the returned fence from 1
to 2. I don't think that's correct, but if it is, the change should be
amended with an explanation why.


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to