summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorAlexandros Frantzis <[email protected]>2014-10-24 03:03:13 -0700
committerTapani Pälli <[email protected]>2014-11-06 13:40:39 +0200
commitf53b6d0134d9ad66e8ec3d7c09daaba8192834be (patch)
treeb5ae4ae2220d56149a5da39e5e47a16dc865b4dd /src/mesa/drivers
parentcd745d46ce7ee9adc95c903670dd11cf3443e7a1 (diff)
Releasing a surfaceless EGL context doesn't release underlying DRI context.
driUnbindContext() checks for valid drawables before calling the driver unbind function. In case of Surfaceless contexts, the drawables are always Null and we end up not releasing the underlying DRI context. Moving the call to the driver function before the drawable validity checks fixes things. Steps to trigger this bug are following: - create surfaceless context and make it current - make some other context current - {another thread} destroy surfaceless context - make another context current Signed-off-by: Alexandros Frantzis <[email protected]> Signed-off-by: Kalyan Kondapally <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74563
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 6c78928ee7d..02499f2daec 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -569,6 +569,12 @@ static int driUnbindContext(__DRIcontext *pcp)
if (pcp == NULL)
return GL_FALSE;
+ /*
+ ** Call driUnbindContext before checking for valid drawables
+ ** to handle surfaceless contexts properly.
+ */
+ pcp->driScreenPriv->driver->UnbindContext(pcp);
+
pdp = pcp->driDrawablePriv;
prp = pcp->driReadablePriv;
@@ -576,8 +582,6 @@ static int driUnbindContext(__DRIcontext *pcp)
if (!pdp && !prp)
return GL_TRUE;
- pcp->driScreenPriv->driver->UnbindContext(pcp);
-
assert(pdp);
if (pdp->refcount == 0) {
/* ERROR!!! */