From f50a176d62dc4f2b00b588b60b013564d3ffcd95 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 8 Feb 2024 14:48:47 -0800 Subject: [PATCH] Backport MR #3539 to fix RHBZ #2261842 --- ...er-Create-CrtcStateImpls-for-all-act.patch | 58 +++++++++++++++++++ mutter.spec | 5 ++ 2 files changed, 63 insertions(+) create mode 100644 0001-kms-cursor-manager-Create-CrtcStateImpls-for-all-act.patch diff --git a/0001-kms-cursor-manager-Create-CrtcStateImpls-for-all-act.patch b/0001-kms-cursor-manager-Create-CrtcStateImpls-for-all-act.patch new file mode 100644 index 0000000..65e90e0 --- /dev/null +++ b/0001-kms-cursor-manager-Create-CrtcStateImpls-for-all-act.patch @@ -0,0 +1,58 @@ +From af0ca0cdc2a15036ca7f0a90be374e1436c660cf Mon Sep 17 00:00:00 2001 +From: Sebastian Wick +Date: Mon, 22 Jan 2024 12:45:37 +0100 +Subject: [PATCH] kms/cursor-manager: Create CrtcStateImpls for all active + CRTCs + +even if they don't have a cursor plane. This way we can just use the +object. Updating the cursor plane then just looks at the cursor_plane +field to skips updates when there is none. + +Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3254 +Fixes: cc7bca073 ("crtc/kms: Dynamically assign primary and cursor planes") +Part-of: +--- + src/backends/native/meta-kms-cursor-manager.c | 6 ++++-- + src/backends/native/meta-renderer-native.c | 2 -- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/backends/native/meta-kms-cursor-manager.c b/src/backends/native/meta-kms-cursor-manager.c +index 646084877..6873000dc 100644 +--- a/src/backends/native/meta-kms-cursor-manager.c ++++ b/src/backends/native/meta-kms-cursor-manager.c +@@ -333,6 +333,10 @@ maybe_update_cursor_plane (MetaKmsCursorManagerImpl *cursor_manager_impl, + crtc_state_impl = find_crtc_state (cursor_manager_impl, crtc); + g_return_val_if_fail (crtc_state_impl, update); + ++ cursor_plane = crtc_state_impl->cursor_plane; ++ if (!cursor_plane) ++ return update; ++ + if (!crtc_state_impl->cursor_invalidated) + return update; + +@@ -368,8 +372,6 @@ maybe_update_cursor_plane (MetaKmsCursorManagerImpl *cursor_manager_impl, + meta_kms_update_realize (update, impl_device); + } + +- cursor_plane = crtc_state_impl->cursor_plane; +- + if (should_have_cursor) + { + int width, height; +diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c +index 78bde68ff..dc08824c1 100644 +--- a/src/backends/native/meta-renderer-native.c ++++ b/src/backends/native/meta-renderer-native.c +@@ -1128,8 +1128,6 @@ meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native) + crtc_kms = META_CRTC_KMS (crtc); + + kms_plane = meta_crtc_kms_get_assigned_cursor_plane (crtc_kms); +- if (!kms_plane) +- continue; + kms_crtc = meta_crtc_kms_get_kms_crtc (crtc_kms); + + clutter_stage_view_get_layout (stage_view, &view_layout); +-- +2.43.0 + diff --git a/mutter.spec b/mutter.spec index d9b18a6..7c0e1ac 100644 --- a/mutter.spec +++ b/mutter.spec @@ -44,6 +44,11 @@ Patch: 0001-Revert-x11-Use-input-region-from-frame-window-for-de.patch # which solves the problems reported with #3329 alone Patch: 0001-modified-3329.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2261842 +# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3539 +# fixes failure to show anything on virtio-vga without 3D acceleration +Patch: 0001-kms-cursor-manager-Create-CrtcStateImpls-for-all-act.patch + Patch: fix-i686-build.patch BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0