From 1aa055539f32fcb3c78d908d1635bb3a3d517bc2 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 17 Nov 2020 14:39:32 -0800 Subject: [PATCH] gallium/trace: Fix helgrind complaint about one-time init Signed-off-by: Rob Clark Reviewed-by: Kristian H. Kristensen Part-of: --- src/gallium/auxiliary/driver_trace/tr_screen.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.c b/src/gallium/auxiliary/driver_trace/tr_screen.c index 56a70de894a..90ee53617a1 100644 --- a/src/gallium/auxiliary/driver_trace/tr_screen.c +++ b/src/gallium/auxiliary/driver_trace/tr_screen.c @@ -670,15 +670,11 @@ trace_screen_destroy(struct pipe_screen *_screen) bool trace_enabled(void) { - static bool firstrun = true; - - if (!firstrun) - return trace; - firstrun = false; - - if(trace_dump_trace_begin()) { - trace_dumping_start(); - trace = true; + do_once { + if(trace_dump_trace_begin()) { + trace_dumping_start(); + trace = true; + } } return trace;