Mesa (master): freedreno: unref old fence

Rob Clark robclark at kemper.freedesktop.org
Fri Jul 10 15:58:21 UTC 2015


Module: Mesa
Branch: master
Commit: 7e0a26defe65dad7ffc8e7a95b5577be51feb2bc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e0a26defe65dad7ffc8e7a95b5577be51feb2bc

Author: Rob Clark <robclark at freedesktop.org>
Date:   Wed Jul  8 14:48:01 2015 -0400

freedreno: unref old fence

Some, but not all, state trackers will explicitly unref (and set to
NULL) the previous *fence before calling pipe->flush().  So driver
should use fence_ref() which will unref the old fence if not NULL.

Signed-off-by: Rob Clark <robclark at freedesktop.org>

---

 src/gallium/drivers/freedreno/freedreno_context.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c
index 668ef36..127fb5f 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -144,8 +144,10 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
 {
 	fd_context_render(pctx);
 
-	if (fence)
+	if (fence) {
+		fd_screen_fence_ref(pctx->screen, fence, NULL);
 		*fence = fd_fence_create(pctx);
+	}
 }
 
 void




More information about the mesa-commit mailing list