Mesa (master): radeonsi: prevent a crash with DBG_CHECK_VM and u_threaded_context
Marek Olšák
mareko at kemper.freedesktop.org
Mon Jul 17 15:13:25 UTC 2017
Module: Mesa
Branch: master
Commit: 5fb80a1e84ee41dc485cc4fcb96821c92b13a427
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5fb80a1e84ee41dc485cc4fcb96821c92b13a427
Author: Marek Olšák <marek.olsak at amd.com>
Date: Sun Jul 9 23:44:57 2017 +0200
radeonsi: prevent a crash with DBG_CHECK_VM and u_threaded_context
by setting PIPE_CONTEXT_DEBUG in the caller
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/gallium/drivers/radeonsi/si_pipe.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 8a4bc41a4e..371d3372aa 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -165,9 +165,6 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
if (!sctx)
return NULL;
- if (sscreen->b.debug_flags & DBG_CHECK_VM)
- flags |= PIPE_CONTEXT_DEBUG;
-
if (flags & PIPE_CONTEXT_DEBUG)
sscreen->record_llvm_ir = true; /* racy but not critical */
@@ -378,7 +375,12 @@ static struct pipe_context *si_pipe_create_context(struct pipe_screen *screen,
void *priv, unsigned flags)
{
struct si_screen *sscreen = (struct si_screen *)screen;
- struct pipe_context *ctx = si_create_context(screen, flags);
+ struct pipe_context *ctx;
+
+ if (sscreen->b.debug_flags & DBG_CHECK_VM)
+ flags |= PIPE_CONTEXT_DEBUG;
+
+ ctx = si_create_context(screen, flags);
if (!(flags & PIPE_CONTEXT_PREFER_THREADED))
return ctx;
More information about the mesa-commit
mailing list