There are still some distributions trying to support unfortunate people
with old or exotic CPUs that don't have 64bit atomic operations. The
only thing preventing compile of the Intel driver for them seems to be
initialization of a debug variable.

It is very unlikely to be set simultaneously by multiple threads that
somehow manage to change the environment variable without affecting each
other, so just provide a thread-unsafe fallback.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93089
Signed-off-by: Grazvydas Ignotas <nota...@gmail.com>
---
no commit access

 src/intel/common/gen_debug.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/intel/common/gen_debug.c b/src/intel/common/gen_debug.c
index 858f04d..b206e8f 100644
--- a/src/intel/common/gen_debug.c
+++ b/src/intel/common/gen_debug.c
@@ -105,5 +105,10 @@ void
 brw_process_intel_debug_variable(void)
 {
    uint64_t intel_debug = parse_debug_string(getenv("INTEL_DEBUG"), 
debug_control);
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
    (void) p_atomic_cmpxchg(&INTEL_DEBUG, 0, intel_debug);
+#else
+   if (!INTEL_DEBUG)
+      INTEL_DEBUG = intel_debug;
+#endif
 }
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to