From 0122a67c81417c3f1041a658b5b2507d3ceb3a3b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 27 Nov 2022 14:40:28 -0500 Subject: [PATCH] gallium: move st function declarations from api.h into st_context.h Reviewed-by: Emma Anholt Reviewed-by: Adam Jackson Reviewed-by: Yonggang Luo Part-of: --- src/gallium/include/frontend/api.h | 51 ------------------------------------- src/mesa/state_tracker/st_context.h | 26 +++++++++++++++++++ src/mesa/state_tracker/st_manager.c | 15 +++++++++++ 3 files changed, 41 insertions(+), 51 deletions(-) diff --git a/src/gallium/include/frontend/api.h b/src/gallium/include/frontend/api.h index 4f99cfb..eda81a5 100644 --- a/src/gallium/include/frontend/api.h +++ b/src/gallium/include/frontend/api.h @@ -406,55 +406,4 @@ struct pipe_frontend_screen void *st_manager_private; }; -/** - * The following st_api_* functions represent the OpenGL rendering API. - * - * Implemented by the gallium frontend and used by the frontend manager. - */ - -/** - * Query supported OpenGL versions. (if applicable) - * The format is (major*10+minor). - */ -void -st_api_query_versions(struct pipe_frontend_screen *fscreen, - struct st_config_options *options, - int *gl_core_version, - int *gl_compat_version, - int *gl_es1_version, - int *gl_es2_version); - -/** - * Create a rendering context. - */ -struct st_context * -st_api_create_context(struct pipe_frontend_screen *fscreen, - const struct st_context_attribs *attribs, - enum st_context_error *error, - struct st_context *shared_ctx); - -/** - * Bind the context to the calling thread with draw and read as drawables. - * - * The framebuffers might be NULL, or might have different visuals than the - * context does. - */ -bool -st_api_make_current(struct st_context *st, - struct st_framebuffer_iface *stdrawi, - struct st_framebuffer_iface *streadi); - -/** - * Get the currently bound context in the calling thread. - */ -struct st_context * -st_api_get_current(void); - -/** - * Notify the st manager the framebuffer interface object - * is no longer valid. - */ -void -st_api_destroy_drawable(struct st_framebuffer_iface *stfbi); - #endif /* _API_H_ */ diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 3185de0..b3c3ef4 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -453,6 +453,32 @@ st_get_nir_compiler_options(struct st_context *st, gl_shader_stage stage); void st_invalidate_state(struct gl_context *ctx); void st_set_background_context(struct gl_context *ctx, struct util_queue_monitoring *queue_info); + +void +st_api_query_versions(struct pipe_frontend_screen *fscreen, + struct st_config_options *options, + int *gl_core_version, + int *gl_compat_version, + int *gl_es1_version, + int *gl_es2_version); + +struct st_context * +st_api_create_context(struct pipe_frontend_screen *fscreen, + const struct st_context_attribs *attribs, + enum st_context_error *error, + struct st_context *shared_ctx); + +bool +st_api_make_current(struct st_context *st, + struct st_framebuffer_iface *stdrawi, + struct st_framebuffer_iface *streadi); + +struct st_context * +st_api_get_current(void); + +void +st_api_destroy_drawable(struct st_framebuffer_iface *stfbi); + #ifdef __cplusplus } #endif diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index edee3ff..28b370c 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -931,6 +931,9 @@ st_manager_destroy(struct pipe_frontend_screen *fscreen) } +/** + * Create a rendering context. + */ struct st_context * st_api_create_context(struct pipe_frontend_screen *fscreen, const struct st_context_attribs *attribs, @@ -1071,6 +1074,9 @@ st_api_create_context(struct pipe_frontend_screen *fscreen, } +/** + * Get the currently bound context in the calling thread. + */ struct st_context * st_api_get_current(void) { @@ -1124,6 +1130,11 @@ st_framebuffer_reuse_or_create(struct st_context *st, } +/** + * Bind the context to the calling thread with draw and read as drawables. + * + * The framebuffers might be NULL, meaning the context is surfaceless. + */ bool st_api_make_current(struct st_context *st, struct st_framebuffer_iface *stdrawi, @@ -1350,6 +1361,10 @@ get_version(struct pipe_screen *screen, } +/** + * Query supported OpenGL versions. (if applicable) + * The format is (major*10+minor). + */ void st_api_query_versions(struct pipe_frontend_screen *fscreen, struct st_config_options *options, -- 2.7.4