Mesa (master): u_threaded_context: add support for fence_server_signal v2

Andres Rodriguez lostgoat at kemper.freedesktop.org
Tue Jan 30 20:20:03 UTC 2018


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

Author: Andres Rodriguez <andresx7 at gmail.com>
Date:   Thu Oct 26 19:16:51 2017 -0400

u_threaded_context: add support for fence_server_signal v2

v2: s/semaphore/fence

Signed-off-by: Andres Rodriguez <andresx7 at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/auxiliary/util/u_threaded_context.c      | 20 ++++++++++++++++++++
 .../auxiliary/util/u_threaded_context_calls.h        |  1 +
 2 files changed, 21 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
index 3ea1797a9e..1c647a3efd 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -1864,6 +1864,25 @@ tc_fence_server_sync(struct pipe_context *_pipe,
    screen->fence_reference(screen, &payload->fence, fence);
 }
 
+static void
+tc_call_fence_server_signal(struct pipe_context *pipe, union tc_payload *payload)
+{
+   pipe->fence_server_signal(pipe, payload->fence);
+   pipe->screen->fence_reference(pipe->screen, &payload->fence, NULL);
+}
+
+static void
+tc_fence_server_signal(struct pipe_context *_pipe,
+                           struct pipe_fence_handle *fence)
+{
+   struct threaded_context *tc = threaded_context(_pipe);
+   struct pipe_screen *screen = tc->pipe->screen;
+   union tc_payload *payload = tc_add_small_call(tc, TC_CALL_fence_server_signal);
+
+   payload->fence = NULL;
+   screen->fence_reference(screen, &payload->fence, fence);
+}
+
 static struct pipe_video_codec *
 tc_create_video_codec(UNUSED struct pipe_context *_pipe,
                       UNUSED const struct pipe_video_codec *templ)
@@ -2662,6 +2681,7 @@ threaded_context_create(struct pipe_context *pipe,
    CTX_INIT(set_debug_callback);
    CTX_INIT(create_fence_fd);
    CTX_INIT(fence_server_sync);
+   CTX_INIT(fence_server_signal);
    CTX_INIT(get_timestamp);
    CTX_INIT(create_texture_handle);
    CTX_INIT(delete_texture_handle);
diff --git a/src/gallium/auxiliary/util/u_threaded_context_calls.h b/src/gallium/auxiliary/util/u_threaded_context_calls.h
index 675deaabd9..921b86a67f 100644
--- a/src/gallium/auxiliary/util/u_threaded_context_calls.h
+++ b/src/gallium/auxiliary/util/u_threaded_context_calls.h
@@ -1,6 +1,7 @@
 CALL(flush)
 CALL(callback)
 CALL(fence_server_sync)
+CALL(fence_server_signal)
 CALL(destroy_query)
 CALL(begin_query)
 CALL(end_query)




More information about the mesa-commit mailing list