Mesa (main): gallium/noop: implement fences

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 9 13:14:25 UTC 2021


Module: Mesa
Branch: main
Commit: f2c04c93786526c9a550e2e6adf8dfee0d41daf9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f2c04c93786526c9a550e2e6adf8dfee0d41daf9

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Fri Aug  6 02:36:09 2021 -0400

gallium/noop: implement fences

Acked-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>

---

 src/gallium/auxiliary/driver_noop/noop_pipe.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/driver_noop/noop_pipe.c b/src/gallium/auxiliary/driver_noop/noop_pipe.c
index a98567b641c..29a52d33002 100644
--- a/src/gallium/auxiliary/driver_noop/noop_pipe.c
+++ b/src/gallium/auxiliary/driver_noop/noop_pipe.c
@@ -310,8 +310,13 @@ static void noop_flush(struct pipe_context *ctx,
                        struct pipe_fence_handle **fence,
                        unsigned flags)
 {
-   if (fence)
-      *fence = NULL;
+   if (fence) {
+      struct pipe_reference *f = MALLOC_STRUCT(pipe_reference);
+      f->count = 1;
+
+      ctx->screen->fence_reference(ctx->screen, fence, NULL);
+      *fence = (struct pipe_fence_handle*)f;
+   }
 }
 
 static void noop_destroy_context(struct pipe_context *ctx)
@@ -488,6 +493,11 @@ static void noop_fence_reference(struct pipe_screen *screen,
                           struct pipe_fence_handle **ptr,
                           struct pipe_fence_handle *fence)
 {
+   if (pipe_reference((struct pipe_reference*)*ptr,
+                      (struct pipe_reference*)fence))
+      FREE(*ptr);
+
+   *ptr = fence;
 }
 
 static bool noop_fence_finish(struct pipe_screen *screen,



More information about the mesa-commit mailing list