From 585daa237807ad4bc8ce3bf40610113333a529de Mon Sep 17 00:00:00 2001 From: Andres Rodriguez Date: Mon, 4 Dec 2017 15:27:08 -0500 Subject: gallium: add type parameter to create_fence_fd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An fd can potentially have different types of objects backing it. Specifying the type helps us make sure we treat the FD correctly. This is in preparation to allow importing syncobj fence FDs in addition to native sync FDs. Signed-off-by: Andres Rodriguez Reviewed-by: Marek Olšák --- src/gallium/auxiliary/util/u_tests.c | 7 ++++--- src/gallium/auxiliary/util/u_threaded_context.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/gallium/auxiliary') diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c index cb337a255ae..e8599e32031 100644 --- a/src/gallium/auxiliary/util/u_tests.c +++ b/src/gallium/auxiliary/util/u_tests.c @@ -502,6 +502,7 @@ test_sync_file_fences(struct pipe_context *ctx) { struct pipe_screen *screen = ctx->screen; bool pass = true; + enum pipe_fd_type fd_type = PIPE_FD_TYPE_NATIVE_SYNC; if (!screen->get_param(screen, PIPE_CAP_NATIVE_FENCE_FD)) return; @@ -536,9 +537,9 @@ test_sync_file_fences(struct pipe_context *ctx) /* (Re)import all fences. */ struct pipe_fence_handle *re_buf_fence = NULL, *re_tex_fence = NULL; struct pipe_fence_handle *merged_fence = NULL; - ctx->create_fence_fd(ctx, &re_buf_fence, buf_fd); - ctx->create_fence_fd(ctx, &re_tex_fence, tex_fd); - ctx->create_fence_fd(ctx, &merged_fence, merged_fd); + ctx->create_fence_fd(ctx, &re_buf_fence, buf_fd, fd_type); + ctx->create_fence_fd(ctx, &re_tex_fence, tex_fd, fd_type); + ctx->create_fence_fd(ctx, &merged_fence, merged_fd, fd_type); pass = pass && re_buf_fence && re_tex_fence && merged_fence; /* Run another clear after waiting for everything. */ diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index ffa824744e5..3ea1797a9ef 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -1835,13 +1835,14 @@ tc_set_log_context(struct pipe_context *_pipe, struct u_log_context *log) static void tc_create_fence_fd(struct pipe_context *_pipe, - struct pipe_fence_handle **fence, int fd) + struct pipe_fence_handle **fence, int fd, + enum pipe_fd_type type) { struct threaded_context *tc = threaded_context(_pipe); struct pipe_context *pipe = tc->pipe; tc_sync(tc); - pipe->create_fence_fd(pipe, fence, fd); + pipe->create_fence_fd(pipe, fence, fd, type); } static void -- cgit v1.2.3