Mesa (main): gallium/dri: Remove the memory of GLX_MESA_multithread_makecurrent
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 12 10:47:45 UTC 2022
Module: Mesa
Branch: main
Commit: 4fbc237cae0e1c3e685345f888862309f6cbd6a8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4fbc237cae0e1c3e685345f888862309f6cbd6a8
Author: Adam Jackson <ajax at redhat.com>
Date: Mon Jul 11 16:24:36 2022 -0400
gallium/dri: Remove the memory of GLX_MESA_multithread_makecurrent
The only way this could happen was if GLX did it, which it doesn't.
Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17473>
---
src/gallium/frontends/dri/dri_context.c | 18 +++++++-----------
src/gallium/frontends/dri/dri_context.h | 2 --
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/gallium/frontends/dri/dri_context.c b/src/gallium/frontends/dri/dri_context.c
index c32e795f681..3a98eb2496a 100644
--- a/src/gallium/frontends/dri/dri_context.c
+++ b/src/gallium/frontends/dri/dri_context.c
@@ -265,17 +265,15 @@ dri_unbind_context(__DRIcontext * cPriv)
struct st_context_iface *st = ctx->st;
struct st_api *stapi = screen->st_api;
- if (--ctx->bind_count == 0) {
- if (st == stapi->get_current(stapi)) {
- if (st->thread_finish)
- st->thread_finish(st);
+ if (st == stapi->get_current(stapi)) {
+ if (st->thread_finish)
+ st->thread_finish(st);
- /* Record HUD queries for the duration the context was "current". */
- if (ctx->hud)
- hud_record_only(ctx->hud, st->pipe);
+ /* Record HUD queries for the duration the context was "current". */
+ if (ctx->hud)
+ hud_record_only(ctx->hud, st->pipe);
- stapi->make_current(stapi, NULL, NULL, NULL);
- }
+ stapi->make_current(stapi, NULL, NULL, NULL);
}
ctx->dPriv = NULL;
ctx->rPriv = NULL;
@@ -293,8 +291,6 @@ dri_make_current(__DRIcontext * cPriv,
struct dri_drawable *draw = dri_drawable(driDrawPriv);
struct dri_drawable *read = dri_drawable(driReadPriv);
- ++ctx->bind_count;
-
if (!draw && !read)
return ctx->stapi->make_current(ctx->stapi, ctx->st, NULL, NULL);
else if (!draw || !read)
diff --git a/src/gallium/frontends/dri/dri_context.h b/src/gallium/frontends/dri/dri_context.h
index 4b2b045092c..561be68927c 100644
--- a/src/gallium/frontends/dri/dri_context.h
+++ b/src/gallium/frontends/dri/dri_context.h
@@ -50,8 +50,6 @@ struct dri_context
__DRIdrawable *dPriv;
__DRIdrawable *rPriv;
- unsigned int bind_count;
-
/**
* True if the __DRIdrawable's current __DRIimageBufferMask is
* __DRI_IMAGE_BUFFER_SHARED.
More information about the mesa-commit
mailing list