diff options
author | Pierre-Eric Pelloux-Prayer <[email protected]> | 2020-06-25 15:14:01 +0200 |
---|---|---|
committer | Pierre-Eric Pelloux-Prayer <[email protected]> | 2020-07-10 11:57:11 +0200 |
commit | 50d20dc055decf43f956601d71572f825c2b2eca (patch) | |
tree | b90df61f9f73e12f6991ee9a09f6bf251bf74407 /src/amd | |
parent | 8da237428c19ff185d8be7c2909a2d74874b646b (diff) |
ac/llvm: export ac_init_llvm_once in targets
If a program like mpv uses both radeon_dri.so (because --vo=gpu) and
radeonsi_drv_video.so (because --hwdec=vaapi) then LLVM will be inialized twice.
The commit exports the ac_init_llvm_once so there's only one instance of the
function.
See also 18b12bf5335 ("targets: export radeon winsys_create functions to silence LLVM warning")
which implemented this workaround initially.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1377
Reviewed-by: Marek Olšák <[email protected]>
Acked-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5648>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/llvm/ac_llvm_util.c | 5 | ||||
-rw-r--r-- | src/amd/vulkan/meson.build | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/amd/llvm/ac_llvm_util.c b/src/amd/llvm/ac_llvm_util.c index 62e163b0057..937e0dbf1fb 100644 --- a/src/amd/llvm/ac_llvm_util.c +++ b/src/amd/llvm/ac_llvm_util.c @@ -78,10 +78,9 @@ static void ac_init_llvm_target() LLVMParseCommandLineOptions(ARRAY_SIZE(argv), argv, NULL); } -static once_flag ac_init_llvm_target_once_flag = ONCE_FLAG_INIT; - -void ac_init_llvm_once(void) +PUBLIC void ac_init_llvm_once(void) { + static once_flag ac_init_llvm_target_once_flag = ONCE_FLAG_INIT; call_once(&ac_init_llvm_target_once_flag, ac_init_llvm_target); } diff --git a/src/amd/vulkan/meson.build b/src/amd/vulkan/meson.build index d4127b9d602..a44e785b223 100644 --- a/src/amd/vulkan/meson.build +++ b/src/amd/vulkan/meson.build @@ -176,6 +176,7 @@ if with_symbols_check args : [ '--lib', libvulkan_radeon, '--symbols-file', vulkan_icd_symbols, + '--ignore-symbol', 'ac_init_llvm_once', symbols_check_args, ], suite : ['amd'], |