[mutter] kms/device: Move universal plane cap check to mode set init
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] kms/device: Move universal plane cap check to mode set init
- Date: Fri, 12 Mar 2021 15:43:44 +0000 (UTC)
commit 34b0f9c12427598e5ce537271c58c0ef50aa0c38
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Mon Jan 18 18:30:02 2021 +0100
kms/device: Move universal plane cap check to mode set init
This leaves only the atomic mode setting cap check before creating the
impl device, aiming to make it possible to create a non-mode-setting
MetaKmsImplDevice implementation.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
src/backends/native/meta-kms-device.c | 12 ++----------
src/backends/native/meta-kms-impl-device.c | 10 ++++++++++
2 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/src/backends/native/meta-kms-device.c b/src/backends/native/meta-kms-device.c
index b5b50d602c..9084d248fe 100644
--- a/src/backends/native/meta-kms-device.c
+++ b/src/backends/native/meta-kms-device.c
@@ -281,22 +281,12 @@ meta_create_kms_impl_device (MetaKmsDevice *device,
{
GType impl_device_type;
gboolean supports_atomic_mode_setting;
- int ret;
g_autofree char *driver_name = NULL;
g_autofree char *driver_description = NULL;
const char *atomic_kms_enable_env;
meta_assert_in_kms_impl (meta_kms_impl_get_kms (impl));
- ret = drmSetClientCap (fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
- if (ret != 0)
- {
- g_set_error (error, G_IO_ERROR, g_io_error_from_errno (-ret),
- "Failed to activate universal planes: %s",
- g_strerror (-ret));
- return NULL;
- }
-
if (!get_driver_info (fd, &driver_name, &driver_description))
{
driver_name = g_strdup ("unknown");
@@ -340,6 +330,8 @@ meta_create_kms_impl_device (MetaKmsDevice *device,
}
else
{
+ int ret;
+
ret = drmSetClientCap (fd, DRM_CLIENT_CAP_ATOMIC, 1);
if (ret == 0)
supports_atomic_mode_setting = TRUE;
diff --git a/src/backends/native/meta-kms-impl-device.c b/src/backends/native/meta-kms-impl-device.c
index 1f72de75b5..f2a000fd1a 100644
--- a/src/backends/native/meta-kms-impl-device.c
+++ b/src/backends/native/meta-kms-impl-device.c
@@ -787,8 +787,18 @@ meta_kms_impl_device_init_mode_setting (MetaKmsImplDevice *impl_device,
{
MetaKmsImplDevicePrivate *priv =
meta_kms_impl_device_get_instance_private (impl_device);
+ int ret;
drmModeRes *drm_resources;
+ ret = drmSetClientCap (priv->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
+ if (ret != 0)
+ {
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (-ret),
+ "Failed to activate universal planes: %s",
+ g_strerror (-ret));
+ return FALSE;
+ }
+
drm_resources = drmModeGetResources (priv->fd);
if (!drm_resources)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]