u_threaded_context: add support for fence_server_signal v2
authorAndres Rodriguez <andresx7@gmail.com>
Thu, 26 Oct 2017 23:16:51 +0000 (19:16 -0400)
committerAndres Rodriguez <andresx7@gmail.com>
Tue, 30 Jan 2018 20:13:49 +0000 (15:13 -0500)
v2: s/semaphore/fence

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_threaded_context.c
src/gallium/auxiliary/util/u_threaded_context_calls.h

index 3ea1797a9ef68e1721c1655b2af999501c2d6cb3..1c647a3efd0a11cb5834430fb547e17026ec5285 100644 (file)
@@ -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);
index 675deaabd92530407debe7ede9e110101a5e0623..921b86a67f0e5d157c978f0b0a8211e720c2dad3 100644 (file)
@@ -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)