From fde1afc4956d273f8684de5f1d4b8a28aabeb14c Mon Sep 17 00:00:00 2001 From: Andres Rodriguez Date: Thu, 26 Oct 2017 19:16:51 -0400 Subject: u_threaded_context: add support for fence_server_signal v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2: s/semaphore/fence Signed-off-by: Andres Rodriguez Reviewed-by: Marek Olšák --- src/gallium/auxiliary/util/u_threaded_context.c | 20 ++++++++++++++++++++ .../auxiliary/util/u_threaded_context_calls.h | 1 + 2 files changed, 21 insertions(+) (limited to 'src/gallium') diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 3ea1797a9ef..1c647a3efd0 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 675deaabd92..921b86a67f0 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) -- cgit v1.2.3