From df28e0a082147ed4de16bb89cf974c67943fba87 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 6 Dec 2021 17:41:07 +1000 Subject: [PATCH] mesa/st: move query memory info to direct call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Acked-by: Marek Olšák Part-of: --- src/mesa/main/dd.h | 7 ------- src/mesa/main/get.c | 3 ++- src/mesa/state_tracker/st_context.c | 7 +------ src/mesa/state_tracker/st_context.h | 1 + 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index dcd07315df1..5d1e1251454 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -961,13 +961,6 @@ struct dd_function_table { const GLuint *group_size); /*@}*/ - /** - * Query information about memory. Device memory is e.g. VRAM. Staging - * memory is e.g. GART. All sizes are in kilobytes. - */ - void (*QueryMemoryInfo)(struct gl_context *ctx, - struct gl_memory_info *info); - /** * Indicate that this thread is being used by Mesa as a background drawing * thread for the given GL context. diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 91620c7a53c..0fb3d2d31da 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -44,6 +44,7 @@ #include "version.h" #include "state_tracker/st_cb_queryobj.h" +#include "state_tracker/st_context.h" /* This is a table driven implemetation of the glGet*v() functions. * The basic idea is that most getters just look up an int somewhere @@ -1240,7 +1241,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu { struct gl_memory_info info; - ctx->Driver.QueryMemoryInfo(ctx, &info); + st_query_memory_info(ctx, &info); if (d->pname == GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX) v->value_int = info.total_device_memory; diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 3fb3c496584..948cd8ca993 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -106,11 +106,7 @@ st_Enable(struct gl_context *ctx, GLenum cap) } } - -/** - * Called via ctx->Driver.QueryMemoryInfo() - */ -static void +void st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out) { struct pipe_screen *screen = st_context(ctx)->screen; @@ -963,7 +959,6 @@ st_init_driver_functions(struct pipe_screen *screen, functions->EmitStringMarker = st_emit_string_marker; functions->UpdateState = st_invalidate_state; - functions->QueryMemoryInfo = st_query_memory_info; functions->SetBackgroundContext = st_set_background_context; functions->GetDriverUuid = st_get_driver_uuid; functions->GetDeviceUuid = st_get_device_uuid; diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index c2aae6d729a..081b68aef58 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -454,6 +454,7 @@ struct st_framebuffer }; void st_Enable(struct gl_context *ctx, GLenum cap); +void st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out); #ifdef __cplusplus } #endif