On Wed, Nov 16, 2016 at 10:23 PM, Tom Stellard <thomas.stell...@amd.com> wrote: > cd724208d3e1e3307f84a794f2c1fc83b69ccf8a added a call to > _mesa_lock_debug_state(ctx) but wasn't unlocking the debug state. > > This fixes a hang in glsl-fs-loop piglit test with MESA_DEBUG=context. > --- > src/gallium/drivers/radeonsi/si_pipe.c | 8 +++++--- > src/mesa/main/debug_output.c | 5 +++-- > 2 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/src/gallium/drivers/radeonsi/si_pipe.c > b/src/gallium/drivers/radeonsi/si_pipe.c > index 1737e23..b086f0e 100644 > --- a/src/gallium/drivers/radeonsi/si_pipe.c > +++ b/src/gallium/drivers/radeonsi/si_pipe.c > @@ -128,9 +128,11 @@ si_create_llvm_target_machine(struct si_screen *sscreen) > { > const char *triple = "amdgcn--"; > > - if (sscreen->b.debug_flags & DBG_GLOBAL_ISEL) { > - const char *options[1] = {"-global-isel"}; > - LLVMParseCommandLineOptions(1, options, NULL); > + static bool cl_set = false; > + if (!cl_set && sscreen->b.debug_flags & DBG_GLOBAL_ISEL) { > + const char *options[4] = {"radeonsi", > "-global-isel","-global-isel-abort=2", "-debug-only=instruction-select"}; > + LLVMParseCommandLineOptions(3, options, NULL); > + cl_set = true;
Unrelated change. > } > > return LLVMCreateTargetMachine(si_llvm_get_amdgpu_target(triple), > triple, > diff --git a/src/mesa/main/debug_output.c b/src/mesa/main/debug_output.c > index 4e9209b..b3d9398 100644 > --- a/src/mesa/main/debug_output.c > +++ b/src/mesa/main/debug_output.c > @@ -1282,15 +1282,16 @@ _mesa_init_debug_output(struct gl_context *ctx) > */ > struct gl_debug_state *debug = _mesa_lock_debug_state(ctx); > if (!debug) { > - return; > + goto done; > } > debug->DebugOutput = GL_TRUE; > debug->LogToStderr = GL_TRUE; > ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_DEBUG_BIT; > } > +done: > + _mesa_unlock_debug_state(ctx); > } This part is: Reviewed-by: Marek Olšák <marek.ol...@amd.com> Marek _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev