mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:27:34 +00:00
LibGPU: Remove DeprecatedString usage
This commit is contained in:
parent
e3f8ac2c05
commit
a8cb70c0c4
1 changed files with 7 additions and 7 deletions
|
@ -1,10 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
* Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||||
|
* Copyright (c) 2023, Jelle Raaijmakers <jelle@gmta.nl>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/DeprecatedString.h>
|
|
||||||
#include <AK/HashMap.h>
|
#include <AK/HashMap.h>
|
||||||
#include <AK/WeakPtr.h>
|
#include <AK/WeakPtr.h>
|
||||||
#include <LibGPU/Driver.h>
|
#include <LibGPU/Driver.h>
|
||||||
|
@ -14,15 +14,15 @@ namespace GPU {
|
||||||
|
|
||||||
// FIXME: Think of a better way to configure these paths. Maybe use ConfigServer?
|
// FIXME: Think of a better way to configure these paths. Maybe use ConfigServer?
|
||||||
// clang-format off
|
// 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)
|
#if defined(AK_OS_SERENITY)
|
||||||
{ "softgpu", "libsoftgpu.so.serenity" },
|
{ "softgpu"sv, "libsoftgpu.so.serenity" },
|
||||||
{ "virtgpu", "libvirtgpu.so.serenity" },
|
{ "virtgpu"sv, "libvirtgpu.so.serenity" },
|
||||||
#elif defined(AK_OS_MACOS)
|
#elif defined(AK_OS_MACOS)
|
||||||
{ "softgpu", "liblagom-softgpu.dylib" },
|
{ "softgpu"sv, "liblagom-softgpu.dylib" },
|
||||||
#else
|
#else
|
||||||
{ "softgpu", "liblagom-softgpu.so.0" },
|
{ "softgpu"sv, "liblagom-softgpu.so.0" },
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
@ -41,7 +41,7 @@ ErrorOr<NonnullRefPtr<Driver>> Driver::try_create(StringView driver_name)
|
||||||
if (it == s_driver_path_map.end())
|
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");
|
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)
|
if (!lib)
|
||||||
return Error::from_string_literal("The library for the requested GPU driver could not be opened");
|
return Error::from_string_literal("The library for the requested GPU driver could not be opened");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue