Module: Mesa Branch: staging/21.3 Commit: e4227e12a7630f86f0391a73274ab92420c0eb23 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e4227e12a7630f86f0391a73274ab92420c0eb23
Author: Qiang Yu <[email protected]> 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 <[email protected]> Signed-off-by: Qiang Yu <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926> (cherry picked from commit bf09c08e315280da340690aa5bdf9ea1ff738108) --- .pick_status.json | 2 +- src/glx/glx_pbuffer.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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;
