mesa/st: move some context functions to direct calls

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14100>
This commit is contained in:
Dave Airlie 2021-12-07 11:42:56 +10:00 committed by Marge Bot
parent cb400f368a
commit ce9a50e6f8
5 changed files with 13 additions and 47 deletions

View file

@ -528,25 +528,6 @@ struct dd_function_table {
const GLuint *group_size);
/*@}*/
/**
* Indicate that this thread is being used by Mesa as a background drawing
* thread for the given GL context.
*
* If this function is called more than once from any given thread, each
* subsequent call overrides the context that was passed in the previous
* call. Mesa takes advantage of this to re-use a background thread to
* perform drawing on behalf of multiple contexts.
*
* Mesa may sometimes call this function from a non-background thread
* (i.e. a thread that has already been bound to a context using
* __DriverAPIRec::MakeCurrent()); when this happens, ctx will be equal to
* the context that is bound to this thread.
*
* Mesa will only call this function if GL multithreading is enabled.
*/
void (*SetBackgroundContext)(struct gl_context *ctx,
struct util_queue_monitoring *queue_info);
/**
* \name GL_ARB_sparse_buffer interface
*/
@ -568,23 +549,6 @@ struct dd_function_table {
GLenum usage,
struct gl_buffer_object *bufObj);
/**
* Fill uuid with an unique identifier for this driver
*
* uuid must point to GL_UUID_SIZE_EXT bytes of available memory
*/
void (*GetDriverUuid)(struct gl_context *ctx, char *uuid);
/**
* Fill uuid with an unique identifier for the device associated
* to this driver
*
* uuid must point to GL_UUID_SIZE_EXT bytes of available memory
*/
void (*GetDeviceUuid)(struct gl_context *ctx, char *uuid);
/*@}*/
/**
* \name GL_ARB_get_program_binary
*/

View file

@ -40,6 +40,7 @@
#include "util/u_thread.h"
#include "util/u_cpu_detect.h"
#include "state_tracker/st_context.h"
static void
glthread_unmarshal_batch(void *job, void *gdata, int thread_index)
@ -84,7 +85,7 @@ glthread_thread_initialization(void *job, void *gdata, int thread_index)
{
struct gl_context *ctx = (struct gl_context*)job;
ctx->Driver.SetBackgroundContext(ctx, &ctx->GLThread.stats);
st_set_background_context(ctx, &ctx->GLThread.stats);
_glapi_set_context(ctx);
}

View file

@ -34,6 +34,8 @@
#include "version.h"
#include "git_sha1.h"
#include "state_tracker/st_context.h"
static simple_mtx_t override_lock = _SIMPLE_MTX_INITIALIZER_NP;
/**
@ -726,13 +728,13 @@ done:
void
_mesa_get_driver_uuid(struct gl_context *ctx, GLint *uuid)
{
ctx->Driver.GetDriverUuid(ctx, (char*) uuid);
st_get_driver_uuid(ctx, (char*) uuid);
}
void
_mesa_get_device_uuid(struct gl_context *ctx, GLint *uuid)
{
ctx->Driver.GetDeviceUuid(ctx, (char*) uuid);
st_get_device_uuid(ctx, (char*) uuid);
}
/**

View file

@ -872,7 +872,7 @@ st_emit_string_marker(struct gl_context *ctx, const GLchar *string, GLsizei len)
}
static void
void
st_set_background_context(struct gl_context *ctx,
struct util_queue_monitoring *queue_info)
{
@ -885,7 +885,7 @@ st_set_background_context(struct gl_context *ctx,
}
static void
void
st_get_device_uuid(struct gl_context *ctx, char *uuid)
{
struct pipe_screen *screen = st_context(ctx)->screen;
@ -896,7 +896,7 @@ st_get_device_uuid(struct gl_context *ctx, char *uuid)
}
static void
void
st_get_driver_uuid(struct gl_context *ctx, char *uuid)
{
struct pipe_screen *screen = st_context(ctx)->screen;
@ -942,10 +942,6 @@ st_init_driver_functions(struct pipe_screen *screen,
if (screen->get_param(screen, PIPE_CAP_STRING_MARKER))
functions->EmitStringMarker = st_emit_string_marker;
functions->SetBackgroundContext = st_set_background_context;
functions->GetDriverUuid = st_get_driver_uuid;
functions->GetDeviceUuid = st_get_device_uuid;
/* GL_ARB_get_program_binary */
functions->GetProgramBinaryDriverSHA1 = st_get_program_binary_driver_sha1;

View file

@ -457,7 +457,10 @@ void st_Enable(struct gl_context *ctx, GLenum cap);
void st_query_memory_info(struct gl_context *ctx, struct gl_memory_info *out);
void st_invalidate_state(struct gl_context *ctx);
void st_get_driver_uuid(struct gl_context *ctx, char *uuid);
void st_get_device_uuid(struct gl_context *ctx, char *uuid);
void st_set_background_context(struct gl_context *ctx,
struct util_queue_monitoring *queue_info);
#ifdef __cplusplus
}
#endif