Mesa (master): Revert "gallium/trace: Fix helgrind complaint about one-time init"

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 25 10:06:38 UTC 2020


Module: Mesa
Branch: master
Commit: 1f6e03c3bf51b2ba8cd7f22c069a962beada7f13
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1f6e03c3bf51b2ba8cd7f22c069a962beada7f13

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Tue Nov 24 23:33:14 2020 +0100

Revert "gallium/trace: Fix helgrind complaint about one-time init"

This reverts commit 1aa055539f32fcb3c78d908d1635bb3a3d517bc2.

Acked-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7760>

---

 src/gallium/auxiliary/driver_trace/tr_screen.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.c b/src/gallium/auxiliary/driver_trace/tr_screen.c
index 90ee53617a1..56a70de894a 100644
--- a/src/gallium/auxiliary/driver_trace/tr_screen.c
+++ b/src/gallium/auxiliary/driver_trace/tr_screen.c
@@ -670,11 +670,15 @@ trace_screen_destroy(struct pipe_screen *_screen)
 bool
 trace_enabled(void)
 {
-   do_once {
-      if(trace_dump_trace_begin()) {
-         trace_dumping_start();
-         trace = true;
-      }
+   static bool firstrun = true;
+
+   if (!firstrun)
+      return trace;
+   firstrun = false;
+
+   if(trace_dump_trace_begin()) {
+      trace_dumping_start();
+      trace = true;
    }
 
    return trace;



More information about the mesa-commit mailing list