Fix Wayland session with Virtio driver

Resolves: RHEL-45198
This commit is contained in:
José Expósito 2024-07-04 16:50:48 +02:00
parent 303ff4acc4
commit cb20a25a4b
3 changed files with 90 additions and 1 deletions

View File

@ -0,0 +1,51 @@
From 11e6100226006b5371de30310357582db64c9309 Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Tue, 5 Apr 2022 17:05:17 +0800
Subject: [PATCH 1/2] kms/impl-device: Add addfb2_modifiers to
MetaKmsDeviceCaps
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2359>
---
src/backends/native/meta-kms-impl-device.c | 6 ++++++
src/backends/native/meta-kms-impl-device.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/src/backends/native/meta-kms-impl-device.c b/src/backends/native/meta-kms-impl-device.c
index 75920fe6b..d2e821338 100644
--- a/src/backends/native/meta-kms-impl-device.c
+++ b/src/backends/native/meta-kms-impl-device.c
@@ -288,6 +288,7 @@ init_caps (MetaKmsImplDevice *impl_device)
meta_kms_impl_device_get_instance_private (impl_device);
int fd = priv->fd;
uint64_t cursor_width, cursor_height;
+ uint64_t addfb2_modifiers;
if (drmGetCap (fd, DRM_CAP_CURSOR_WIDTH, &cursor_width) == 0 &&
drmGetCap (fd, DRM_CAP_CURSOR_HEIGHT, &cursor_height) == 0)
@@ -296,6 +297,11 @@ init_caps (MetaKmsImplDevice *impl_device)
priv->caps.cursor_width = cursor_width;
priv->caps.cursor_height = cursor_height;
}
+
+ if (drmGetCap (fd, DRM_CAP_ADDFB2_MODIFIERS, &addfb2_modifiers) == 0)
+ {
+ priv->caps.addfb2_modifiers = (addfb2_modifiers != 0);
+ }
}
static void
diff --git a/src/backends/native/meta-kms-impl-device.h b/src/backends/native/meta-kms-impl-device.h
index 913ba992f..a82ad4155 100644
--- a/src/backends/native/meta-kms-impl-device.h
+++ b/src/backends/native/meta-kms-impl-device.h
@@ -36,6 +36,7 @@ typedef struct _MetaKmsDeviceCaps
gboolean has_cursor_size;
uint64_t cursor_width;
uint64_t cursor_height;
+ gboolean addfb2_modifiers;
} MetaKmsDeviceCaps;
typedef struct _MetaKmsProp MetaKmsProp;
--
2.45.2

View File

@ -0,0 +1,29 @@
From dd94c448e94b1033b90749d77c5dc587c3b8f9f4 Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Tue, 5 Apr 2022 17:06:21 +0800
Subject: [PATCH 2/2] kms/device: Disable modifiers when
!DRM_CAP_ADDFB2_MODIFIERS
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2210
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2359>
---
src/backends/native/meta-kms-device.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/backends/native/meta-kms-device.c b/src/backends/native/meta-kms-device.c
index bef1e2065..7c84f14f5 100644
--- a/src/backends/native/meta-kms-device.c
+++ b/src/backends/native/meta-kms-device.c
@@ -490,6 +490,9 @@ meta_kms_device_new (MetaKms *kms,
free (device->path);
device->path = data.out_path;
+ if (!device->caps.addfb2_modifiers)
+ device->flags |= META_KMS_DEVICE_FLAG_DISABLE_MODIFIERS;
+
return device;
}
--
2.45.2

View File

@ -10,7 +10,7 @@
Name: mutter
Version: 40.9
Release: 16%{?dist}
Release: 17%{?dist}
Summary: Window and compositing manager based on Clutter
License: GPLv2+
@ -115,6 +115,11 @@ Patch47: 0001-core-Change-MetaWaylandTextInput-event-forwarding-to.patch
Patch48: 0001-backends-Disambiguate-output-mapped-to-tablet-with-c.patch
# Backport https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2359
# Resolves https://issues.redhat.com/browse/RHEL-45198
Patch49: 0001-kms-impl-device-Add-addfb2_modifiers-to-MetaKmsDevic.patch
Patch50: 0002-kms-device-Disable-modifiers-when-DRM_CAP_ADDFB2_MOD.patch
BuildRequires: chrpath
BuildRequires: pango-devel
BuildRequires: startup-notification-devel
@ -262,6 +267,10 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%{_datadir}/mutter-%{mutter_api_version}/tests
%changelog
* Thu Jul 04 2024 José Expósito <jexposit@redhat.com> - 40.9-17
- Fix Wayland session with Virtio driver
Resolves: RHEL-45198
* Tue Feb 06 2024 Carlos Garnacho <cgarnach@redhat.com> - 40.9-16
- Disambiguate output mapped to tablet with connector name
Resolves: RHEL-28535