mesa/st: move pin l3 cache to direct check/call.

Drop another dd.h entry

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
This commit is contained in:
Dave Airlie 2021-12-20 14:27:37 +10:00 committed by Marge Bot
parent 10ac88b72f
commit 4a055c1940
3 changed files with 4 additions and 17 deletions

View File

@ -292,8 +292,6 @@ struct dd_function_table {
struct gl_program *prog);
/*@}*/
void (*PinDriverToL3Cache)(struct gl_context *ctx, unsigned L3_cache);
GLboolean (*ValidateEGLImage)(struct gl_context *ctx, GLeglImageOES image_handle);
};

View File

@ -205,7 +205,7 @@ _mesa_glthread_flush_batch(struct gl_context *ctx)
*/
if (util_get_cpu_caps()->num_L3_caches > 1 &&
/* driver support */
ctx->Driver.PinDriverToL3Cache &&
ctx->pipe->set_context_param &&
++glthread->pin_thread_counter % 128 == 0) {
int cpu = util_get_current_cpu();
@ -215,7 +215,9 @@ _mesa_glthread_flush_batch(struct gl_context *ctx)
util_set_thread_affinity(glthread->queue.threads[0],
util_get_cpu_caps()->L3_affinity_mask[L3_cache],
NULL, util_get_cpu_caps()->num_cpu_mask_bits);
ctx->Driver.PinDriverToL3Cache(ctx, L3_cache);
ctx->pipe->set_context_param(ctx->pipe,
PIPE_CONTEXT_PARAM_PIN_THREADS_TO_L3_CACHE,
L3_cache);
}
}
}

View File

@ -822,16 +822,6 @@ st_set_background_context(struct gl_context *ctx,
smapi->set_background_context(&st->iface, queue_info);
}
static void
st_pin_driver_to_l3_cache(struct gl_context *ctx, unsigned L3_cache)
{
struct pipe_context *pipe = st_context(ctx)->pipe;
pipe->set_context_param(pipe, PIPE_CONTEXT_PARAM_PIN_THREADS_TO_L3_CACHE,
L3_cache);
}
static void
st_init_driver_functions(struct pipe_screen *screen,
struct dd_function_table *functions,
@ -885,9 +875,6 @@ st_create_context(gl_api api, struct pipe_context *pipe,
memset(&funcs, 0, sizeof(funcs));
st_init_driver_functions(pipe->screen, &funcs, has_egl_image_validate);
if (pipe->set_context_param)
funcs.PinDriverToL3Cache = st_pin_driver_to_l3_cache;
/* gl_context must be 16-byte aligned due to the alignment on GLmatrix. */
ctx = align_malloc(sizeof(struct gl_context), 16);
if (!ctx)