diff -Nru mutter-45.2/debian/changelog mutter-45.2/debian/changelog --- mutter-45.2/debian/changelog 2024-02-22 16:32:33.000000000 +0800 +++ mutter-45.2/debian/changelog 2024-04-08 17:47:26.000000000 +0800 @@ -1,3 +1,13 @@ +mutter (45.2-0ubuntu5) mantic; urgency=medium + + * Replace tests-Disable-restore-size-test.patch with + Mark-several-additional-tests-as-flaky.patch from Debian to avoid + wasting time on rebuilds for known flaky test cases. + * Add compositor-sync-ring-Allow-the-gpu_fence-to-be-moved.patch to + fix lag and freezes on the Nvidia Xorg driver (LP: #2059847) + + -- Daniel van Vugt Mon, 08 Apr 2024 17:47:26 +0800 + mutter (45.2-0ubuntu4) mantic; urgency=medium [ Kai-Heng Feng ] diff -Nru mutter-45.2/debian/patches/compositor-sync-ring-Allow-the-gpu_fence-to-be-moved.patch mutter-45.2/debian/patches/compositor-sync-ring-Allow-the-gpu_fence-to-be-moved.patch --- mutter-45.2/debian/patches/compositor-sync-ring-Allow-the-gpu_fence-to-be-moved.patch 1970-01-01 08:00:00.000000000 +0800 +++ mutter-45.2/debian/patches/compositor-sync-ring-Allow-the-gpu_fence-to-be-moved.patch 2024-04-08 17:46:27.000000000 +0800 @@ -0,0 +1,53 @@ +From: Daniel van Vugt +Date: Wed, 3 Apr 2024 16:58:13 +0800 +Subject: compositor/sync-ring: Allow the gpu_fence to be moved + +When the compositor inserts two waits in a frame, such as f606a4424a5afc, +the second insertion shouldn't break the ring's state machine as easily +as it does. We can instead merge the two GL waits into one by simply moving +the GL fence to the latest insertion. Each insertion still does its own X11 +sync though. + +Origin: Upstream commit 22689d722ab4e13ab272c3534f5d18a55c94084f +Bug: https://gitlab.gnome.org/GNOME/mutter/-/issues/3384 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/2059847 +--- + src/compositor/meta-sync-ring.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/src/compositor/meta-sync-ring.c b/src/compositor/meta-sync-ring.c +index 8f5d1a0..1267dd4 100644 +--- a/src/compositor/meta-sync-ring.c ++++ b/src/compositor/meta-sync-ring.c +@@ -544,20 +544,29 @@ gboolean + meta_sync_ring_insert_wait (void) + { + MetaSyncRing *ring = meta_sync_ring_get (); ++ MetaSync *sync; + + if (!ring) + return FALSE; + + g_return_val_if_fail (ring->xdisplay != NULL, FALSE); + +- if (ring->current_sync->state != META_SYNC_STATE_READY) ++ sync = ring->current_sync; ++ ++ if (sync->state == META_SYNC_STATE_WAITING) ++ { ++ meta_gl_delete_sync (sync->gpu_fence); ++ sync->gpu_fence = 0; ++ sync->state = META_SYNC_STATE_READY; ++ } ++ else if (sync->state != META_SYNC_STATE_READY) + { + meta_warning ("MetaSyncRing: Sync object is not ready -- were events handled properly?"); + if (!meta_sync_ring_reboot (ring->xdisplay)) + return FALSE; + } + +- meta_sync_insert (ring->current_sync); ++ meta_sync_insert (sync); + + return TRUE; + } diff -Nru mutter-45.2/debian/patches/series mutter-45.2/debian/patches/series --- mutter-45.2/debian/patches/series 2024-02-22 16:32:33.000000000 +0800 +++ mutter-45.2/debian/patches/series 2024-04-08 17:46:27.000000000 +0800 @@ -4,10 +4,11 @@ debian/tests-Do-not-run-screencast-tests.patch debian/Support-Dynamic-triple-double-buffering.patch workarounds/tests-skip-monitor-width-size-check-as-it-may-lead-to-une.patch -workarounds/tests-Disable-restore-size-test.patch workarounds/tests-Skip-thread-priority-test.patch ubuntu/x11-Add-support-for-fractional-scaling-using-Randr.patch ubuntu/window-Add-ability-to-override-the-edge-constraints.patch workarounds/cogl-onscreen-glx-Forcefully-disable-cogl_onscreen_glx_ge.patch gen_default_modes-Consider-reduced-blanking-with-lower-pi.patch compositor-x11-Sync-again-at-the-end-of-before_paint.patch +workarounds/Mark-several-additional-tests-as-flaky.patch +compositor-sync-ring-Allow-the-gpu_fence-to-be-moved.patch diff -Nru mutter-45.2/debian/patches/workarounds/Mark-several-additional-tests-as-flaky.patch mutter-45.2/debian/patches/workarounds/Mark-several-additional-tests-as-flaky.patch --- mutter-45.2/debian/patches/workarounds/Mark-several-additional-tests-as-flaky.patch 1970-01-01 08:00:00.000000000 +0800 +++ mutter-45.2/debian/patches/workarounds/Mark-several-additional-tests-as-flaky.patch 2024-04-08 17:46:27.000000000 +0800 @@ -0,0 +1,98 @@ +From: Simon McVittie +Date: Wed, 13 Dec 2023 10:34:02 +0000 +Subject: Mark several additional tests as flaky + +Most of these have never been reliable on Debian buildds, especially +on ARM, so having them fail is not a regression. They usually succeed +after a few retries, but that's time-consuming and unsuitable to be a +QA gate. + +Signed-off-by: Simon McVittie +Forwarded: no +--- + src/tests/clutter/conform/grab.c | 6 ++++++ + src/tests/meson.build | 31 ++++++++++++++++++++++++++++--- + 2 files changed, 34 insertions(+), 3 deletions(-) + +diff --git a/src/tests/clutter/conform/grab.c b/src/tests/clutter/conform/grab.c +index ce4fdeb..5f9e0f16 100644 +--- a/src/tests/clutter/conform/grab.c ++++ b/src/tests/clutter/conform/grab.c +@@ -621,6 +621,12 @@ grab_input_only (void) + ClutterSeat *seat; + g_autoptr (ClutterVirtualInputDevice) pointer = NULL; + ++ if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL) ++ { ++ g_test_skip ("https://gitlab.gnome.org/GNOME/mutter/-/issues/3205"); ++ return; ++ } ++ + seat = clutter_backend_get_default_seat (clutter_get_default_backend ()); + pointer = clutter_seat_create_virtual_device (seat, CLUTTER_POINTER_DEVICE); + +diff --git a/src/tests/meson.build b/src/tests/meson.build +index adc3733..c4136f8 100644 +--- a/src/tests/meson.build ++++ b/src/tests/meson.build +@@ -375,6 +375,7 @@ if have_native_tests + 'name': 'input-capture', + 'suite': 'backends/native', + 'sources': [ 'input-capture-tests.c' ], ++ 'flaky': true, + }, + { + 'name': 'thread', +@@ -655,8 +656,14 @@ if have_native_tests + + test_depends = [ default_plugin ] + test_case.get('depends', []) + ++ extra_suites = [] ++ ++ if test_case.get('flaky', false) ++ extra_suites += 'flaky' ++ endif ++ + test(test_case['name'], test_executable, +- suite: ['core', 'mutter/' + test_case['suite']], ++ suite: ['core', 'mutter/' + test_case['suite']] + extra_suites, + env: test_env, + depends: test_depends, + is_parallel: false, +@@ -707,8 +714,26 @@ stacking_tests = [ + ] + + foreach stacking_test: stacking_tests ++ extra_suites = [] ++ flaky = false ++ ++ if { ++ 'closed-transient-only-take-focus-parents': true, ++ # https://gitlab.gnome.org/GNOME/mutter/-/issues/3050 ++ 'fullscreen-maximize': true, ++ 'minimized': true, ++ # https://gitlab.gnome.org/GNOME/mutter/-/issues/2509, https://bugs.debian.org/1050022 ++ 'restore-size': true, ++ # https://gitlab.gnome.org/GNOME/mutter/-/issues/3051 ++ 'unfullscreen-strut-change': true, ++ 'unmaximize-new-size': true, ++ }.get(stacking_test, false) ++ extra_suites += 'flaky' ++ flaky = true ++ endif ++ + test(stacking_test, test_runner, +- suite: ['core', 'mutter/stacking'], ++ suite: ['core', 'mutter/stacking'] + extra_suites, + env: test_env, + args: [ + files('stacking' / stacking_test + '.metatest'), +@@ -717,7 +742,7 @@ foreach stacking_test: stacking_tests + timeout: 60, + ) + +- if have_installed_tests ++ if have_installed_tests and not flaky + installed_tests_cdata = configuration_data() + installed_tests_cdata.set('apiversion', libmutter_api_version) + installed_tests_cdata.set('libexecdir', libexecdir) diff -Nru mutter-45.2/debian/patches/workarounds/tests-Disable-restore-size-test.patch mutter-45.2/debian/patches/workarounds/tests-Disable-restore-size-test.patch --- mutter-45.2/debian/patches/workarounds/tests-Disable-restore-size-test.patch 2024-01-02 21:28:40.000000000 +0800 +++ mutter-45.2/debian/patches/workarounds/tests-Disable-restore-size-test.patch 1970-01-01 08:00:00.000000000 +0800 @@ -1,26 +0,0 @@ -From: Simon McVittie -Date: Tue, 15 Nov 2022 10:20:35 +0000 -Subject: tests: Disable restore-size test - -This intermittently fails on x86 and consistently fails on 32-bit ARM. -Workaround for https://gitlab.gnome.org/GNOME/mutter/-/issues/2509 - -Bug: https://gitlab.gnome.org/GNOME/mutter/-/issues/2509 -Forwarded: not-needed -Applied-upstream: no, see also https://bugs.debian.org/1050022 ---- - src/tests/meson.build | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/src/tests/meson.build b/src/tests/meson.build -index adc3733..05575c6 100644 ---- a/src/tests/meson.build -+++ b/src/tests/meson.build -@@ -684,7 +684,6 @@ stacking_tests = [ - 'override-redirect', - 'set-override-redirect-parent', - 'set-parent-exported', -- 'restore-size', - 'unmaximize-new-size', - 'fullscreen-maximize', - 'unfullscreen-strut-change', diff -Nru mutter-45.2/debian/rules mutter-45.2/debian/rules --- mutter-45.2/debian/rules 2024-01-02 21:28:40.000000000 +0800 +++ mutter-45.2/debian/rules 2024-04-08 17:33:40.000000000 +0800 @@ -56,7 +56,7 @@ dh_auto_test -- -C $(BUILDDIR) --no-rebuild --verbose --timeout-multiplier 6 \ --no-stdsplit --print-errorlogs TEST_COMMAND=$(TEST_COMMAND_BASE) --no-suite flaky -TEST_COMMAND_FLAKY=$(TEST_COMMAND_BASE) --suite flaky +TEST_COMMAND_FLAKY=env DEB_ALLOW_FLAKY_TESTS=1 $(TEST_COMMAND_BASE) --suite flaky # Don't run the tests on mips etc. since they either time out or fail too # much, blocking migration to testing.