1 From aceb689ae69857def8a26a8d1ceb114ccfbb2569 Mon Sep 17 00:00:00 2001
2 From: Philipp Jungkamp <p.jungkamp@gmx.net>
3 Date: Tue, 28 May 2024 19:22:29 +0200
4 Subject: [PATCH] NixOS: Search ONEVPLRT in /run/opengl-driver/lib
7 api/mfx_dispatch/linux/mfxloader.cpp | 2 ++
8 .../suites/mfx_dispatch/linux/mfx_dispatch_test_cases_libs.cpp | 1 +
9 2 files changed, 3 insertions(+)
11 diff --git a/api/mfx_dispatch/linux/mfxloader.cpp b/api/mfx_dispatch/linux/mfxloader.cpp
12 index 39b6bff1..f76ed65d 100644
13 --- a/api/mfx_dispatch/linux/mfxloader.cpp
14 +++ b/api/mfx_dispatch/linux/mfxloader.cpp
15 @@ -193,6 +193,7 @@ mfxStatus LoaderCtx::Init(mfxInitParam& par)
16 if (selected_runtime && strcmp(selected_runtime, "ONEVPL") == 0) {
17 libs.emplace_back(ONEVPLRT);
18 libs.emplace_back(MFX_MODULES_DIR "/" ONEVPLRT);
19 + libs.emplace_back("/run/opengl-driver/lib/" ONEVPLRT);
20 } else if ((selected_runtime && strcmp(selected_runtime, "MSDK") == 0) || (platform != MFX_HW_UNKNOWN)) {
21 if (MFX_IMPL_BASETYPE(par.Implementation) == MFX_IMPL_AUTO ||
22 MFX_IMPL_BASETYPE(par.Implementation) == MFX_IMPL_AUTO_ANY) {
23 @@ -213,6 +214,7 @@ mfxStatus LoaderCtx::Init(mfxInitParam& par)
25 libs.emplace_back(ONEVPLRT);
26 libs.emplace_back(MFX_MODULES_DIR "/" ONEVPLRT);
27 + libs.emplace_back("/run/opengl-driver/lib/" ONEVPLRT);
30 mfxStatus mfx_res = MFX_ERR_UNSUPPORTED;
31 diff --git a/tests/unit/suites/mfx_dispatch/linux/mfx_dispatch_test_cases_libs.cpp b/tests/unit/suites/mfx_dispatch/linux/mfx_dispatch_test_cases_libs.cpp
32 index dedee0b3..9657da4b 100644
33 --- a/tests/unit/suites/mfx_dispatch/linux/mfx_dispatch_test_cases_libs.cpp
34 +++ b/tests/unit/suites/mfx_dispatch/linux/mfx_dispatch_test_cases_libs.cpp
35 @@ -123,6 +123,7 @@ TEST_P(DispatcherLibsTestParametrized, ShouldEnumerateCorrectLibNames)
37 libs.emplace_back(ONEVPLRT);
38 libs.emplace_back(modules_dir + "/" + ONEVPLRT);
39 + libs.emplace_back("/run/opengl-driver/lib/" + ONEVPLRT);
42 for (const std::string& lib : libs)