diff --git a/src/drm-shim/drm_shim.c b/src/drm-shim/drm_shim.c index f721ace9567..6d090d12292 100644 --- a/src/drm-shim/drm_shim.c +++ b/src/drm-shim/drm_shim.c @@ -204,18 +204,14 @@ destroy_shim(void) static void init_shim(void) { - static bool inited = false; + static uint32_t inited = 0; + drm_shim_debug = debug_get_bool_option("DRM_SHIM_DEBUG", false); /* We can't lock this, because we recurse during initialization. */ - if (inited) + if (p_atomic_cmpxchg(&inited, 0, 1)) return; - /* This comes first (and we're locked), to make sure we don't recurse - * during initialization. - */ - inited = true; - opendir_set = _mesa_set_create(NULL, _mesa_hash_string, _mesa_key_string_equal);