|
@@ -1,10 +1,10 @@
|
|
|
/*
|
|
|
* Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
|
|
+ * Copyright (c) 2023, Jelle Raaijmakers <jelle@gmta.nl>
|
|
|
*
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
*/
|
|
|
|
|
|
-#include <AK/DeprecatedString.h>
|
|
|
#include <AK/HashMap.h>
|
|
|
#include <AK/WeakPtr.h>
|
|
|
#include <LibGPU/Driver.h>
|
|
@@ -14,15 +14,15 @@ namespace GPU {
|
|
|
|
|
|
// FIXME: Think of a better way to configure these paths. Maybe use ConfigServer?
|
|
|
// clang-format off
|
|
|
-static HashMap<DeprecatedString, DeprecatedString> const s_driver_path_map
|
|
|
+static HashMap<StringView, char const*> const s_driver_path_map
|
|
|
{
|
|
|
#if defined(AK_OS_SERENITY)
|
|
|
- { "softgpu", "libsoftgpu.so.serenity" },
|
|
|
- { "virtgpu", "libvirtgpu.so.serenity" },
|
|
|
+ { "softgpu"sv, "libsoftgpu.so.serenity" },
|
|
|
+ { "virtgpu"sv, "libvirtgpu.so.serenity" },
|
|
|
#elif defined(AK_OS_MACOS)
|
|
|
- { "softgpu", "liblagom-softgpu.dylib" },
|
|
|
+ { "softgpu"sv, "liblagom-softgpu.dylib" },
|
|
|
#else
|
|
|
- { "softgpu", "liblagom-softgpu.so.0" },
|
|
|
+ { "softgpu"sv, "liblagom-softgpu.so.0" },
|
|
|
#endif
|
|
|
};
|
|
|
// clang-format on
|
|
@@ -41,7 +41,7 @@ ErrorOr<NonnullRefPtr<Driver>> Driver::try_create(StringView driver_name)
|
|
|
if (it == s_driver_path_map.end())
|
|
|
return Error::from_string_literal("The requested GPU driver was not found in the list of allowed driver libraries");
|
|
|
|
|
|
- auto lib = dlopen(it->value.characters(), RTLD_NOW);
|
|
|
+ auto lib = dlopen(it->value, RTLD_NOW);
|
|
|
if (!lib)
|
|
|
return Error::from_string_literal("The library for the requested GPU driver could not be opened");
|
|
|
|