summaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi/gen
diff options
context:
space:
mode:
authorGregory Hainaut <[email protected]>2017-02-12 15:21:47 +0100
committerTimothy Arceri <[email protected]>2017-03-16 14:14:19 +1100
commit93bdad3253cfa353cadf4444711c70f39e9baf09 (patch)
tree5cc6ae9e3bf0b7df89f61d5b0eda3a97da8b1352 /src/mapi/glapi/gen
parent70e715eea618f31a1b84a99b063c371af3513754 (diff)
mesa/glthread: restore the dispatch table when incompatible gl calls are detected
While a context only has a single glthread, the context itself can be attached to several threads. Therefore the dispatch table must be updated in all threads before the destruction of glthread. In others words, glthread can only be destroyed safely when the context is deleted. Fixes remaining crashes in the glx-multithread-makecurrent* tests. V2: (Timothy Arceri) updated gl_API.dtd marshal_fail description. Signed-off-by: Gregory Hainaut <[email protected]> Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
Diffstat (limited to 'src/mapi/glapi/gen')
-rw-r--r--src/mapi/glapi/gen/gl_API.dtd6
-rw-r--r--src/mapi/glapi/gen/gl_marshal.py3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mapi/glapi/gen/gl_API.dtd b/src/mapi/glapi/gen/gl_API.dtd
index dc4a199bb99..b464250777c 100644
--- a/src/mapi/glapi/gen/gl_API.dtd
+++ b/src/mapi/glapi/gen/gl_API.dtd
@@ -131,9 +131,9 @@ param:
If "draw", it will follow the "async" rules except that "indices" are
ignored (since they may come from a VBO).
marshal_fail - an expression that, if it evaluates true, causes glthread
- to finish and tear down before the Mesa implementation is called
- directly. Used to disable glthread for GL compatibility interactions
- that we don't want to track state for.
+ to switch back to the Mesa implementation and call it directly. Used
+ to disable glthread for GL compatibility interactions that we don't
+ want to track state for.
glx:
rop - Opcode value for "render" commands
diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py
index 165275904ff..d73f08b6684 100644
--- a/src/mapi/glapi/gen/gl_marshal.py
+++ b/src/mapi/glapi/gen/gl_marshal.py
@@ -239,7 +239,8 @@ class PrintCode(gl_XML.gl_print_base):
if func.marshal_fail:
out('if ({0}) {{'.format(func.marshal_fail))
with indent():
- out('_mesa_glthread_destroy(ctx);')
+ out('_mesa_glthread_finish(ctx);')
+ out('_mesa_glthread_restore_dispatch(ctx);')
self.print_sync_dispatch(func)
out('return;')
out('}')