From 346fae55e72f01df0a5b86845f04ce54057dc193 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 1 Aug 2024 11:13:28 -0400 Subject: [PATCH] glx: unify dri unbind context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/glx/dri2_glx.c | 8 +------- src/glx/dri3_glx.c | 8 +------- src/glx/dri_common.c | 6 ++++++ src/glx/dri_common.h | 2 ++ src/glx/drisw_glx.c | 8 +------- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 43a93a8dd41..d500f04ad3b 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -99,12 +99,6 @@ dri2_destroy_context(struct glx_context *context) free(context); } -static void -dri2_unbind_context(struct glx_context *context) -{ - driUnbindContext(context->driContext); -} - static struct glx_context * dri2_create_context_attribs(struct glx_screen *base, struct glx_config *config_base, @@ -785,7 +779,7 @@ dri2_bind_tex_image(__GLXDRIdrawable *base, static const struct glx_context_vtable dri2_context_vtable = { .destroy = dri2_destroy_context, .bind = dri_bind_context, - .unbind = dri2_unbind_context, + .unbind = dri_unbind_context, .wait_gl = dri2_wait_gl, .wait_x = dri2_wait_x, }; diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 68588a952f1..2a37d1fabbc 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -157,12 +157,6 @@ dri3_destroy_context(struct glx_context *context) free(context); } -static void -dri3_unbind_context(struct glx_context *context) -{ - driUnbindContext(context->driContext); -} - static struct glx_context * dri3_create_context_attribs(struct glx_screen *base, struct glx_config *config_base, @@ -622,7 +616,7 @@ dri3_bind_tex_image(__GLXDRIdrawable *base, static const struct glx_context_vtable dri3_context_vtable = { .destroy = dri3_destroy_context, .bind = dri_bind_context, - .unbind = dri3_unbind_context, + .unbind = dri_unbind_context, .wait_gl = dri3_wait_gl, .wait_x = dri3_wait_x, }; diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index 9a1a043b6db..c4091b69d4c 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -801,4 +801,10 @@ dri_bind_context(struct glx_context *context, GLXDrawable draw, GLXDrawable read return Success; } +void +dri_unbind_context(struct glx_context *context) +{ + driUnbindContext(context->driContext); +} + #endif /* GLX_DIRECT_RENDERING */ diff --git a/src/glx/dri_common.h b/src/glx/dri_common.h index 4d02a4eaa9a..689970211ad 100644 --- a/src/glx/dri_common.h +++ b/src/glx/dri_common.h @@ -91,6 +91,8 @@ extern const __DRIuseInvalidateExtension dri2UseInvalidate; Bool dri_bind_context(struct glx_context *context, GLXDrawable draw, GLXDrawable read); +void +dri_unbind_context(struct glx_context *context); #endif /* GLX_DIRECT_RENDERING */ #endif /* _DRI_COMMON_H */ diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 7e9559543d9..bca02015973 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -431,12 +431,6 @@ drisw_destroy_context(struct glx_context *context) free(context); } -static void -drisw_unbind_context(struct glx_context *context) -{ - driUnbindContext(context->driContext); -} - static void drisw_wait_gl(struct glx_context *context) { @@ -474,7 +468,7 @@ kopper_get_buffer_age(__GLXDRIdrawable *pdraw) static const struct glx_context_vtable drisw_context_vtable = { .destroy = drisw_destroy_context, .bind = dri_bind_context, - .unbind = drisw_unbind_context, + .unbind = dri_unbind_context, .wait_gl = drisw_wait_gl, .wait_x = drisw_wait_x, };