summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiang Yu <yuq825@gmail.com>2022-02-09 16:00:30 +0800
committerEric Engestrom <eric@engestrom.ch>2022-02-23 17:55:57 +0000
commita0a15b740070154abf12e04dafb4ed55bb1df582 (patch)
tree79536c423e929089fb710ed6e974964e7cd7fa84
parent483f8a9941efc12f4545d3edb2708cb2c3f7e0b9 (diff)
downloadmesa-a0a15b740070154abf12e04dafb4ed55bb1df582.tar.gz
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@amd.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926> (cherry picked from commit bf09c08e315280da340690aa5bdf9ea1ff738108)
-rw-r--r--.pick_status.json2
-rw-r--r--src/glx/glx_pbuffer.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 4a98a236f03..396f7b67686 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -661,7 +661,7 @@
"description": "glx: fix pbuffer refcount init",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "bc8a51a79a5fc9981fd99c0d450c08630bfb7127"
},
diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index c145ee92405..57ef0e251a0 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -199,6 +199,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;