wgl: Split DrvReleaseContext to support unbind via pointer

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Acked-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12727>
This commit is contained in:
Jesse Natalie 2021-09-04 07:56:23 -07:00 committed by Marge Bot
parent c4806ae03c
commit 49d83de072
2 changed files with 19 additions and 12 deletions

View file

@ -360,19 +360,9 @@ DrvDeleteContext(DHGLRC dhglrc)
return ret;
}
BOOL APIENTRY
DrvReleaseContext(DHGLRC dhglrc)
BOOL
stw_unbind_context(struct stw_context *ctx)
{
struct stw_context *ctx;
if (!stw_dev)
return FALSE;
stw_lock_contexts(stw_dev);
ctx = stw_lookup_context_locked( dhglrc );
stw_unlock_contexts(stw_dev);
if (!ctx)
return FALSE;
@ -389,6 +379,21 @@ DrvReleaseContext(DHGLRC dhglrc)
return TRUE;
}
BOOL APIENTRY
DrvReleaseContext(DHGLRC dhglrc)
{
struct stw_context *ctx;
if (!stw_dev)
return FALSE;
stw_lock_contexts(stw_dev);
ctx = stw_lookup_context_locked( dhglrc );
stw_unlock_contexts(stw_dev);
return stw_unbind_context(ctx);
}
DHGLRC
stw_get_current_context( void )

View file

@ -58,6 +58,8 @@ DHGLRC stw_create_context_handle(struct stw_context *context, DHGLRC handle);
void stw_destroy_context(struct stw_context *);
BOOL stw_unbind_context(struct stw_context *);
DHGLRC stw_get_current_context( void );
struct stw_context *stw_current_context(void);