[Mesa-dev] [PATCH] r600g/radeonsi: unreference previous fence in flush
Michel Dänzer
michel at daenzer.net
Mon Mar 4 11:05:22 PST 2013
On Mon, 2013-03-04 at 13:17 -0500, j.glisse at gmail.com wrote:
> From: Jerome Glisse <jglisse at 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 <jglisse at 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
More information about the mesa-dev
mailing list