Mesa (staging/19.1): intel/dri: finish proper glthread

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 6 10:41:21 UTC 2019


Module: Mesa
Branch: staging/19.1
Commit: 48f78dfce28f6a9d2449302ce5d29ecd36feee48
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=48f78dfce28f6a9d2449302ce5d29ecd36feee48

Author: Sergii Romantsov <sergii.romantsov at globallogic.com>
Date:   Wed Jun  5 14:33:58 2019 +0300

intel/dri: finish proper glthread

KWin was able to get NULL-context in the call
intelUnbindContext. But a call _mesa_glthread_finish
is not resistent to such case.
Case can be catched with steps:
	1. Create both glx and egl contexts
	2. Make glx as current
	3. Make egl as current
	4. Reset glx context
	5. Make egl as current

Solution adds proper finishing of glthread-context
(context will be taken from the requested dri-context
for unbinding, but not from the saved current context).

Piglit-test: https://gitlab.freedesktop.org/mesa/piglit/merge_requests/87

Cc: 19.1 19.2 <mesa-stable at lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110814
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111271
Fixes: dca36d5516d0 (i965: Implement threaded GL support)
Signed-off-by: Sergii Romantsov <sergii.romantsov at globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit 1dce75c1839f08cfa78400367019f998c258eff5)

---

 src/mesa/drivers/dri/i965/brw_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index f6cf82d6694..e0858eb58a7 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -1228,7 +1228,7 @@ intelDestroyContext(__DRIcontext * driContextPriv)
 GLboolean
 intelUnbindContext(__DRIcontext * driContextPriv)
 {
-   GET_CURRENT_CONTEXT(ctx);
+   struct gl_context *ctx = driContextPriv->driverPrivate;
    _mesa_glthread_finish(ctx);
 
    /* Unset current context and dispath table */




More information about the mesa-commit mailing list