Mesa (main): mesa/st: move pin l3 cache to direct check/call.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 21 01:47:16 UTC 2022


Module: Mesa
Branch: main
Commit: 4a055c1940806d8124d6d01536d7d7d4a3b69de5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4a055c1940806d8124d6d01536d7d7d4a3b69de5

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Dec 20 14:27:37 2021 +1000

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

Drop another dd.h entry

Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

---

 src/mesa/main/dd.h                  |  2 --
 src/mesa/main/glthread.c            |  6 ++++--
 src/mesa/state_tracker/st_context.c | 13 -------------
 3 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index f6e47790c3b..b13515cd4f8 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -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);
 };
 
diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c
index 8eb1b7df901..66436fa0c58 100644
--- a/src/mesa/main/glthread.c
+++ b/src/mesa/main/glthread.c
@@ -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);
          }
       }
    }
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index eb304a2b79c..ac0a22d031f 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -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)



More information about the mesa-commit mailing list