Bleh, assert(pipe_is_referenced(ptr)) in pipe_reference_described() is non-pleased in debug builds about the trick of starting out the fences w/ refcnt=0 (so that it doesn't end up getting upref'd to 2 in pipe->flush().. so I'll have to re-work the fd/ilo/vc4 patches slightly..
BR, -R On Wed, Jul 8, 2015 at 4:34 PM, Rob Clark <robdcl...@gmail.com> wrote: > From: Rob Clark <robcl...@freedesktop.org> > > This isn't at all clear for pipe driver writers currently, since it > is not documented anywhere. But radeon/nouveau/llvmpipe seem to drop > the ref on the **fence passed in to pipe->flush() (if *fence!=NULL). > Freedreno/ilo/vc4 where not doing this. Some state trackers do call > screen->fence_reference(screen, &fence, NULL) before pipe->flush(), > but others do not. > > Add a comment for pipe->flush() to clairify what is expected of the > driver, and fixup freedreno/ilo/vc4 to comply. > > Note: that ilo/vc4 patches are untested > > Rob Clark (4): > gallium: clarify reference counting for fence > freedreno: unref old fence > ilo: unref old fence > vc4: unref old fence > > src/gallium/drivers/freedreno/freedreno_context.c | 2 +- > src/gallium/drivers/freedreno/freedreno_fence.c | 2 +- > src/gallium/drivers/ilo/ilo_context.c | 5 ++++- > src/gallium/drivers/ilo/ilo_screen.c | 2 +- > src/gallium/drivers/vc4/vc4_context.c | 3 ++- > src/gallium/drivers/vc4/vc4_fence.c | 2 +- > src/gallium/include/pipe/p_context.h | 8 +++++++- > 7 files changed, 17 insertions(+), 7 deletions(-) > > -- > 2.4.3 > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev