diff options
author | Marek Olšák <[email protected]> | 2020-03-22 14:07:03 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-03-30 23:57:49 -0400 |
commit | 4df3c7a2079bc6d11149fa42ff0ca27ea70a7942 (patch) | |
tree | 5eb63be01fc453dab54f27731523f6faf743ce8a | |
parent | 4de35bed423a9e4204498b83b5be7f16399363bc (diff) |
gallium/u_threaded: call the driver to pin threads to L3 immediately
This is thread-safe and we want it to be done immediately for good L3 cache
usage.
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4369>
-rw-r--r-- | src/gallium/auxiliary/util/u_threaded_context.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 63ca61bb249..66e05fb1772 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -1936,6 +1936,20 @@ tc_set_context_param(struct pipe_context *_pipe, { struct threaded_context *tc = threaded_context(_pipe); + if (param == PIPE_CONTEXT_PARAM_PIN_THREADS_TO_L3_CACHE) { + /* Pin the gallium thread as requested. */ + util_pin_thread_to_L3(tc->queue.threads[0], value, + util_cpu_caps.cores_per_L3); + + /* Execute this immediately (without enqueuing). + * It's required to be thread-safe. + */ + struct pipe_context *pipe = tc->pipe; + if (pipe->set_context_param) + pipe->set_context_param(pipe, param, value); + return; + } + if (tc->pipe->set_context_param) { struct tc_context_param *payload = tc_add_struct_typed_call(tc, TC_CALL_set_context_param, @@ -1944,12 +1958,6 @@ tc_set_context_param(struct pipe_context *_pipe, payload->param = param; payload->value = value; } - - if (param == PIPE_CONTEXT_PARAM_PIN_THREADS_TO_L3_CACHE) { - /* Pin the gallium thread as requested. */ - util_pin_thread_to_L3(tc->queue.threads[0], value, - util_cpu_caps.cores_per_L3); - } } |