Mesa (main): glx: fix pbuffer refcount init

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 22 07:35:14 UTC 2022


Module: Mesa
Branch: main
Commit: bf09c08e315280da340690aa5bdf9ea1ff738108
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf09c08e315280da340690aa5bdf9ea1ff738108

Author: Qiang Yu <yuq825 at gmail.com>
Date:   Wed Feb  9 16:00:30 2022 +0800

glx: fix pbuffer refcount init

glXMakeCurrent* may miss release pbuffer if pbuffer is created
with refcount=0. This won't happen when pbuffer had different
GLX id and X pixmap id.

cc: mesa-stable

Fixes: bc8a51a79a5 ("glx: no need to create extra pixmap for pbuffer")

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Signed-off-by: Qiang Yu <yuq825 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>

---

 src/glx/glx_pbuffer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index f7d9a631377..ebd130146d4 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -202,6 +202,8 @@ CreateDRIDrawable(Display *dpy, struct glx_config *config,
 
    pdraw->textureTarget = determineTextureTarget(attrib_list, num_attribs);
    pdraw->textureFormat = determineTextureFormat(attrib_list, num_attribs);
+
+   pdraw->refcount = 1;
 #endif
 
    return GL_TRUE;



More information about the mesa-commit mailing list