backend/native: Ignore not found errors when adding drm device in headless

When testing mutter using `META_DBUS_RUNNER_WRAPPER=rr` we may get a
not found-device error, given that it's not a case we support, we can
ignore it as we do with permission denied one, limiting this to the RR
case.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3793>
This commit is contained in:
Marco Trevisan (Treviño) 2023-05-19 16:06:15 +02:00 committed by Marge Bot
parent 2a1cc195a3
commit c6631077d7

View File

@ -647,8 +647,11 @@ init_gpus (MetaBackendNative *native,
if (!add_drm_device (native, device, &device_error))
{
if (meta_backend_is_headless (backend) &&
g_error_matches (device_error, G_IO_ERROR,
G_IO_ERROR_PERMISSION_DENIED))
(g_error_matches (device_error, G_IO_ERROR,
G_IO_ERROR_PERMISSION_DENIED) ||
(g_strcmp0 (g_getenv ("RUNNING_UNDER_RR"), "1") == 0 &&
g_error_matches (device_error, G_IO_ERROR,
G_IO_ERROR_NOT_FOUND))))
{
meta_topic (META_DEBUG_BACKEND,
"Ignoring unavailable gpu '%s': %s'",