zink: don't pin flush queue threads if no threads exist

Fixes: 270f9c0b06 ("zink: add ZINK_DEBUG=flushsync")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22611>
(cherry picked from commit e4c4fca16e)
This commit is contained in:
Mike Blumenkrantz 2023-04-20 13:21:28 -04:00 committed by Eric Engestrom
parent 834a080732
commit a59f776b74
2 changed files with 6 additions and 4 deletions

View file

@ -139,7 +139,7 @@
"description": "zink: don't pin flush queue threads if no threads exist",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "270f9c0b0636bc0c7954f32e2b5920ec76f839e5"
},

View file

@ -271,12 +271,14 @@ zink_set_context_param(struct pipe_context *pctx, enum pipe_context_param param,
unsigned value)
{
struct zink_context *ctx = zink_context(pctx);
struct zink_screen *screen = zink_screen(ctx->base.screen);
switch (param) {
case PIPE_CONTEXT_PARAM_PIN_THREADS_TO_L3_CACHE:
util_set_thread_affinity(zink_screen(ctx->base.screen)->flush_queue.threads[0],
util_get_cpu_caps()->L3_affinity_mask[value],
NULL, util_get_cpu_caps()->num_cpu_mask_bits);
if (screen->threaded_submit)
util_set_thread_affinity(screen->flush_queue.threads[0],
util_get_cpu_caps()->L3_affinity_mask[value],
NULL, util_get_cpu_caps()->num_cpu_mask_bits);
break;
default:
break;