mesa/st: move memory query into mesa.

Drop the gl_memory_info type as it's equiv to the pipe one, and
internal

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:14:45 +10:00
committed by Marge Bot
parent 6e99b10632
commit 8467047f6d
4 changed files with 4 additions and 38 deletions
+4 -2
View File
@@ -1247,9 +1247,11 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
case GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX:
case GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX:
{
struct gl_memory_info info;
struct pipe_memory_info info;
struct pipe_screen *screen = ctx->pipe->screen;
st_query_memory_info(ctx, &info);
assert(screen->query_memory_info);
screen->query_memory_info(screen, &info);
if (d->pname == GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX)
v->value_int = info.total_device_memory;
-13
View File
@@ -3586,19 +3586,6 @@ struct gl_context
bool shader_builtin_ref;
};
/**
* Information about memory usage. All sizes are in kilobytes.
*/
struct gl_memory_info
{
unsigned total_device_memory; /**< size of device memory, e.g. VRAM */
unsigned avail_device_memory; /**< free device memory at the moment */
unsigned total_staging_memory; /**< size of staging memory, e.g. GART */
unsigned avail_staging_memory; /**< free staging memory at the moment */
unsigned device_memory_evicted; /**< size of memory evicted (monotonic counter) */
unsigned nr_device_memory_evictions; /**< # of evictions (monotonic counter) */
};
#ifndef NDEBUG
extern int MESA_VERBOSE;
extern int MESA_DEBUG_FLAGS;
-21
View File
@@ -71,27 +71,6 @@
DEBUG_GET_ONCE_BOOL_OPTION(mesa_mvp_dp4, "MESA_MVP_DP4", FALSE)
void
st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out)
{
struct pipe_screen *screen = st_context(ctx)->screen;
struct pipe_memory_info info;
assert(screen->query_memory_info);
if (!screen->query_memory_info)
return;
screen->query_memory_info(screen, &info);
out->total_device_memory = info.total_device_memory;
out->avail_device_memory = info.avail_device_memory;
out->total_staging_memory = info.total_staging_memory;
out->avail_staging_memory = info.avail_staging_memory;
out->device_memory_evicted = info.device_memory_evicted;
out->nr_device_memory_evictions = info.nr_device_memory_evictions;
}
static uint64_t
st_get_active_states(struct gl_context *ctx)
{
-2
View File
@@ -450,8 +450,6 @@ struct st_framebuffer
struct list_head head;
};
void st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out);
void st_invalidate_state(struct gl_context *ctx);
void st_set_background_context(struct gl_context *ctx,
struct util_queue_monitoring *queue_info);