[Mesa-dev] [PATCH 07/22] u_threaded_context: add support for semaphore_server_signal

Andres Rodriguez andresx7 at gmail.com
Fri Dec 22 00:41:42 UTC 2017


Signed-off-by: Andres Rodriguez <andresx7 at gmail.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 ab37055..b34c93a 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -1864,6 +1864,25 @@ tc_semaphore_server_sync(struct pipe_context *_pipe,
    screen->semaphore_reference(screen, &payload->fence, fence);
 }
 
+static void
+tc_call_semaphore_server_signal(struct pipe_context *pipe, union tc_payload *payload)
+{
+   pipe->semaphore_server_signal(pipe, payload->fence);
+   pipe->screen->semaphore_reference(pipe->screen, &payload->fence, NULL);
+}
+
+static void
+tc_semaphore_server_signal(struct pipe_context *_pipe,
+                           struct pipe_semaphore_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_semaphore_server_signal);
+
+   payload->fence = NULL;
+   screen->semaphore_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_semaphore_fd);
    CTX_INIT(semaphore_server_sync);
+   CTX_INIT(semaphore_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 f5e90fd..9187485 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(semaphore_server_sync)
+CALL(semaphore_server_signal)
 CALL(destroy_query)
 CALL(begin_query)
 CALL(end_query)
-- 
2.9.3



More information about the mesa-dev mailing list