backend/native: Prepare render devices earlier than KMS

The type of render device used for a specific GPU affects the mode
setting backend that can be used, more specifically, when the render
device is an EGLStream based one, atomic mode setting isn't possible, as
page flipping is done via EGL, not via atomic mode setting commits.

Preparing the render devices before KMS devices means can make a more
informed decision whether to deny-list atomic mode setting for when
a certain GPU uses a EGLStream based render device instance.

This also means we need to translate mode setting devices to render node
devices when creating the render device itself, as doing it later when
creating the mode setting device is already too late.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2578>
This commit is contained in:
Jonas Ådahl
2022-08-17 12:11:29 +02:00
committed by Marge Bot
parent 1a0bd44694
commit 58c3734d78
6 changed files with 207 additions and 151 deletions

View File

@ -821,6 +821,10 @@ meta_backend_constructed (GObject *object)
NULL);
}
#ifdef HAVE_EGL
priv->egl = g_object_new (META_TYPE_EGL, NULL);
#endif
G_OBJECT_CLASS (meta_backend_parent_class)->constructed (object);
}
@ -1199,11 +1203,6 @@ meta_backend_initable_init (GInitable *initable,
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
priv->settings = meta_settings_new (backend);
#ifdef HAVE_EGL
priv->egl = g_object_new (META_TYPE_EGL, NULL);
#endif
priv->orientation_manager = g_object_new (META_TYPE_ORIENTATION_MANAGER, NULL);
priv->monitor_manager = meta_backend_create_monitor_manager (backend, error);