mesa/src/glx
Adam Jackson 768238fdc0 glx: Fix drawable refcounting for naked Windows
driFetchDrawable is only ever called from the MakeCurrent path, which
means it has to handle the case of pre-GLX-1.3 Windows being named as
the drawable. When it finds the drawable in the hash, it increments its
refcount before returning it, so for a GLXWindow it would be 2 on first
return, one from glXCreateWindow and one from glXMakeCurrent. But when
it does not find the drawable and creates one for the naked Window, the
reference count on first return would only be 1. As a result, if this
context was then ever bound to a different drawable, the old Window's
DRI drawable state (like the back buffer) would be destroyed.

Fixes piglit's glx-multi-window-single-context and glx-make-current for
a variety of drivers.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6713
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17479>
2022-07-13 12:25:30 -04:00
..
apple
tests glx: using C++11 keyword thread_local 2022-06-15 17:37:16 +00:00
windows
applegl_glx.c
clientattrib.c glx: Move __glFreeAttributeState next to its one caller 2021-09-27 09:36:44 -04:00
clientinfo.c
compsize.c
create_context.c glx/drirc: add a force_direct_glx_context option 2021-11-04 13:59:00 +01:00
dri2.c replace 0 with NULL for NULL pointers 2022-01-10 22:53:32 +00:00
dri2.h
dri2_glx.c glx: Unify dri2/dri3 vblank_mode logic. 2022-07-12 21:57:23 +00:00
dri2_priv.h
dri3_glx.c glx: Unify dri2/dri3 vblank_mode logic. 2022-07-12 21:57:23 +00:00
dri3_priv.h glx: Unify dri2/dri3 vblank_mode logic. 2022-07-12 21:57:23 +00:00
dri_common.c glx: Fix drawable refcounting for naked Windows 2022-07-13 12:25:30 -04:00
dri_common.h glx: Use the new no-error driver interface 2022-02-04 18:36:24 +00:00
dri_common_interop.c
dri_common_query_renderer.c
drisw_glx.c kopper: Respect the vblank_mode env var. 2022-07-12 21:57:23 +00:00
drisw_priv.h kopper: Respect the vblank_mode env var. 2022-07-12 21:57:23 +00:00
driwindows_glx.c glx/dri: Fix DRI drawable release at MakeCurrent time 2022-06-27 20:03:26 +00:00
eval.c
g_glxglvnddispatchfuncs.c
g_glxglvnddispatchindices.h
glx_error.c
glx_error.h
glx_pbuffer.c glx: Fix return values from __glXGetDrawableAttribute 2022-07-12 18:43:24 +00:00
glx_query.c
glxclient.h glx: Remove the remains of GLX_MESA_multithread_makecurrent 2022-07-12 10:02:46 +00:00
glxcmds.c glx: Remove excess screen parameter from CreateContext 2022-07-12 18:43:24 +00:00
glxconfig.c glx: set max values for pbuffer width / height 2022-05-17 07:21:34 +00:00
glxconfig.h glx: Fix GLX_NV_float_buffer fbconfig handling 2021-12-16 22:05:20 +00:00
glxcurrent.c glx: Remove the remains of GLX_MESA_multithread_makecurrent 2022-07-12 10:02:46 +00:00
glxext.c glx: Learn about kopper 2022-04-07 00:17:40 +00:00
glxextensions.c glx: Remove the remains of GLX_MESA_multithread_makecurrent 2022-07-12 10:02:46 +00:00
glxextensions.h glx: Remove the remains of GLX_MESA_multithread_makecurrent 2022-07-12 10:02:46 +00:00
glxglvnd.c
glxglvnd.h
glxglvnddispatchfuncs.h
glxhash.c
glxhash.h
indirect_glx.c glx: Move __glFreeAttributeState next to its one caller 2021-09-27 09:36:44 -04:00
indirect_init.h
indirect_texture_compression.c
indirect_transpose_matrix.c
indirect_vertex_array.c glx: remove a set but not used variable 2021-12-22 17:02:00 +00:00
indirect_vertex_array.h
indirect_vertex_array_priv.h
indirect_vertex_program.c
indirect_window_pos.c
meson.build
packrender.h replace 0 with NULL for NULL pointers 2022-01-10 22:53:32 +00:00
packsingle.h replace 0 with NULL for NULL pointers 2022-01-10 22:53:32 +00:00
pixel.c
pixelstore.c
query_renderer.c replace 0 with NULL for NULL pointers 2022-01-10 22:53:32 +00:00
render2.c
renderpix.c
single2.c replace 0 with NULL for NULL pointers 2022-01-10 22:53:32 +00:00
singlepix.c glapi: Remove remnants of EXT_paletted_texture and the imaging subset 2021-12-08 03:42:44 +00:00
vertarr.c
xfont.c