gallium/u_threaded: add an option for unsychronized create_fence_fd

And enable it for radeonsi. This may be needed by Android.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18731>
This commit is contained in:
Marek Olšák
2022-09-21 16:12:25 -04:00
committed by Marge Bot
parent 21ba47c821
commit 4d44399c2e
4 changed files with 8 additions and 1 deletions
@@ -2961,7 +2961,9 @@ tc_create_fence_fd(struct pipe_context *_pipe,
struct threaded_context *tc = threaded_context(_pipe);
struct pipe_context *pipe = tc->pipe;
tc_sync(tc);
if (!tc->options.unsynchronized_create_fence_fd)
tc_sync(tc);
pipe->create_fence_fd(pipe, fence, fd, type);
}
@@ -465,6 +465,9 @@ struct threaded_context_options {
* safe to call without synchronizing with driver thread.
*/
bool unsynchronized_get_device_reset_status;
/* If true, create_fence_fd doesn't access the context in the driver. */
bool unsynchronized_create_fence_fd;
};
struct threaded_context {
@@ -701,6 +701,7 @@ fd_context_init_tc(struct pipe_context *pctx, unsigned flags)
.create_fence = fd_fence_create_unflushed,
.is_resource_busy = fd_resource_busy,
.unsynchronized_get_device_reset_status = true,
.unsynchronized_create_fence_fd = true,
},
&ctx->tc);
+1
View File
@@ -915,6 +915,7 @@ static struct pipe_context *si_pipe_create_context(struct pipe_screen *screen, v
si_create_fence : NULL,
.is_resource_busy = si_is_resource_busy,
.driver_calls_flush_notify = true,
.unsynchronized_create_fence_fd = true,
},
&((struct si_context *)ctx)->tc);