Browse Source

update to new upstream release

Signed-off-by: Toshaan Bharvani <toshaan@powerel.org>
master
Toshaan Bharvani 11 months ago
parent
commit
9867215689
  1. 144
      SOURCES/0001-backends-Move-MetaKeyboardA11yFlags-to-a-public-head.patch
  2. 34
      SOURCES/0001-backends-Only-apply-EDID-based-tablet-mapping-heuris.patch
  3. 38
      SOURCES/0001-clutter-Make-ClutterClickAction-independent-of-click.patch
  4. 52
      SOURCES/0001-clutter-text-Don-t-query-preferred-size-without-allo.patch
  5. 162
      SOURCES/0001-core-Change-MetaWaylandTextInput-event-forwarding-to.patch
  6. 26
      SOURCES/0001-events-Pass-CurrentTime-to-XIAllowEvents-when-unfree.patch
  7. 45
      SOURCES/0001-gpu-kms-Report-that-we-can-have-outputs-if-we-have-c.patch
  8. 193
      SOURCES/0001-kms-Allow-passing-framebuffer-damage-metadata.patch
  9. 46
      SOURCES/0001-kms-crtc-Add-function-meta_kms_crtc_has_gamma.patch
  10. 218
      SOURCES/0001-monitor-manager-Add-NightLightSupported-property-to-.patch
  11. 107
      SOURCES/0001-output-kms-Add-more-heuristics-to-decide-when-to-off.patch
  12. 63
      SOURCES/0001-renderer-native-Log-render-mode-per-device.patch
  13. 43
      SOURCES/0002-crtc-kms-Don-t-add-gamma-to-the-update-if-unsupporte.patch
  14. 120
      SOURCES/0002-onscreen-native-Pass-damage-rectangles-when-page-fli.patch
  15. 47
      SOURCES/0002-output-kms-Don-t-attemp-to-add-common-modes-on-conne.patch
  16. 94
      SOURCES/0002-renderer-native-Try-the-gbm-renderer-before-the-EGLD.patch
  17. 37
      SOURCES/0003-kms-crtc-Determine-gamma-support-given-the-gamma-len.patch
  18. 100
      SOURCES/0003-wayland-Only-init-EGLStream-controller-if-we-didn-t-.patch
  19. 70
      SOURCES/0004-renderer-native-Allow-forcing-EGLStream-backend.patch
  20. 37
      SOURCES/0005-cursor-renderer-native-Add-a-means-to-disable-HW-cur.patch
  21. 213
      SOURCES/add-unsafe-mode-property.patch
  22. 100
      SOURCES/legacy-x11-input-configuration.patch
  23. 0
      SOURCES/mutter-42.alpha-disable-tegra.patch
  24. 106
      SPECS/mutter.spec

144
SOURCES/0001-backends-Move-MetaKeyboardA11yFlags-to-a-public-head.patch

@ -0,0 +1,144 @@ @@ -0,0 +1,144 @@
From 651f5e0c6a33d9ac32c2a16735a026153a2ddf38 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Tue, 14 Jun 2022 16:31:43 +0200
Subject: [PATCH] backends: Move MetaKeyboardA11yFlags to a public header

The MetaKeyboardA11yFlags are used by gnome-shell to show a dialog
whenever a keyboard accessibility feature is switched using the
keyboard.

Unfortunately, commit c3acaeb25 renamed the Clutter flag to Meta and
moved them to a private header. As a result, gnome-shell do not show any
dialog anymore when a keyboard accessibility feature is activated.

Move the MetaKeyboardA11yFlags definition to a public header so that
gnome-shell can use it.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2306
Fixes: c3acaeb25 - backends: Move keyboard a11y into backends
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2463>
---
src/backends/meta-input-settings-private.h | 19 +------
src/meta/meson.build | 1 +
src/meta/meta-enums.h | 62 ++++++++++++++++++++++
3 files changed, 64 insertions(+), 18 deletions(-)
create mode 100644 src/meta/meta-enums.h

diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h
index 42ee0e0e6..5ef54ee84 100644
--- a/src/backends/meta-input-settings-private.h
+++ b/src/backends/meta-input-settings-private.h
@@ -31,29 +31,12 @@
#include "backends/meta-backend-types.h"
#include "clutter/clutter.h"
#include "meta/display.h"
+#include "meta/meta-enums.h"
#define META_TYPE_INPUT_SETTINGS (meta_input_settings_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaInputSettings, meta_input_settings,
META, INPUT_SETTINGS, GObject)
-typedef enum
-{
- META_A11Y_KEYBOARD_ENABLED = 1 << 0,
- META_A11Y_TIMEOUT_ENABLED = 1 << 1,
- META_A11Y_MOUSE_KEYS_ENABLED = 1 << 2,
- META_A11Y_SLOW_KEYS_ENABLED = 1 << 3,
- META_A11Y_SLOW_KEYS_BEEP_PRESS = 1 << 4,
- META_A11Y_SLOW_KEYS_BEEP_ACCEPT = 1 << 5,
- META_A11Y_SLOW_KEYS_BEEP_REJECT = 1 << 6,
- META_A11Y_BOUNCE_KEYS_ENABLED = 1 << 7,
- META_A11Y_BOUNCE_KEYS_BEEP_REJECT = 1 << 8,
- META_A11Y_TOGGLE_KEYS_ENABLED = 1 << 9,
- META_A11Y_STICKY_KEYS_ENABLED = 1 << 10,
- META_A11Y_STICKY_KEYS_TWO_KEY_OFF = 1 << 11,
- META_A11Y_STICKY_KEYS_BEEP = 1 << 12,
- META_A11Y_FEATURE_STATE_CHANGE_BEEP = 1 << 13,
-} MetaKeyboardA11yFlags;
-
/**
* MetaKbdA11ySettings:
*
diff --git a/src/meta/meson.build b/src/meta/meson.build
index a096ee4dd..4a67abb25 100644
--- a/src/meta/meson.build
+++ b/src/meta/meson.build
@@ -17,6 +17,7 @@ mutter_public_headers = [
'meta-close-dialog.h',
'meta-cursor-tracker.h',
'meta-dnd.h',
+ 'meta-enums.h',
'meta-idle-monitor.h',
'meta-inhibit-shortcuts-dialog.h',
'meta-launch-context.h',
diff --git a/src/meta/meta-enums.h b/src/meta/meta-enums.h
new file mode 100644
index 000000000..e59ebaf72
--- /dev/null
+++ b/src/meta/meta-enums.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2016-2021 Red Hat Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ */
+
+#ifndef META_ENUMS_H
+#define META_ENUMS_H
+
+/**
+ * MetaKeyboardA11yFlags:
+ * @META_A11Y_KEYBOARD_ENABLED:
+ * @META_A11Y_TIMEOUT_ENABLED:
+ * @META_A11Y_MOUSE_KEYS_ENABLED:
+ * @META_A11Y_SLOW_KEYS_ENABLED:
+ * @META_A11Y_SLOW_KEYS_BEEP_PRESS:
+ * @META_A11Y_SLOW_KEYS_BEEP_ACCEPT:
+ * @META_A11Y_SLOW_KEYS_BEEP_REJECT:
+ * @META_A11Y_BOUNCE_KEYS_ENABLED:
+ * @META_A11Y_BOUNCE_KEYS_BEEP_REJECT:
+ * @META_A11Y_TOGGLE_KEYS_ENABLED:
+ * @META_A11Y_STICKY_KEYS_ENABLED:
+ * @META_A11Y_STICKY_KEYS_TWO_KEY_OFF:
+ * @META_A11Y_STICKY_KEYS_BEEP:
+ * @META_A11Y_FEATURE_STATE_CHANGE_BEEP:
+ *
+ * Keyboard accessibility features.
+ *
+ */
+typedef enum
+{
+ META_A11Y_KEYBOARD_ENABLED = 1 << 0,
+ META_A11Y_TIMEOUT_ENABLED = 1 << 1,
+ META_A11Y_MOUSE_KEYS_ENABLED = 1 << 2,
+ META_A11Y_SLOW_KEYS_ENABLED = 1 << 3,
+ META_A11Y_SLOW_KEYS_BEEP_PRESS = 1 << 4,
+ META_A11Y_SLOW_KEYS_BEEP_ACCEPT = 1 << 5,
+ META_A11Y_SLOW_KEYS_BEEP_REJECT = 1 << 6,
+ META_A11Y_BOUNCE_KEYS_ENABLED = 1 << 7,
+ META_A11Y_BOUNCE_KEYS_BEEP_REJECT = 1 << 8,
+ META_A11Y_TOGGLE_KEYS_ENABLED = 1 << 9,
+ META_A11Y_STICKY_KEYS_ENABLED = 1 << 10,
+ META_A11Y_STICKY_KEYS_TWO_KEY_OFF = 1 << 11,
+ META_A11Y_STICKY_KEYS_BEEP = 1 << 12,
+ META_A11Y_FEATURE_STATE_CHANGE_BEEP = 1 << 13,
+} MetaKeyboardA11yFlags;
+
+#endif /* META_ENUMS_H */
--
2.36.1

34
SOURCES/0001-backends-Only-apply-EDID-based-tablet-mapping-heuris.patch

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
From ba25271408a32a2a73a82acc6e094a611001c9f0 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 16 Dec 2022 23:06:33 +0100
Subject: [PATCH] backends: Only apply EDID-based tablet mapping heuristic on
integrated devices

These are the ones attached to a display, thus they are the ones that may need
help from this heuristic. Non-integrated tablets (e.g. Intuos) will default to
the span of all monitors.

Fixes mapping of opaque tablets if a display-integrated tablet of the same
brand is also plugged in.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2767>
---
src/backends/meta-input-mapper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backends/meta-input-mapper.c b/src/backends/meta-input-mapper.c
index cc75f14e8..71d193e5f 100644
--- a/src/backends/meta-input-mapper.c
+++ b/src/backends/meta-input-mapper.c
@@ -455,7 +455,7 @@ guess_candidates (MetaInputMapper *mapper,
g_assert (META_IS_MONITOR (l->data));
- if (match_edid (input, l->data, &edid_match))
+ if (integrated && match_edid (input, l->data, &edid_match))
match.score |= 1 << edid_match;
if (integrated && match_size (input, l->data))
--
2.38.1

38
SOURCES/0001-clutter-Make-ClutterClickAction-independent-of-click.patch

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
From 28030178d7682ce5be03cb7273365ab628065871 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Mon, 27 Sep 2021 20:37:30 +0200
Subject: [PATCH] clutter: Make ClutterClickAction independent of click count

This will trigger for every button press/release that is obtained,
regardless of the click count.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2024>
---
clutter/clutter/clutter-click-action.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/clutter/clutter/clutter-click-action.c b/clutter/clutter/clutter-click-action.c
index 45d87e809..266b6da92 100644
--- a/clutter/clutter/clutter-click-action.c
+++ b/clutter/clutter/clutter-click-action.c
@@ -306,9 +306,6 @@ on_event (ClutterActor *actor,
case CLUTTER_TOUCH_BEGIN:
has_button = FALSE;
case CLUTTER_BUTTON_PRESS:
- if (has_button && clutter_event_get_click_count (event) != 1)
- return CLUTTER_EVENT_PROPAGATE;
-
if (priv->is_held)
return CLUTTER_EVENT_STOP;
@@ -386,7 +383,6 @@ on_captured_event (ClutterActor *stage,
return CLUTTER_EVENT_STOP;
if ((has_button && clutter_event_get_button (event) != priv->press_button) ||
- (has_button && clutter_event_get_click_count (event) != 1) ||
clutter_event_get_device (event) != priv->press_device ||
clutter_event_get_event_sequence (event) != priv->press_sequence)
return CLUTTER_EVENT_PROPAGATE;
--
2.35.1

52
SOURCES/0001-clutter-text-Don-t-query-preferred-size-without-allo.patch

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
From 5cd66485cdd99068dab0f57d7f64d3ef294b0037 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 4 Aug 2021 19:30:10 +0200
Subject: [PATCH] clutter/text: Don't query preferred size without allocation

The size request functions query the resource scale, which hits
an assert if headless. The returned sizes are already only used
when clutter_actor_has_allocation() is true, so this doesn't
change the condition for calling either redraw or relayout.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4522

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1956>
---
clutter/clutter/clutter-text.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/clutter/clutter/clutter-text.c b/clutter/clutter/clutter-text.c
index 45c7eac56b..80e53ea32f 100644
--- a/clutter/clutter/clutter-text.c
+++ b/clutter/clutter/clutter-text.c
@@ -4797,16 +4797,21 @@ static void
clutter_text_queue_redraw_or_relayout (ClutterText *self)
{
ClutterActor *actor = CLUTTER_ACTOR (self);
- gfloat preferred_width;
- gfloat preferred_height;
+ float preferred_width = -1.;
+ float preferred_height = -1.;
clutter_text_dirty_cache (self);
- /* we're using our private implementations here to avoid the caching done by ClutterActor */
- clutter_text_get_preferred_width (actor, -1, NULL, &preferred_width);
- clutter_text_get_preferred_height (actor, preferred_width, NULL, &preferred_height);
+ if (clutter_actor_has_allocation (actor))
+ {
+ /* we're using our private implementations here to avoid the caching done by ClutterActor */
+ clutter_text_get_preferred_width (actor, -1, NULL, &preferred_width);
+ clutter_text_get_preferred_height (actor, preferred_width, NULL,
+ &preferred_height);
+ }
- if (clutter_actor_has_allocation (actor) &&
+ if (preferred_width > 0 &&
+ preferred_height > 0 &&
fabsf (preferred_width - clutter_actor_get_width (actor)) <= 0.001 &&
fabsf (preferred_height - clutter_actor_get_height (actor)) <= 0.001)
clutter_text_queue_redraw (actor);
--
2.31.1

162
SOURCES/0001-core-Change-MetaWaylandTextInput-event-forwarding-to.patch

@ -0,0 +1,162 @@ @@ -0,0 +1,162 @@
From 88b50f5a9e4b1b87e766e929a77aafdc27e335cf Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 7 Jun 2023 11:04:15 +0200
Subject: [PATCH] core: Change MetaWaylandTextInput event forwarding to IMs

We need to juggle with some things here to keep key event ordering
and accounting consistent.

The keyboard internal state changes (and maybe modifier event emission)
happening through meta_wayland_seat_update() should ideally happen
from the same key events that reach the client through wl_keyboard.key,
so that wl_keyboard.modifier events are emitted in the right relative
order to other key events.

In order to fix this, we need to decide at an earlier point whether
the event will get processed through IM (and maybe be reinjected),
thus ignored in wait of IM-postprocessed events.

This means we pay less attention to whether events are first-hand
hardware events for some things and go with the event that does
eventually reach to us (hardware or IM).

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5890
---
src/core/events.c | 8 ++++++++
src/wayland/meta-wayland-keyboard.c | 8 --------
src/wayland/meta-wayland-seat.c | 30 ++++++++++++++++++++++-------
src/wayland/meta-wayland-seat.h | 3 +++
src/wayland/meta-wayland.c | 7 +++++++
src/wayland/meta-wayland.h | 3 +++
6 files changed, 44 insertions(+), 15 deletions(-)

diff --git a/src/core/events.c b/src/core/events.c
index 6bb4e90..7751042 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -234,6 +234,14 @@ meta_display_handle_event (MetaDisplay *display,
if (meta_is_wayland_compositor ())
{
compositor = meta_wayland_compositor_get_default ();
+
+ if (display->event_route == META_EVENT_ROUTE_NORMAL &&
+ meta_wayland_compositor_handle_text_input_event (compositor, event))
+ {
+ bypass_wayland = bypass_clutter = TRUE;
+ goto out;
+ }
+
meta_wayland_compositor_update (compositor, event);
}
#endif
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index 836939c..460d9e9 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -564,14 +564,6 @@ meta_wayland_keyboard_update (MetaWaylandKeyboard *keyboard,
{
gboolean is_press = event->type == CLUTTER_KEY_PRESS;
- /* Only handle real, non-synthetic, events here. The IM is free to reemit
- * key events (incl. modifiers), handling those additionally will result
- * in doubly-pressed keys.
- */
- if ((event->flags &
- (CLUTTER_EVENT_FLAG_SYNTHETIC | CLUTTER_EVENT_FLAG_INPUT_METHOD)) != 0)
- return;
-
/* If we get a key event but still have pending modifier state
* changes from a previous event that didn't get cleared, we need to
* send that state right away so that the new key event can be
diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c
index 25d5074..27d8fe3 100644
--- a/src/wayland/meta-wayland-seat.c
+++ b/src/wayland/meta-wayland-seat.c
@@ -376,6 +376,29 @@ meta_wayland_seat_update (MetaWaylandSeat *seat,
}
}
+gboolean
+meta_wayland_seat_handle_text_input_event (MetaWaylandSeat *seat,
+ const ClutterEvent *event)
+{
+ switch (event->type)
+ {
+ case CLUTTER_KEY_PRESS:
+ case CLUTTER_KEY_RELEASE:
+ if (meta_wayland_text_input_handle_event (seat->text_input, event))
+ return TRUE;
+
+ if (meta_wayland_gtk_text_input_handle_event (seat->gtk_text_input,
+ event))
+ return TRUE;
+
+ break;
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
gboolean
meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
const ClutterEvent *event)
@@ -398,13 +421,6 @@ meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
break;
case CLUTTER_KEY_PRESS:
case CLUTTER_KEY_RELEASE:
- if (meta_wayland_text_input_handle_event (seat->text_input, event))
- return TRUE;
-
- if (meta_wayland_gtk_text_input_handle_event (seat->gtk_text_input,
- event))
- return TRUE;
-
if (meta_wayland_seat_has_keyboard (seat))
return meta_wayland_keyboard_handle_event (seat->keyboard,
(const ClutterKeyEvent *) event);
diff --git a/src/wayland/meta-wayland-seat.h b/src/wayland/meta-wayland-seat.h
index ae4e107..ab90106 100644
--- a/src/wayland/meta-wayland-seat.h
+++ b/src/wayland/meta-wayland-seat.h
@@ -84,4 +84,7 @@ gboolean meta_wayland_seat_has_pointer (MetaWaylandSeat *seat);
gboolean meta_wayland_seat_has_touch (MetaWaylandSeat *seat);
+gboolean meta_wayland_seat_handle_text_input_event (MetaWaylandSeat *seat,
+ const ClutterEvent *event);
+
#endif /* META_WAYLAND_SEAT_H */
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index a3f0984..b548aa1 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -721,3 +721,10 @@ meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor,
meta_wayland_compositor_remove_surface_association (compositor, id);
}
}
+
+gboolean
+meta_wayland_compositor_handle_text_input_event (MetaWaylandCompositor *compositor,
+ const ClutterEvent *event)
+{
+ return meta_wayland_seat_handle_text_input_event (compositor->seat, event);
+}
diff --git a/src/wayland/meta-wayland.h b/src/wayland/meta-wayland.h
index 6c655e4..ad82d52 100644
--- a/src/wayland/meta-wayland.h
+++ b/src/wayland/meta-wayland.h
@@ -92,6 +92,9 @@ void meta_wayland_compositor_schedule_surface_association (Me
int id,
MetaWindow *window);
+gboolean meta_wayland_compositor_handle_text_input_event (MetaWaylandCompositor *compositor,
+ const ClutterEvent *event);
+
void meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor,
int id,
MetaWaylandSurface *surface);
--
2.40.1

26
SOURCES/0001-events-Pass-CurrentTime-to-XIAllowEvents-when-unfree.patch

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
From 65ffd7e4df42cd62633f93107644f87208881578 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 14 Apr 2022 18:07:41 +0200
Subject: [PATCH] events: Pass CurrentTime to XIAllowEvents() when unfreezing
pointer

---
src/core/events.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/events.c b/src/core/events.c
index 0dc3a73222..dd9b4ec981 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -205,7 +205,7 @@ maybe_unfreeze_pointer_events (MetaBackend *backend,
}
xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
- XIAllowEvents (xdisplay, device_id, event_mode, event->button.time);
+ XIAllowEvents (xdisplay, device_id, event_mode, CurrentTime);
}
static gboolean
--
2.34.1

45
SOURCES/0001-gpu-kms-Report-that-we-can-have-outputs-if-we-have-c.patch

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
From 168a47c9ebefaeca6cc25fcbc0d41ac50c16f400 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Wed, 1 Feb 2023 10:07:53 +0100
Subject: [PATCH] gpu/kms: Report that we can have outputs if we have
connectors

As part of https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/525
(introduction of transactional KMS API), the logic determining whether a
GPU can have outputs was changed from whether any connectors existed to
whether any connected connectors existed. That effectively meant that we
wouldn't attempt to start at all if there were no monitors connected
while starting up.

This was unintentional, so lets revert back the expected behavior.
---
src/backends/native/meta-gpu-kms.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
index e81c90a022..2756bddb26 100644
--- a/src/backends/native/meta-gpu-kms.c
+++ b/src/backends/native/meta-gpu-kms.c
@@ -399,18 +399,7 @@ meta_gpu_kms_read_current (MetaGpu *gpu,
gboolean
meta_gpu_kms_can_have_outputs (MetaGpuKms *gpu_kms)
{
- GList *l;
- int n_connected_connectors = 0;
-
- for (l = meta_kms_device_get_connectors (gpu_kms->kms_device); l; l = l->next)
- {
- MetaKmsConnector *kms_connector = l->data;
-
- if (meta_kms_connector_get_current_state (kms_connector))
- n_connected_connectors++;
- }
-
- return n_connected_connectors > 0;
+ return !!meta_kms_device_get_connectors (gpu_kms->kms_device);
}
MetaGpuKms *
--
2.39.1

193
SOURCES/0001-kms-Allow-passing-framebuffer-damage-metadata.patch

@ -0,0 +1,193 @@ @@ -0,0 +1,193 @@
From af0460d0cedd5a66b2110ab2a99e67c647e7b6fb Mon Sep 17 00:00:00 2001
From: Piotr Lopatka <piotr.lopatka@gmail.com>
Date: Fri, 3 Sep 2021 19:39:12 +0100
Subject: [PATCH 1/2] kms: Allow passing framebuffer damage metadata

This commit adds support to atomic KMS backend for optional plane property
prop_fb_damage_clips. Some drivers (e.g. EVDI) take advantage of this
property and process only updated regions of the screen instead of
processing the full frame. This can save system resources.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1879>
---
.../native/meta-kms-impl-device-atomic.c | 28 +++++++++++++++
src/backends/native/meta-kms-plane-private.h | 1 +
src/backends/native/meta-kms-plane.c | 5 +++
src/backends/native/meta-kms-update-private.h | 7 ++++
src/backends/native/meta-kms-update.c | 35 +++++++++++++++++++
src/backends/native/meta-kms-update.h | 4 +++
6 files changed, 80 insertions(+)

diff --git a/src/backends/native/meta-kms-impl-device-atomic.c b/src/backends/native/meta-kms-impl-device-atomic.c
index 8e41207ee14..674a24902bd 100644
--- a/src/backends/native/meta-kms-impl-device-atomic.c
+++ b/src/backends/native/meta-kms-impl-device-atomic.c
@@ -416,6 +416,8 @@ process_plane_assignment (MetaKmsImplDevice *impl_device,
MetaKmsPlaneAssignment *plane_assignment = update_entry;
MetaKmsPlane *plane = plane_assignment->plane;
MetaDrmBuffer *buffer;
+ MetaKmsFbDamage *fb_damage;
+ uint32_t prop_id;
buffer = plane_assignment->buffer;
@@ -539,6 +541,32 @@ process_plane_assignment (MetaKmsImplDevice *impl_device,
return FALSE;
}
+ fb_damage = plane_assignment->fb_damage;
+ if (fb_damage &&
+ meta_kms_plane_get_prop_id (plane,
+ META_KMS_PLANE_PROP_FB_DAMAGE_CLIPS_ID))
+ {
+ meta_topic (META_DEBUG_KMS,
+ "[atomic] Setting %d damage clips on %u",
+ fb_damage->n_rects,
+ meta_kms_plane_get_id (plane));
+
+ prop_id = store_new_blob (impl_device,
+ blob_ids,
+ fb_damage->rects,
+ fb_damage->n_rects *
+ sizeof (struct drm_mode_rect),
+ error);
+ if (!prop_id)
+ return FALSE;
+
+ if (!add_plane_property (impl_device,
+ plane, req,
+ META_KMS_PLANE_PROP_FB_DAMAGE_CLIPS_ID,
+ prop_id,
+ error))
+ return FALSE;
+ }
return TRUE;
}
diff --git a/src/backends/native/meta-kms-plane-private.h b/src/backends/native/meta-kms-plane-private.h
index 92f9cfcc9aa..f735c8da8f6 100644
--- a/src/backends/native/meta-kms-plane-private.h
+++ b/src/backends/native/meta-kms-plane-private.h
@@ -41,6 +41,7 @@ typedef enum _MetaKmsPlaneProp
META_KMS_PLANE_PROP_CRTC_H,
META_KMS_PLANE_PROP_FB_ID,
META_KMS_PLANE_PROP_CRTC_ID,
+ META_KMS_PLANE_PROP_FB_DAMAGE_CLIPS_ID,
META_KMS_PLANE_N_PROPS
} MetaKmsPlaneProp;
diff --git a/src/backends/native/meta-kms-plane.c b/src/backends/native/meta-kms-plane.c
index 73fab7d8f80..3cb58764ff3 100644
--- a/src/backends/native/meta-kms-plane.c
+++ b/src/backends/native/meta-kms-plane.c
@@ -446,6 +446,11 @@ init_properties (MetaKmsPlane *plane,
.name = "CRTC_ID",
.type = DRM_MODE_PROP_OBJECT,
},
+ [META_KMS_PLANE_PROP_FB_DAMAGE_CLIPS_ID] =
+ {
+ .name = "FB_DAMAGE_CLIPS",
+ .type = DRM_MODE_PROP_BLOB,
+ },
}
};
diff --git a/src/backends/native/meta-kms-update-private.h b/src/backends/native/meta-kms-update-private.h
index 22491ece2d5..c89622d09a5 100644
--- a/src/backends/native/meta-kms-update-private.h
+++ b/src/backends/native/meta-kms-update-private.h
@@ -34,6 +34,12 @@ typedef struct _MetaKmsFeedback
GError *error;
} MetaKmsFeedback;
+typedef struct _MetaKmsFbDamage
+{
+ struct drm_mode_rect *rects;
+ int n_rects;
+} MetaKmsFbDamage;
+
typedef struct _MetaKmsPlaneAssignment
{
MetaKmsUpdate *update;
@@ -43,6 +49,7 @@ typedef struct _MetaKmsPlaneAssignment
MetaFixed16Rectangle src_rect;
MetaRectangle dst_rect;
MetaKmsAssignPlaneFlag flags;
+ MetaKmsFbDamage *fb_damage;
uint64_t rotation;
diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c
index be6eaefcc2c..71e5b423fb7 100644
--- a/src/backends/native/meta-kms-update.c
+++ b/src/backends/native/meta-kms-update.c
@@ -129,9 +129,17 @@ meta_kms_feedback_get_error (const MetaKmsFeedback *feedback)
return feedback->error;
}
+static void
+meta_kms_fb_damage_free (MetaKmsFbDamage *fb_damage)
+{
+ g_free (fb_damage->rects);
+ g_free (fb_damage);
+}
+
static void
meta_kms_plane_assignment_free (MetaKmsPlaneAssignment *plane_assignment)
{
+ g_clear_pointer (&plane_assignment->fb_damage, meta_kms_fb_damage_free);
g_free (plane_assignment);
}
@@ -456,6 +464,33 @@ meta_kms_update_set_custom_page_flip (MetaKmsUpdate *update,
update->custom_page_flip = custom_page_flip;
}
+void
+meta_kms_plane_assignment_set_fb_damage (MetaKmsPlaneAssignment *plane_assignment,
+ const int *rectangles,
+ int n_rectangles)
+{
+ MetaKmsFbDamage *fb_damage;
+ struct drm_mode_rect *mode_rects;
+ int i;
+
+ mode_rects = g_new0 (struct drm_mode_rect, n_rectangles);
+ for (i = 0; i < n_rectangles; ++i)
+ {
+ mode_rects[i].x1 = rectangles[i * 4];
+ mode_rects[i].y1 = rectangles[i * 4 + 1];
+ mode_rects[i].x2 = mode_rects[i].x1 + rectangles[i * 4 + 2];
+ mode_rects[i].y2 = mode_rects[i].y1 + rectangles[i * 4 + 3];
+ }
+
+ fb_damage = g_new0 (MetaKmsFbDamage, 1);
+ *fb_damage = (MetaKmsFbDamage) {
+ .rects = mode_rects,
+ .n_rects = n_rectangles,
+ };
+
+ plane_assignment->fb_damage = fb_damage;
+}
+
void
meta_kms_plane_assignment_set_rotation (MetaKmsPlaneAssignment *plane_assignment,
uint64_t rotation)
diff --git a/src/backends/native/meta-kms-update.h b/src/backends/native/meta-kms-update.h
index 4a6a8bb4373..e63b6d8711d 100644
--- a/src/backends/native/meta-kms-update.h
+++ b/src/backends/native/meta-kms-update.h
@@ -115,6 +115,10 @@ void meta_kms_update_set_crtc_gamma (MetaKmsUpdate *update,
const uint16_t *green,
const uint16_t *blue);
+void meta_kms_plane_assignment_set_fb_damage (MetaKmsPlaneAssignment *plane_assignment,
+ const int *rectangles,
+ int n_rectangles);
+
MetaKmsPlaneAssignment * meta_kms_update_assign_plane (MetaKmsUpdate *update,
MetaKmsCrtc *crtc,
MetaKmsPlane *plane,
--
2.36.1

46
SOURCES/0001-kms-crtc-Add-function-meta_kms_crtc_has_gamma.patch

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
From de3188fcc6863b8a6e3d2443a00cf3b00f6f26ff Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Tue, 12 Apr 2022 18:34:58 +0800
Subject: [PATCH 1/2] kms/crtc: Add function meta_kms_crtc_has_gamma

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2360>
---
src/backends/native/meta-kms-crtc.c | 7 +++++++
src/backends/native/meta-kms-crtc.h | 3 +++
2 files changed, 10 insertions(+)

diff --git a/src/backends/native/meta-kms-crtc.c b/src/backends/native/meta-kms-crtc.c
index 51d040b44..24f5a2d74 100644
--- a/src/backends/native/meta-kms-crtc.c
+++ b/src/backends/native/meta-kms-crtc.c
@@ -92,6 +92,13 @@ meta_kms_crtc_is_active (MetaKmsCrtc *crtc)
return crtc->current_state.is_active;
}
+
+gboolean
+meta_kms_crtc_has_gamma (MetaKmsCrtc *crtc)
+{
+ return !!meta_kms_crtc_get_prop_id (crtc, META_KMS_CRTC_PROP_GAMMA_LUT);
+}
+
static void
read_gamma_state (MetaKmsCrtc *crtc,
MetaKmsImplDevice *impl_device,
diff --git a/src/backends/native/meta-kms-crtc.h b/src/backends/native/meta-kms-crtc.h
index 406ca3ac1..cbaeaa280 100644
--- a/src/backends/native/meta-kms-crtc.h
+++ b/src/backends/native/meta-kms-crtc.h
@@ -66,6 +66,9 @@ uint32_t meta_kms_crtc_get_id (MetaKmsCrtc *crtc);
int meta_kms_crtc_get_idx (MetaKmsCrtc *crtc);
+
+gboolean meta_kms_crtc_has_gamma (MetaKmsCrtc *crtc);
+
gboolean meta_kms_crtc_is_active (MetaKmsCrtc *crtc);
void meta_kms_crtc_gamma_free (MetaKmsCrtcGamma *gamma);
--
2.35.1

218
SOURCES/0001-monitor-manager-Add-NightLightSupported-property-to-.patch

@ -0,0 +1,218 @@ @@ -0,0 +1,218 @@
From f21c8614daeb70a021c128b97c000a92652cf6f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 24 Feb 2022 12:32:27 +0100
Subject: [PATCH] monitor-manager: Add NightLightSupported property to
DisplayConfig

This checks whether it's possible to set a CRTC GAMMA_LUT, which is what
is necessary to implement night light.
---
src/backends/meta-monitor-manager.c | 76 ++++++++++++++++---
.../native/meta-monitor-manager-native.c | 25 ++++--
.../x11/meta-monitor-manager-xrandr.c | 9 ++-
src/org.gnome.Mutter.DisplayConfig.xml | 7 ++
4 files changed, 99 insertions(+), 18 deletions(-)

diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index 75146950c3..0f30b3de25 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -952,6 +952,59 @@ update_panel_orientation_managed (MetaMonitorManager *manager)
handle_orientation_change (orientation_manager, manager);
}
+static void
+meta_monitor_manager_get_crtc_gamma (MetaMonitorManager *manager,
+ MetaCrtc *crtc,
+ size_t *size,
+ unsigned short **red,
+ unsigned short **green,
+ unsigned short **blue)
+{
+ MetaMonitorManagerClass *klass = META_MONITOR_MANAGER_GET_CLASS (manager);
+
+ if (klass->get_crtc_gamma)
+ {
+ klass->get_crtc_gamma (manager, crtc, size, red, green, blue);
+ }
+ else
+ {
+ if (size)
+ *size = 0;
+ if (red)
+ *red = NULL;
+ if (green)
+ *green = NULL;
+ if (blue)
+ *blue = NULL;
+ }
+}
+
+static gboolean
+is_night_light_supported (MetaMonitorManager *manager)
+{
+ GList *l;
+
+ for (l = meta_backend_get_gpus (manager->backend); l; l = l->next)
+ {
+ MetaGpu *gpu = l->data;
+ GList *l_crtc;
+
+ for (l_crtc = meta_gpu_get_crtcs (gpu); l_crtc; l_crtc = l_crtc->next)
+ {
+ MetaCrtc *crtc = l_crtc->data;
+ size_t gamma_lut_size;
+
+ meta_monitor_manager_get_crtc_gamma (manager, crtc,
+ &gamma_lut_size,
+ NULL, NULL, NULL);
+ if (gamma_lut_size > 0)
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
void
meta_monitor_manager_setup (MetaMonitorManager *manager)
{
@@ -967,7 +1020,6 @@ meta_monitor_manager_setup (MetaMonitorManager *manager)
meta_dbus_display_config_set_apply_monitors_config_allowed (manager->display_config,
policy->enable_dbus);
-
meta_monitor_manager_read_current_state (manager);
meta_monitor_manager_ensure_initial_config (manager);
@@ -2445,7 +2497,6 @@ meta_monitor_manager_handle_get_crtc_gamma (MetaDBusDisplayConfig *skeleton,
guint crtc_id,
MetaMonitorManager *manager)
{
- MetaMonitorManagerClass *klass;
GList *combined_crtcs;
MetaCrtc *crtc;
gsize size;
@@ -2476,14 +2527,8 @@ meta_monitor_manager_handle_get_crtc_gamma (MetaDBusDisplayConfig *skeleton,
crtc = g_list_nth_data (combined_crtcs, crtc_id);
g_list_free (combined_crtcs);
- klass = META_MONITOR_MANAGER_GET_CLASS (manager);
- if (klass->get_crtc_gamma)
- klass->get_crtc_gamma (manager, crtc, &size, &red, &green, &blue);
- else
- {
- size = 0;
- red = green = blue = NULL;
- }
+ meta_monitor_manager_get_crtc_gamma (manager, crtc,
+ &size, &red, &green, &blue);
red_bytes = g_bytes_new_take (red, size * sizeof (unsigned short));
green_bytes = g_bytes_new_take (green, size * sizeof (unsigned short));
@@ -3078,6 +3123,16 @@ meta_monitor_manager_is_transform_handled (MetaMonitorManager *manager,
return manager_class->is_transform_handled (manager, crtc, transform);
}
+static void
+update_night_light_supported (MetaMonitorManager *manager)
+{
+ gboolean night_light_supported;
+
+ night_light_supported = is_night_light_supported (manager);
+ meta_dbus_display_config_set_night_light_supported (manager->display_config,
+ night_light_supported);
+}
+
static void
meta_monitor_manager_real_read_current_state (MetaMonitorManager *manager)
{
@@ -3098,6 +3153,7 @@ meta_monitor_manager_real_read_current_state (MetaMonitorManager *manager)
}
rebuild_monitors (manager);
+ update_night_light_supported (manager);
}
void
diff --git a/src/backends/native/meta-monitor-manager-native.c b/src/backends/native/meta-monitor-manager-native.c
index fd5e7784ff..37a50f1d6f 100644
--- a/src/backends/native/meta-monitor-manager-native.c
+++ b/src/backends/native/meta-monitor-manager-native.c
@@ -381,15 +381,30 @@ meta_monitor_manager_native_get_crtc_gamma (MetaMonitorManager *manager,
MetaKmsCrtc *kms_crtc;
const MetaKmsCrtcState *crtc_state;
- g_return_if_fail (META_IS_CRTC_KMS (crtc));
+ if (!META_IS_CRTC_KMS (crtc))
+ {
+ if (size)
+ *size = 0;
+ if (red)
+ *red = NULL;
+ if (green)
+ *green = NULL;
+ if (blue)
+ *blue = NULL;
+ return;
+ }
kms_crtc = meta_crtc_kms_get_kms_crtc (META_CRTC_KMS (crtc));
crtc_state = meta_kms_crtc_get_current_state (kms_crtc);
- *size = crtc_state->gamma.size;
- *red = g_memdup2 (crtc_state->gamma.red, *size * sizeof **red);
- *green = g_memdup2 (crtc_state->gamma.green, *size * sizeof **green);
- *blue = g_memdup2 (crtc_state->gamma.blue, *size * sizeof **blue);
+ if (size)
+ *size = crtc_state->gamma.size;
+ if (red)
+ *red = g_memdup2 (crtc_state->gamma.red, *size * sizeof **red);
+ if (green)
+ *green = g_memdup2 (crtc_state->gamma.green, *size * sizeof **green);
+ if (blue)
+ *blue = g_memdup2 (crtc_state->gamma.blue, *size * sizeof **blue);
}
static char *
diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index 98eb080b6b..865f4e5800 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -707,9 +707,12 @@ meta_monitor_manager_xrandr_get_crtc_gamma (MetaMonitorManager *manager,
(XID) meta_crtc_get_id (crtc));
*size = gamma->size;
- *red = g_memdup2 (gamma->red, sizeof (unsigned short) * gamma->size);
- *green = g_memdup2 (gamma->green, sizeof (unsigned short) * gamma->size);
- *blue = g_memdup2 (gamma->blue, sizeof (unsigned short) * gamma->size);
+ if (red)
+ *red = g_memdup2 (gamma->red, sizeof (unsigned short) * gamma->size);
+ if (green)
+ *green = g_memdup2 (gamma->green, sizeof (unsigned short) * gamma->size);
+ if (blue)
+ *blue = g_memdup2 (gamma->blue, sizeof (unsigned short) * gamma->size);
XRRFreeGamma (gamma);
}
diff --git a/src/org.gnome.Mutter.DisplayConfig.xml b/src/org.gnome.Mutter.DisplayConfig.xml
index c6859c2c09..5f85c5e271 100644
--- a/src/org.gnome.Mutter.DisplayConfig.xml
+++ b/src/org.gnome.Mutter.DisplayConfig.xml
@@ -297,6 +297,13 @@
-->
<property name="ApplyMonitorsConfigAllowed" type="b" access="read" />
+ <!--
+ NightLightSupported:
+
+ Whether night light is supported by this system.
+ -->
+ <property name="NightLightSupported" type="b" access="read" />
+
<!--
MonitorsChanged:
--
2.37.1

107
SOURCES/0001-output-kms-Add-more-heuristics-to-decide-when-to-off.patch

@ -0,0 +1,107 @@ @@ -0,0 +1,107 @@
From 86000c32d64cea7be2e6ed911cb9ea5df1306c0e Mon Sep 17 00:00:00 2001
From: Mario Limonciello <mario.limonciello@amd.com>
Date: Thu, 18 Aug 2022 13:36:20 -0500
Subject: [PATCH 1/2] output/kms: Add more heuristics to decide when to offer
fallback modes

If the panel is connected via eDP and supports more than one mode
at different resolutions don't try to add more.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2586>
(cherry picked from commit 96aa0fb8536eca579ceb1b17d83e19cf9e3e9e81)
(cherry picked from commit 877cc3eb7d44e2886395151f763ec09bea350444)
---
src/backends/native/meta-output-kms.c | 56 +++++++++++++++++++++------
1 file changed, 44 insertions(+), 12 deletions(-)

diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c
index f35cdf04e1..9adc20bfd9 100644
--- a/src/backends/native/meta-output-kms.c
+++ b/src/backends/native/meta-output-kms.c
@@ -224,6 +224,45 @@ compare_modes (const void *one,
meta_crtc_mode_get_name (crtc_mode_two));
}
+static gboolean
+are_all_modes_equally_sized (MetaOutputInfo *output_info)
+{
+ const MetaCrtcModeInfo *base =
+ meta_crtc_mode_get_info (output_info->modes[0]);
+ int i;
+
+ for (i = 1; i < output_info->n_modes; i++)
+ {
+ const MetaCrtcModeInfo *mode_info =
+ meta_crtc_mode_get_info (output_info->modes[i]);
+
+ if (base->width != mode_info->width ||
+ base->height != mode_info->height)
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void
+maybe_add_fallback_modes (const MetaKmsConnectorState *connector_state,
+ MetaOutputInfo *output_info,
+ MetaGpuKms *gpu_kms,
+ MetaKmsConnector *kms_connector)
+{
+ if (!connector_state->has_scaling)
+ return;
+
+ if (output_info->connector_type == DRM_MODE_CONNECTOR_eDP &&
+ !are_all_modes_equally_sized (output_info))
+ return;
+
+ meta_topic (META_DEBUG_KMS, "Adding common modes to connector %u on %s",
+ meta_kms_connector_get_id (kms_connector),
+ meta_gpu_kms_get_file_path (gpu_kms));
+ add_common_modes (output_info, gpu_kms);
+}
+
static gboolean
init_output_modes (MetaOutputInfo *output_info,
MetaGpuKms *gpu_kms,
@@ -252,14 +291,7 @@ init_output_modes (MetaOutputInfo *output_info,
output_info->preferred_mode = output_info->modes[i];
}
- if (connector_state->has_scaling)
- {
- meta_topic (META_DEBUG_KMS, "Adding common modes to connector %u on %s",
- meta_kms_connector_get_id (kms_connector),
- meta_gpu_kms_get_file_path (gpu_kms));
- add_common_modes (output_info, gpu_kms);
- }
-
+ maybe_add_fallback_modes (connector_state, output_info, gpu_kms, kms_connector);
if (!output_info->modes)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@@ -322,6 +354,10 @@ meta_output_kms_new (MetaGpuKms *gpu_kms,
output_info->height_mm = connector_state->height_mm;
}
+ drm_connector_type = meta_kms_connector_get_connector_type (kms_connector);
+ output_info->connector_type =
+ meta_kms_connector_type_from_drm (drm_connector_type);
+
if (!init_output_modes (output_info, gpu_kms, kms_connector, error))
return NULL;
@@ -349,10 +385,6 @@ meta_output_kms_new (MetaGpuKms *gpu_kms,
meta_output_info_parse_edid (output_info, connector_state->edid_data);
- drm_connector_type = meta_kms_connector_get_connector_type (kms_connector);
- output_info->connector_type =
- meta_kms_connector_type_from_drm (drm_connector_type);
-
output_info->tile_info = connector_state->tile_info;
output = g_object_new (META_TYPE_OUTPUT_KMS,
--
2.37.1

63
SOURCES/0001-renderer-native-Log-render-mode-per-device.patch

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
From fa70ee1cd78e2b161545bc47a1c1083063030f77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Mon, 11 Oct 2021 10:52:43 +0200
Subject: [PATCH 1/5] renderer/native: Log render mode per device

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2051>
(cherry picked from commit e8249a572d669c4c0a8464d6bce556b2cbaca4ef)
(cherry picked from commit fe0ea79b83256d80f1dee1e4a49c94a5d6fd18a6)
---
src/backends/native/meta-renderer-native.c | 30 ++++++++++++++++++++++
1 file changed, 30 insertions(+)

diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 735c37202..f92f648e5 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -1808,6 +1808,24 @@ meta_renderer_native_create_renderer_gpu_data (MetaRendererNative *renderer_nat
return NULL;
}
+static const char *
+renderer_data_mode_to_string (MetaRendererNativeMode mode)
+{
+ switch (mode)
+ {
+ case META_RENDERER_NATIVE_MODE_GBM:
+ return "gbm";
+ case META_RENDERER_NATIVE_MODE_SURFACELESS:
+ return "surfaceless";
+#ifdef HAVE_EGL_DEVICE
+ case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
+ return "egldevice";
+#endif
+ }
+
+ g_assert_not_reached ();
+}
+
static gboolean
create_renderer_gpu_data (MetaRendererNative *renderer_native,
MetaGpuKms *gpu_kms,
@@ -1822,6 +1840,18 @@ create_renderer_gpu_data (MetaRendererNative *renderer_native,
if (!renderer_gpu_data)
return FALSE;
+ if (gpu_kms)
+ {
+ g_message ("Created %s renderer for '%s'",
+ renderer_data_mode_to_string (renderer_gpu_data->mode),
+ meta_gpu_kms_get_file_path (gpu_kms));
+ }
+ else
+ {
+ g_message ("Created %s renderer without GPU",
+ renderer_data_mode_to_string (renderer_gpu_data->mode));
+ }
+
g_hash_table_insert (renderer_native->gpu_datas,
gpu_kms,
renderer_gpu_data);
--
2.35.1

43
SOURCES/0002-crtc-kms-Don-t-add-gamma-to-the-update-if-unsupporte.patch

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
From 69c40c6d126a5c804db54ce0afe581362e4fd33b Mon Sep 17 00:00:00 2001
From: Daniel van Vugt <daniel.van.vugt@canonical.com>
Date: Tue, 12 Apr 2022 18:37:29 +0800
Subject: [PATCH 2/2] crtc/kms: Don't add gamma to the update if unsupported by
the CRTC

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2197
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2360>
---
src/backends/native/meta-crtc-kms.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/backends/native/meta-crtc-kms.c b/src/backends/native/meta-crtc-kms.c
index f1bc79146..953f023ce 100644
--- a/src/backends/native/meta-crtc-kms.c
+++ b/src/backends/native/meta-crtc-kms.c
@@ -201,10 +201,14 @@ meta_crtc_kms_maybe_set_gamma (MetaCrtcKms *crtc_kms,
MetaKms *kms = meta_kms_device_get_kms (kms_device);
MetaKmsUpdate *kms_update;
MetaKmsCrtcGamma *gamma;
+ MetaKmsCrtc *kms_crtc = meta_crtc_kms_get_kms_crtc (crtc_kms);
if (crtc_kms->is_gamma_valid)
return;
+ if (!meta_kms_crtc_has_gamma (kms_crtc))
+ return;
+
gamma = meta_monitor_manager_native_get_cached_crtc_gamma (monitor_manager_native,
crtc_kms);
if (!gamma)
@@ -212,7 +216,7 @@ meta_crtc_kms_maybe_set_gamma (MetaCrtcKms *crtc_kms,
kms_update = meta_kms_ensure_pending_update (kms, kms_device);
meta_kms_update_set_crtc_gamma (kms_update,
- meta_crtc_kms_get_kms_crtc (crtc_kms),
+ kms_crtc,
gamma->size,
gamma->red,
gamma->green,
--
2.35.1

120
SOURCES/0002-onscreen-native-Pass-damage-rectangles-when-page-fli.patch

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
From b328c8cc8b0b31a4afe2bfc857c6ea5a2b837ef2 Mon Sep 17 00:00:00 2001
From: Piotr Lopatka <piotr.lopatka@gmail.com>
Date: Fri, 3 Sep 2021 20:01:59 +0100
Subject: [PATCH 2/2] onscreen/native: Pass damage rectangles when page
flipping

This commit passes damage rectangles metadata to the (KMS) primary
plane.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1879>
---
src/backends/native/meta-crtc-kms.c | 4 +++-
src/backends/native/meta-crtc-kms.h | 6 +++---
src/backends/native/meta-onscreen-native.c | 22 ++++++++++++++++++----
3 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/src/backends/native/meta-crtc-kms.c b/src/backends/native/meta-crtc-kms.c
index f1bc79146af..fde64817532 100644
--- a/src/backends/native/meta-crtc-kms.c
+++ b/src/backends/native/meta-crtc-kms.c
@@ -115,7 +115,7 @@ meta_crtc_kms_apply_transform (MetaCrtcKms *crtc_kms,
hw_transform);
}
-void
+MetaKmsPlaneAssignment *
meta_crtc_kms_assign_primary_plane (MetaCrtcKms *crtc_kms,
MetaDrmBuffer *buffer,
MetaKmsUpdate *kms_update)
@@ -161,6 +161,8 @@ meta_crtc_kms_assign_primary_plane (MetaCrtcKms *crtc_kms,
dst_rect,
flags);
meta_crtc_kms_apply_transform (crtc_kms, plane_assignment);
+
+ return plane_assignment;
}
static GList *
diff --git a/src/backends/native/meta-crtc-kms.h b/src/backends/native/meta-crtc-kms.h
index f8d241bbb51..bd80835f986 100644
--- a/src/backends/native/meta-crtc-kms.h
+++ b/src/backends/native/meta-crtc-kms.h
@@ -48,9 +48,9 @@ void meta_crtc_kms_set_cursor_renderer_private (MetaCrtcKms *crtc_kms,
void meta_crtc_kms_apply_transform (MetaCrtcKms *crtc_kms,
MetaKmsPlaneAssignment *kms_plane_assignment);
-void meta_crtc_kms_assign_primary_plane (MetaCrtcKms *crtc_kms,
- MetaDrmBuffer *buffer,
- MetaKmsUpdate *kms_update);
+MetaKmsPlaneAssignment * meta_crtc_kms_assign_primary_plane (MetaCrtcKms *crtc_kms,
+ MetaDrmBuffer *buffer,
+ MetaKmsUpdate *kms_update);
void meta_crtc_kms_set_mode (MetaCrtcKms *crtc_kms,
MetaKmsUpdate *kms_update);
diff --git a/src/backends/native/meta-onscreen-native.c b/src/backends/native/meta-onscreen-native.c
index 112bd0d438b..00b2d9f89cc 100644
--- a/src/backends/native/meta-onscreen-native.c
+++ b/src/backends/native/meta-onscreen-native.c
@@ -416,7 +416,9 @@ static void
meta_onscreen_native_flip_crtc (CoglOnscreen *onscreen,
MetaRendererView *view,
MetaCrtc *crtc,
- MetaKmsPageFlipListenerFlag flags)
+ MetaKmsPageFlipListenerFlag flags,
+ const int *rectangles,
+ int n_rectangles)
{
MetaOnscreenNative *onscreen_native = META_ONSCREEN_NATIVE (onscreen);
MetaRendererNative *renderer_native = onscreen_native->renderer_native;
@@ -430,6 +432,7 @@ meta_onscreen_native_flip_crtc (CoglOnscreen *onscreen,
MetaKmsUpdate *kms_update;
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state = NULL;
MetaDrmBuffer *buffer;
+ MetaKmsPlaneAssignment *plane_assignment;
COGL_TRACE_BEGIN_SCOPED (MetaOnscreenNativeFlipCrtcs,
"Onscreen (flip CRTCs)");
@@ -456,8 +459,15 @@ meta_onscreen_native_flip_crtc (CoglOnscreen *onscreen,
buffer = secondary_gpu_state->gbm.next_fb;
}
- meta_crtc_kms_assign_primary_plane (crtc_kms, buffer, kms_update);
+ plane_assignment = meta_crtc_kms_assign_primary_plane (crtc_kms,
+ buffer,
+ kms_update);
+ if (rectangles != NULL && n_rectangles != 0)
+ {
+ meta_kms_plane_assignment_set_fb_damage (plane_assignment,
+ rectangles, n_rectangles);
+ }
break;
case META_RENDERER_NATIVE_MODE_SURFACELESS:
g_assert_not_reached ();
@@ -1081,7 +1091,9 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
meta_onscreen_native_flip_crtc (onscreen,
onscreen_native->view,
onscreen_native->crtc,
- META_KMS_PAGE_FLIP_LISTENER_FLAG_NONE);
+ META_KMS_PAGE_FLIP_LISTENER_FLAG_NONE,
+ rectangles,
+ n_rectangles);
}
else
{
@@ -1299,7 +1311,9 @@ meta_onscreen_native_direct_scanout (CoglOnscreen *onscreen,
meta_onscreen_native_flip_crtc (onscreen,
onscreen_native->view,
onscreen_native->crtc,
- META_KMS_PAGE_FLIP_LISTENER_FLAG_DROP_ON_ERROR);
+ META_KMS_PAGE_FLIP_LISTENER_FLAG_DROP_ON_ERROR,
+ NULL,
+ 0);
kms_crtc = meta_crtc_kms_get_kms_crtc (META_CRTC_KMS (onscreen_native->crtc));
kms_device = meta_kms_crtc_get_device (kms_crtc);
--
2.36.1

47
SOURCES/0002-output-kms-Don-t-attemp-to-add-common-modes-on-conne.patch

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
From cd8b90a7a7185c3f177469d1a37654a9e8539cd1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 29 Sep 2022 14:23:55 +0200
Subject: [PATCH 2/2] output/kms: Don't attemp to add common modes on
connectors without modes

We have no way to sanely add safe modes if there are no modes we can
compare with, thus don't try.

Fixes the following crash:

#0 are_all_modes_equally_sized at ../src/backends/native/meta-output-kms.c:284
#1 maybe_add_fallback_modes at ../src/backends/native/meta-output-kms.c:310
#2 init_output_modes at ../src/backends/native/meta-output-kms.c:347
#3 meta_output_kms_new at ../src/backends/native/meta-output-kms.c:414
#4 init_outputs at ../src/backends/native/meta-gpu-kms.c:332
#5 meta_gpu_kms_read_current at ../src/backends/native/meta-gpu-kms.c:368
#6 meta_gpu_kms_new at ../src/backends/native/meta-gpu-kms.c:403
#7 create_gpu_from_udev_device at ../src/backends/native/meta-backend-native.c:461
#8 init_gpus at ../src/backends/native/meta-backend-native.c:551
#9 meta_backend_native_initable_init at ../src/backends/native/meta-backend-native.c:632

Fixes: 877cc3eb7d44e2886395151f763ec09bea350444
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2127801
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2646>
(cherry picked from commit 2c8adb19660cb2cd53381372833e088962437d3b)
---
src/backends/native/meta-output-kms.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c
index 9adc20bfd9..058ab7c053 100644
--- a/src/backends/native/meta-output-kms.c
+++ b/src/backends/native/meta-output-kms.c
@@ -250,6 +250,9 @@ maybe_add_fallback_modes (const MetaKmsConnectorState *connector_state,
MetaGpuKms *gpu_kms,
MetaKmsConnector *kms_connector)
{
+ if (!connector_state->modes)
+ return;
+
if (!connector_state->has_scaling)
return;
--
2.37.1

94
SOURCES/0002-renderer-native-Try-the-gbm-renderer-before-the-EGLD.patch

@ -0,0 +1,94 @@ @@ -0,0 +1,94 @@
From 425710866438a62843b96272a6cbc6c22174f10c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Mon, 11 Oct 2021 10:39:43 +0200
Subject: [PATCH 2/5] renderer/native: Try the gbm renderer before the
EGLDevice renderer

This switches the order of what renderer mode is tried first, so that
the gbm renderer mode is preferred on an NVIDIA driver where it is
supported.

We fall back to still try the EGLDevice renderer mode if the created gbm
renderer is not hardware accelerated.

The last fallback is still to use the gbm renderer, even if it is not
hardware accelerated, as this is needed when hardware acceleration isn't
available at all. The original reason for the old order was due to the
fact that a gbm renderer without hardware acceleration would succeed
even on NVIDIA driver that didn't support gbm.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2051>
(cherry picked from commit 8fc1325e8e713dfa05a12c47e6e981e50d3cda61)
---
src/backends/native/meta-renderer-native.c | 44 +++++++++++-----------
1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index f92f648e5..c851619a1 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -1754,38 +1754,40 @@ meta_renderer_native_create_renderer_gpu_data (MetaRendererNative *renderer_nat
MetaGpuKms *gpu_kms,
GError **error)
{
- MetaRendererNativeGpuData *renderer_gpu_data;
+ MetaRendererNativeGpuData *gbm_renderer_gpu_data;
GError *gbm_error = NULL;
#ifdef HAVE_EGL_DEVICE
+ MetaRendererNativeGpuData *egl_stream_renderer_gpu_data;
GError *egl_device_error = NULL;
#endif
if (!gpu_kms)
return create_renderer_gpu_data_surfaceless (renderer_native, error);
-#ifdef HAVE_EGL_DEVICE
- /* Try to initialize the EGLDevice backend first. Whenever we use a
- * non-NVIDIA GPU, the EGLDevice enumeration function won't find a match, and
- * we'll fall back to GBM (which will always succeed as it has a software
- * rendering fallback)
- */
- renderer_gpu_data = create_renderer_gpu_data_egl_device (renderer_native,
- gpu_kms,
- &egl_device_error);
- if (renderer_gpu_data)
- return renderer_gpu_data;
-#endif
-
- renderer_gpu_data = create_renderer_gpu_data_gbm (renderer_native,
- gpu_kms,
- &gbm_error);
- if (renderer_gpu_data)
+ gbm_renderer_gpu_data = create_renderer_gpu_data_gbm (renderer_native,
+ gpu_kms,
+ &gbm_error);
+ if (gbm_renderer_gpu_data)
{
+ if (gbm_renderer_gpu_data->secondary.is_hardware_rendering)
+ return gbm_renderer_gpu_data;
+ }
+
#ifdef HAVE_EGL_DEVICE
- g_error_free (egl_device_error);
-#endif
- return renderer_gpu_data;
+ egl_stream_renderer_gpu_data =
+ create_renderer_gpu_data_egl_device (renderer_native,
+ gpu_kms,
+ &egl_device_error);
+ if (egl_stream_renderer_gpu_data)
+ {
+ g_clear_pointer (&gbm_renderer_gpu_data,
+ meta_renderer_native_gpu_data_free);
+ return egl_stream_renderer_gpu_data;
}
+#endif
+
+ if (gbm_renderer_gpu_data)
+ return gbm_renderer_gpu_data;
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_FAILED,
--
2.35.1

37
SOURCES/0003-kms-crtc-Determine-gamma-support-given-the-gamma-len.patch

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
From 8d6e41fc9b5194fb24523c939de54a2af46b5d07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 27 May 2022 18:19:27 +0200
Subject: [PATCH] kms/crtc: Determine gamma support given the gamma length

The property doesn't necessarily exist when using drivers that doesn't
support atomic mode setting, and the way it worked will break night
light and other gamma related features. This makes things use the gamma
length; if it is higher than 0, it definitely supports it one way or the
other, i.e. GAMMA_LUT with the atomic backend, and drmModeCrtcSetGamma()
with the legacy/simple backend.

Fixes: 364572b95c8354ac66674064a8058aa98bc0bbef
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2287
(cherry picked from commit a2ebd10f049d888e451938e23a035ed97e0c8eff)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2452>
---
src/backends/native/meta-kms-crtc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backends/native/meta-kms-crtc.c b/src/backends/native/meta-kms-crtc.c
index 24f5a2d7400..0513af947c9 100644
--- a/src/backends/native/meta-kms-crtc.c
+++ b/src/backends/native/meta-kms-crtc.c
@@ -96,7 +96,7 @@ meta_kms_crtc_is_active (MetaKmsCrtc *crtc)
gboolean
meta_kms_crtc_has_gamma (MetaKmsCrtc *crtc)
{
- return !!meta_kms_crtc_get_prop_id (crtc, META_KMS_CRTC_PROP_GAMMA_LUT);
+ return crtc->current_state.gamma.size > 0;
}
static void
--
2.36.1

100
SOURCES/0003-wayland-Only-init-EGLStream-controller-if-we-didn-t-.patch

@ -0,0 +1,100 @@ @@ -0,0 +1,100 @@
From 07f63ad466b66cc02b49a326789686bce9325201 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 14 Oct 2021 18:36:43 +0200
Subject: [PATCH 3/5] wayland: Only init EGLStream controller if we didn't end
up with gbm

When we use gbm together with the NVIDIA driver, we want the EGL/Vulkan
clients to do the same, instead of using the EGLStream paths. To achieve
that, make sure to only initialize the EGLStream controller when we
didn't end up using gbm as the renderer backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2052>
(cherry picked from commit ac907119ae0f415c099976635c3b1dff4d2d7201)
(cherry picked from commit e3931f7b8cbd44072137c5dc9de9041486daeade)
---
src/backends/native/meta-renderer-native.c | 11 +++++++++
src/backends/native/meta-renderer-native.h | 2 ++
src/wayland/meta-wayland.c | 26 ++++++++++++++++++++--
3 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index c851619a1..e7460fbf1 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -201,6 +201,17 @@ meta_renderer_native_has_pending_mode_set (MetaRendererNative *renderer_native)
return renderer_native->pending_mode_set;
}
+MetaRendererNativeMode
+meta_renderer_native_get_mode (MetaRendererNative *renderer_native)
+{
+ MetaGpuKms *primary_gpu = renderer_native->primary_gpu_kms;
+ MetaRendererNativeGpuData *primary_gpu_data;
+
+ primary_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
+ primary_gpu);
+ return primary_gpu_data->mode;
+}
+
static void
meta_renderer_native_disconnect (CoglRenderer *cogl_renderer)
{
diff --git a/src/backends/native/meta-renderer-native.h b/src/backends/native/meta-renderer-native.h
index 9475e1857..8c06c2473 100644
--- a/src/backends/native/meta-renderer-native.h
+++ b/src/backends/native/meta-renderer-native.h
@@ -66,4 +66,6 @@ void meta_renderer_native_reset_modes (MetaRendererNative *renderer_native);
gboolean meta_renderer_native_use_modifiers (MetaRendererNative *renderer_native);
+MetaRendererNativeMode meta_renderer_native_get_mode (MetaRendererNative *renderer_native);
+
#endif /* META_RENDERER_NATIVE_H */
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 8f16aa429..a3f098410 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -50,6 +50,10 @@
#include "wayland/meta-xwayland-private.h"
#include "wayland/meta-xwayland.h"
+#ifdef HAVE_NATIVE_BACKEND
+#include "backends/native/meta-renderer-native.h"
+#endif
+
static char *_display_name_override;
G_DEFINE_TYPE (MetaWaylandCompositor, meta_wayland_compositor, G_TYPE_OBJECT)
@@ -521,8 +525,26 @@ meta_wayland_compositor_setup (MetaWaylandCompositor *compositor)
compositor);
#ifdef HAVE_WAYLAND_EGLSTREAM
- meta_wayland_eglstream_controller_init (compositor);
-#endif
+ {
+ gboolean should_enable_eglstream_controller = TRUE;
+#if defined(HAVE_EGL_DEVICE) && defined(HAVE_NATIVE_BACKEND)
+ MetaBackend *backend = meta_get_backend ();
+ MetaRenderer *renderer = meta_backend_get_renderer (backend);
+
+ if (META_IS_RENDERER_NATIVE (renderer))
+ {
+ MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
+
+ if (meta_renderer_native_get_mode (renderer_native) ==
+ META_RENDERER_NATIVE_MODE_GBM)
+ should_enable_eglstream_controller = FALSE;
+ }
+#endif /* defined(HAVE_EGL_DEVICE) && defined(HAVE_NATIVE_BACKEND) */
+
+ if (should_enable_eglstream_controller)
+ meta_wayland_eglstream_controller_init (compositor);
+ }
+#endif /* HAVE_WAYLAND_EGLSTREAM */
if (meta_get_x11_display_policy () != META_DISPLAY_POLICY_DISABLED)
{
--
2.35.1

70
SOURCES/0004-renderer-native-Allow-forcing-EGLStream-backend.patch

@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
From 4c23158f81c3c4b91353150fd4c28246ce1e692f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 3 Dec 2021 11:07:00 +0100
Subject: [PATCH 4/5] renderer/native: Allow forcing EGLStream backend

The GBM support in the NVIDIA driver is fairly new, and to make it
easier to identify whether a problem encountered is related to using GBM
instead of EGLStreams, add a debug environment variable to force using
EGLStream instead of GBM.

To force using EGLStream instead of GBM, use

MUTTER_DEBUG_FORCE_EGL_STREAM=1

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2045
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2132>
(cherry picked from commit d43cc776ef733251fc02e8e62669ea4ba7e68e2c)
---
src/backends/native/meta-renderer-native.c | 26 ++++++++++++++++------
1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index e7460fbf1..0cd7a27d6 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -1765,7 +1765,7 @@ meta_renderer_native_create_renderer_gpu_data (MetaRendererNative *renderer_nat
MetaGpuKms *gpu_kms,
GError **error)
{
- MetaRendererNativeGpuData *gbm_renderer_gpu_data;
+ MetaRendererNativeGpuData *gbm_renderer_gpu_data = NULL;
GError *gbm_error = NULL;
#ifdef HAVE_EGL_DEVICE
MetaRendererNativeGpuData *egl_stream_renderer_gpu_data;
@@ -1775,14 +1775,26 @@ meta_renderer_native_create_renderer_gpu_data (MetaRendererNative *renderer_nat
if (!gpu_kms)
return create_renderer_gpu_data_surfaceless (renderer_native, error);
- gbm_renderer_gpu_data = create_renderer_gpu_data_gbm (renderer_native,
- gpu_kms,
- &gbm_error);
- if (gbm_renderer_gpu_data)
+#ifdef HAVE_EGL_DEVICE
+ if (g_strcmp0 (getenv ("MUTTER_DEBUG_FORCE_EGL_STREAM"), "1") != 0)
+#endif
+ {
+ gbm_renderer_gpu_data = create_renderer_gpu_data_gbm (renderer_native,
+ gpu_kms,
+ &gbm_error);
+ if (gbm_renderer_gpu_data)
+ {
+ if (gbm_renderer_gpu_data->secondary.is_hardware_rendering)
+ return gbm_renderer_gpu_data;
+ }
+ }
+#ifdef HAVE_EGL_DEVICE
+ else
{
- if (gbm_renderer_gpu_data->secondary.is_hardware_rendering)
- return gbm_renderer_gpu_data;
+ g_set_error (&gbm_error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "GBM backend was disabled using env var");
}
+#endif
#ifdef HAVE_EGL_DEVICE
egl_stream_renderer_gpu_data =
--
2.35.1

37
SOURCES/0005-cursor-renderer-native-Add-a-means-to-disable-HW-cur.patch

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
From f5ae26bb44c42369cbcf0a9b7da049222b5ecbf8 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri, 10 Dec 2021 10:57:29 +0100
Subject: [PATCH 5/5] cursor-renderer/native: Add a means to disable HW cursors

When dealing with a faulty hardware or bugs in the driver, it might be
interesting to force the use of software cursors for debugging purposes.

Add a debug environment variable MUTTER_DEBUG_DISABLE_HW_CURSORS to
disable hardware cursors and force using software cursors.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2046
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2150>
(cherry picked from commit 56939abd2f1691eea9edf85cb715ebf275944e7e)
---
src/backends/native/meta-cursor-renderer-native.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c
index fcfe8eb98..237f9a3d5 100644
--- a/src/backends/native/meta-cursor-renderer-native.c
+++ b/src/backends/native/meta-cursor-renderer-native.c
@@ -1828,7 +1828,10 @@ meta_cursor_renderer_native_new (MetaBackend *backend,
priv->backend = backend;
- init_hw_cursor_support (cursor_renderer_native);
+ if (g_strcmp0 (getenv ("MUTTER_DEBUG_DISABLE_HW_CURSORS"), "1"))
+ init_hw_cursor_support (cursor_renderer_native);
+ else
+ g_message ("Disabling hardware cursors because MUTTER_DEBUG_DISABLE_HW_CURSORS is set");
return cursor_renderer_native;
}
--
2.35.1

213
SOURCES/add-unsafe-mode-property.patch

@ -0,0 +1,213 @@ @@ -0,0 +1,213 @@
From d89c71ed2bdb18e9b01891d6b999c44f955778dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 1 Sep 2021 21:12:03 +0200
Subject: [PATCH 1/2] context: Add :unsafe-mode property

We are going to restrict several sensitive D-Bus APIs to a set
of allowed callers (like Settings or portal implementations).

Add an :unsafe-mode property to the context to allow turning off
those restrictions temporarily, in order to not get in the way
of development/debugging.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3943

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1983>
---
src/backends/meta-backend-private.h | 4 ++
src/backends/meta-backend.c | 83 +++++++++++++++++++++++++++++
2 files changed, 87 insertions(+)

diff --git a/src/backends/meta-backend-private.h b/src/backends/meta-backend-private.h
index b930462b2..583d4e151 100644
--- a/src/backends/meta-backend-private.h
+++ b/src/backends/meta-backend-private.h
@@ -133,6 +133,10 @@ void meta_backend_foreach_device_monitor (MetaBackend *backend,
GFunc func,
gpointer user_data);
+gboolean meta_backend_get_unsafe_mode (MetaBackend *backend);
+void meta_backend_set_unsafe_mode (MetaBackend *backend,
+ gboolean enable);
+
META_EXPORT_TEST
MetaMonitorManager * meta_backend_get_monitor_manager (MetaBackend *backend);
MetaOrientationManager * meta_backend_get_orientation_manager (MetaBackend *backend);
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index ff84bfe6a..18bee2484 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -88,6 +88,17 @@
#include "wayland/meta-wayland.h"
#endif
+enum
+{
+ PROP_0,
+
+ PROP_UNSAFE_MODE,
+
+ N_PROPS
+};
+
+static GParamSpec *obj_props[N_PROPS];
+
enum
{
KEYMAP_CHANGED,
@@ -158,6 +169,8 @@ struct _MetaBackendPrivate
gboolean is_pointer_position_initialized;
+ gboolean unsafe_mode;
+
guint device_update_idle_id;
GHashTable *device_monitors;
@@ -814,6 +827,64 @@ upower_vanished (GDBusConnection *connection,
g_clear_object (&priv->upower_proxy);
}
+gboolean
+meta_backend_get_unsafe_mode (MetaBackend *backend)
+{
+ MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
+
+ return priv->unsafe_mode;
+}
+
+void
+meta_backend_set_unsafe_mode (MetaBackend *backend,
+ gboolean enable)
+{
+ MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
+
+ if (priv->unsafe_mode == enable)
+ return;
+
+ priv->unsafe_mode = enable;
+ g_object_notify_by_pspec (G_OBJECT (backend), obj_props[PROP_UNSAFE_MODE]);
+}
+
+static void
+meta_backend_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ MetaBackend *backend = META_BACKEND (object);
+ MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
+
+ switch (prop_id)
+ {
+ case PROP_UNSAFE_MODE:
+ g_value_set_boolean (value, priv->unsafe_mode);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+meta_backend_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ MetaBackend *backend = META_BACKEND (object);
+
+ switch (prop_id)
+ {
+ case PROP_UNSAFE_MODE:
+ meta_backend_set_unsafe_mode (backend, g_value_get_boolean (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
static void
meta_backend_constructed (GObject *object)
{
@@ -851,6 +922,8 @@ meta_backend_class_init (MetaBackendClass *klass)
object_class->dispose = meta_backend_dispose;
object_class->constructed = meta_backend_constructed;
+ object_class->get_property = meta_backend_get_property;
+ object_class->set_property = meta_backend_set_property;
klass->post_init = meta_backend_real_post_init;
klass->grab_device = meta_backend_real_grab_device;
@@ -907,6 +980,16 @@ meta_backend_class_init (MetaBackendClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 0);
+ obj_props[PROP_UNSAFE_MODE] =
+ g_param_spec_boolean ("unsafe-mode",
+ "unsafe mode",
+ "Unsafe mode",
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_EXPLICIT_NOTIFY |
+ G_PARAM_STATIC_STRINGS);
+ g_object_class_install_properties (object_class, N_PROPS, obj_props);
+
mutter_stage_views = g_getenv ("MUTTER_STAGE_VIEWS");
stage_views_disabled = g_strcmp0 (mutter_stage_views, "0") == 0;
}
--
2.35.1


From dc69aa57be79fa7f371788c852f6e23cf0d261cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 2 Sep 2021 18:41:16 +0200
Subject: [PATCH 2/2] context: Add (hidden) --unsafe-mode option

When running gnome-shell, it is possible to toggle unsafe-mode in
looking glass. We'll eventually start using the property in mutter
as well, so to make stand-alone debugging easier, also expose it
as a hidden command line option.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3943

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1983>
---
src/core/main.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/src/core/main.c b/src/core/main.c
index 0d241f952..991d583a0 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -218,6 +218,7 @@ static char *opt_wayland_display;
static gboolean opt_display_server;
static gboolean opt_headless;
#endif
+static gboolean opt_unsafe_mode;
static gboolean opt_x11;
#ifdef HAVE_NATIVE_BACKEND
@@ -306,6 +307,11 @@ static GOptionEntry meta_options[] = {
N_("Add persistent virtual monitor (WxH or WxH@R)")
},
#endif
+ {
+ "unsafe-mode", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE,
+ &opt_unsafe_mode,
+ "Run in unsafe mode"
+ },
{
"x11", 0, 0, G_OPTION_ARG_NONE,
&opt_x11,
@@ -865,6 +871,7 @@ meta_init (void)
add_persistent_virtual_monitors ();
#endif
+ meta_backend_set_unsafe_mode (meta_get_backend(), opt_unsafe_mode);
meta_set_syncing (opt_sync || (g_getenv ("MUTTER_SYNC") != NULL));
if (opt_replace_wm)
--
2.35.1

100
SOURCES/legacy-x11-input-configuration.patch

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
From 705818340dec181335b48ab73d6411e639daaeae Mon Sep 17 00:00:00 2001
From 22fe64732e11199901d4a35f9d3c63d5d6deb3a3 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 1 Jun 2021 11:44:20 +0200
Subject: [PATCH 1/6] backends/x11: Support synaptics configuration
@ -6,11 +6,11 @@ Subject: [PATCH 1/6] backends/x11: Support synaptics configuration @@ -6,11 +6,11 @@ Subject: [PATCH 1/6] backends/x11: Support synaptics configuration
The code is taken mostly as-is from g-s-d, so we can drag the
dead horse a bit longer.
---
src/backends/x11/meta-input-settings-x11.c | 275 +++++++++++++++++++++
1 file changed, 275 insertions(+)
src/backends/x11/meta-input-settings-x11.c | 274 +++++++++++++++++++++
1 file changed, 274 insertions(+)

diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 96390285a6..0631fd2fee 100644
index 371e2f60e..426056390 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -26,6 +26,7 @@
@ -21,7 +21,7 @@ index 96390285a6..0631fd2fee 100644 @@ -21,7 +21,7 @@ index 96390285a6..0631fd2fee 100644
#include <string.h>
#include <X11/Xatom.h>
#include <X11/extensions/XInput2.h>
@@ -165,6 +166,184 @@ change_property (ClutterInputDevice *device,
@@ -165,6 +166,183 @@ change_property (ClutterInputDevice *device,
meta_XFree (data_ret);
}
@ -45,7 +45,6 @@ index 96390285a6..0631fd2fee 100644 @@ -45,7 +45,6 @@ index 96390285a6..0631fd2fee 100644
+ gboolean left_handed)
+{
+ MetaDisplay *display = meta_get_display ();
+ MetaX11Display *x11_display = display ? display->x11_display : NULL;
+ MetaBackend *backend = meta_get_backend ();
+ Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+ int device_id;
@ -71,8 +70,7 @@ index 96390285a6..0631fd2fee 100644 @@ -71,8 +70,7 @@ index 96390285a6..0631fd2fee 100644
+ XA_INTEGER, 8, tap_action, 7);
+ meta_XFree (tap_action);
+
+ if (x11_display)
+ meta_x11_error_trap_push (x11_display);
+ clutter_x11_trap_x_errors();
+ buttons = g_new (guchar, buttons_capacity);
+ n_buttons = XGetDeviceButtonMapping (xdisplay, xdevice,
+ buttons, buttons_capacity);
@ -92,7 +90,7 @@ index 96390285a6..0631fd2fee 100644 @@ -92,7 +90,7 @@ index 96390285a6..0631fd2fee 100644
+ XSetDeviceButtonMapping (xdisplay, xdevice, buttons, n_buttons);
+ g_free (buttons);
+
+ if (x11_display && meta_x11_error_trap_pop_with_return (x11_display))
+ if (clutter_x11_untrap_x_errors())
+ {
+ g_warning ("Could not set synaptics touchpad left-handed for %s",
+ clutter_input_device_get_device_name (device));
@ -107,7 +105,6 @@ index 96390285a6..0631fd2fee 100644 @@ -107,7 +105,6 @@ index 96390285a6..0631fd2fee 100644
+ gdouble speed)
+{
+ MetaDisplay *display = meta_get_display ();
+ MetaX11Display *x11_display = display ? display->x11_display : NULL;
+ MetaBackend *backend = meta_get_backend ();
+ Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
+ int device_id;
@ -122,7 +119,10 @@ index 96390285a6..0631fd2fee 100644 @@ -122,7 +119,10 @@ index 96390285a6..0631fd2fee 100644
+ if (!xdevice)
+ return;
+ /* Get the list of feedbacks for the device */
+ clutter_x11_trap_x_errors();
+ states = XGetFeedbackControl (xdisplay, xdevice, &num_feedbacks);
+ if (clutter_x11_untrap_x_errors())
+ return;
+ if (!states)
+ return;
+
@ -167,8 +167,7 @@ index 96390285a6..0631fd2fee 100644 @@ -167,8 +167,7 @@ index 96390285a6..0631fd2fee 100644
+ denominator = -1;
+ }
+
+ if (x11_display)
+ meta_x11_error_trap_push (x11_display);
+ clutter_x11_trap_x_errors();
+
+ state = (XFeedbackState *) states;
+
@ -193,7 +192,7 @@ index 96390285a6..0631fd2fee 100644 @@ -193,7 +192,7 @@ index 96390285a6..0631fd2fee 100644
+ state = (XFeedbackState *) ((char *) state + state->length);
+ }
+
+ if (x11_display && meta_x11_error_trap_pop_with_return (x11_display))
+ if (clutter_x11_untrap_x_errors())
+ {
+ g_warning ("Could not set synaptics touchpad acceleration for %s",
+ clutter_input_device_get_device_name (device));
@ -206,7 +205,7 @@ index 96390285a6..0631fd2fee 100644 @@ -206,7 +205,7 @@ index 96390285a6..0631fd2fee 100644
static void
meta_input_settings_x11_set_send_events (MetaInputSettings *settings,
ClutterInputDevice *device,
@@ -173,6 +352,13 @@ meta_input_settings_x11_set_send_events (MetaInputSettings *settings,
@@ -173,6 +351,13 @@ meta_input_settings_x11_set_send_events (MetaInputSettings *settings,
guchar values[2] = { 0 }; /* disabled, disabled-on-external-mouse */
guchar *available;
@ -220,7 +219,7 @@ index 96390285a6..0631fd2fee 100644 @@ -220,7 +219,7 @@ index 96390285a6..0631fd2fee 100644
available = get_property (device, "libinput Send Events Modes Available",
XA_INTEGER, 8, 2);
if (!available)
@@ -225,6 +411,12 @@ meta_input_settings_x11_set_speed (MetaInputSettings *settings,
@@ -225,6 +410,12 @@ meta_input_settings_x11_set_speed (MetaInputSettings *settings,
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
gfloat value = speed;
@ -233,7 +232,7 @@ index 96390285a6..0631fd2fee 100644 @@ -233,7 +232,7 @@ index 96390285a6..0631fd2fee 100644
change_property (device, "libinput Accel Speed",
XInternAtom (xdisplay, "FLOAT", False),
32, &value, 1);
@@ -251,6 +443,19 @@ meta_input_settings_x11_set_left_handed (MetaInputSettings *settings,
@@ -251,6 +442,19 @@ meta_input_settings_x11_set_left_handed (MetaInputSettings *settings,
else
{
value = enabled ? 1 : 0;
@ -253,7 +252,7 @@ index 96390285a6..0631fd2fee 100644 @@ -253,7 +252,7 @@ index 96390285a6..0631fd2fee 100644
change_property (device, "libinput Left Handed Enabled",
XA_INTEGER, 8, &value, 1);
}
@@ -274,6 +479,20 @@ meta_input_settings_x11_set_tap_enabled (MetaInputSettings *settings,
@@ -274,6 +478,20 @@ meta_input_settings_x11_set_tap_enabled (MetaInputSettings *settings,
{
guchar value = (enabled) ? 1 : 0;
@ -274,7 +273,7 @@ index 96390285a6..0631fd2fee 100644 @@ -274,7 +273,7 @@ index 96390285a6..0631fd2fee 100644
change_property (device, "libinput Tapping Enabled",
XA_INTEGER, 8, &value, 1);
}
@@ -307,6 +526,27 @@ meta_input_settings_x11_set_invert_scroll (MetaInputSettings *settings,
@@ -307,6 +525,27 @@ meta_input_settings_x11_set_invert_scroll (MetaInputSettings *settings,
{
guchar value = (inverted) ? 1 : 0;
@ -302,7 +301,7 @@ index 96390285a6..0631fd2fee 100644 @@ -302,7 +301,7 @@ index 96390285a6..0631fd2fee 100644
change_property (device, "libinput Natural Scrolling Enabled",
XA_INTEGER, 8, &value, 1);
}
@@ -320,6 +560,41 @@ change_scroll_method (ClutterInputDevice *device,
@@ -320,6 +559,41 @@ change_scroll_method (ClutterInputDevice *device,
guchar *current = NULL;
guchar *available = NULL;
@ -345,10 +344,10 @@ index 96390285a6..0631fd2fee 100644 @@ -345,10 +344,10 @@ index 96390285a6..0631fd2fee 100644
XA_INTEGER, 8, SCROLL_METHOD_NUM_FIELDS);
if (!available || !available[method])
--
2.31.1
2.36.1


From 50c4733acf56b3b67a2706d32f5c455cb51f9458 Mon Sep 17 00:00:00 2001
From 963ff120898e7e42d80d5761753e76adcf16c132 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Tue, 13 Feb 2018 11:44:40 +0100
Subject: [PATCH 2/6] clutter: Extend touchpad device property check for
@ -361,7 +360,7 @@ to get the device type may fall short. @@ -361,7 +360,7 @@ to get the device type may fall short.
1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
index d43834bd7b..73938e22e0 100644
index d43834bd7..73938e22e 100644
--- a/src/backends/x11/meta-seat-x11.c
+++ b/src/backends/x11/meta-seat-x11.c
@@ -246,7 +246,8 @@ is_touch_device (XIAnyClassInfo **classes,
@ -403,10 +402,10 @@ index d43834bd7b..73938e22e0 100644 @@ -403,10 +402,10 @@ index d43834bd7b..73938e22e0 100644
get_device_ids (XIDeviceInfo *info,
char **vendor_id,
--
2.31.1
2.36.1


From 307970305d11cdca1b97c53c85bda8b809ff4f0f Mon Sep 17 00:00:00 2001
From 86cc1b46dae01da619980af826eb9bf81cf31143 Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagomatos@gmail.com>
Date: Mon, 9 Oct 2017 18:39:52 +0200
Subject: [PATCH 3/6] backends/x11: Add a synaptics check for two finger scroll
@ -421,10 +420,10 @@ isn't. @@ -421,10 +420,10 @@ isn't.
1 file changed, 11 insertions(+)

diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 0631fd2fee..2ac080127c 100644
index 426056390..db2b2a4fb 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -638,6 +638,17 @@ meta_input_settings_x11_has_two_finger_scroll (MetaInputSettings *settings,
@@ -637,6 +637,17 @@ meta_input_settings_x11_has_two_finger_scroll (MetaInputSettings *settings,
guchar *available = NULL;
gboolean has_two_finger = TRUE;
@ -443,10 +442,10 @@ index 0631fd2fee..2ac080127c 100644 @@ -443,10 +442,10 @@ index 0631fd2fee..2ac080127c 100644
XA_INTEGER, 8, SCROLL_METHOD_NUM_FIELDS);
if (!available || !available[SCROLL_METHOD_FIELD_2FG])
--
2.31.1
2.36.1


From cba31f88ddbfb7355de1daa34397aba8e8607765 Mon Sep 17 00:00:00 2001
From 32e2da07eeb1f9edcf03751285a756ab1acca6a8 Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagomatos@gmail.com>
Date: Mon, 9 Oct 2017 18:55:56 +0200
Subject: [PATCH 4/6] backends/x11: Add disable while typing support for
@ -459,7 +458,7 @@ syndaemon when the synaptics driver is being used. @@ -459,7 +458,7 @@ syndaemon when the synaptics driver is being used.
1 file changed, 112 insertions(+)

diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 2ac080127c..2658b82172 100644
index db2b2a4fb..bf9d769e9 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -35,6 +35,9 @@
@ -481,7 +480,7 @@ index 2ac080127c..2658b82172 100644 @@ -481,7 +480,7 @@ index 2ac080127c..2658b82172 100644
} MetaInputSettingsX11Private;
G_DEFINE_TYPE_WITH_PRIVATE (MetaInputSettingsX11, meta_input_settings_x11,
@@ -344,6 +349,107 @@ change_synaptics_speed (ClutterInputDevice *device,
@@ -343,6 +348,107 @@ change_synaptics_speed (ClutterInputDevice *device,
XCloseDevice (xdisplay, xdevice);
}
@ -589,7 +588,7 @@ index 2ac080127c..2658b82172 100644 @@ -589,7 +588,7 @@ index 2ac080127c..2658b82172 100644
static void
meta_input_settings_x11_set_send_events (MetaInputSettings *settings,
ClutterInputDevice *device,
@@ -468,6 +574,12 @@ meta_input_settings_x11_set_disable_while_typing (MetaInputSettings *settings,
@@ -467,6 +573,12 @@ meta_input_settings_x11_set_disable_while_typing (MetaInputSettings *settings,
{
guchar value = (enabled) ? 1 : 0;
@ -603,10 +602,10 @@ index 2ac080127c..2658b82172 100644 @@ -603,10 +602,10 @@ index 2ac080127c..2658b82172 100644
XA_INTEGER, 8, &value, 1);
}
--
2.31.1
2.36.1


From 354d34263534d0c7a5c7f7169d8b4a3dba79491c Mon Sep 17 00:00:00 2001
From 6da0bfe86f416d3cfc5cc6993e8e2f6ca255e85a Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 13 Jun 2018 13:48:24 +0200
Subject: [PATCH 5/6] clutter: Only reset scroll axes on slave devices
@ -617,7 +616,7 @@ As a plus, unknown source device IDs will just warn instead of crash. @@ -617,7 +616,7 @@ As a plus, unknown source device IDs will just warn instead of crash.
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
index 73938e22e0..6d2c7d3740 100644
index 73938e22e..6d2c7d374 100644
--- a/src/backends/x11/meta-seat-x11.c
+++ b/src/backends/x11/meta-seat-x11.c
@@ -2362,7 +2362,9 @@ meta_seat_x11_translate_event (MetaSeatX11 *seat,
@ -632,10 +631,10 @@ index 73938e22e0..6d2c7d3740 100644 @@ -632,10 +631,10 @@ index 73938e22e0..6d2c7d3740 100644
clutter_event_set_device (event, device);
clutter_event_set_source_device (event, source_device);
--
2.31.1
2.36.1


From b7f94b5dd09953d5a4c8aee1b79491d71f8c1e0e Mon Sep 17 00:00:00 2001
From da60cf38c7fcec68f8e79a8a3a174e551c07a64a Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagomatos@gmail.com>
Date: Tue, 10 Oct 2017 19:07:27 +0200
Subject: [PATCH 6/6] backends/x11: Support plain old X device configuration
@ -647,10 +646,10 @@ bits specific for xorg-x11-drv-evdev devices. @@ -647,10 +646,10 @@ bits specific for xorg-x11-drv-evdev devices.
1 file changed, 75 insertions(+), 23 deletions(-)

diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 2658b82172..80bc33c6b5 100644
index bf9d769e9..49dcb74f1 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -185,10 +185,23 @@ is_device_synaptics (ClutterInputDevice *device)
@@ -185,17 +185,30 @@ is_device_synaptics (ClutterInputDevice *device)
return TRUE;
}
@ -676,8 +675,7 @@ index 2658b82172..80bc33c6b5 100644 @@ -676,8 +675,7 @@ index 2658b82172..80bc33c6b5 100644
+ gboolean left_handed)
{
MetaDisplay *display = meta_get_display ();
MetaX11Display *x11_display = display ? display->x11_display : NULL;
@@ -196,7 +209,7 @@ change_synaptics_tap_left_handed (ClutterInputDevice *device,
MetaBackend *backend = meta_get_backend ();
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
int device_id;
XDevice *xdevice;
@ -686,7 +684,7 @@ index 2658b82172..80bc33c6b5 100644 @@ -686,7 +684,7 @@ index 2658b82172..80bc33c6b5 100644
guint buttons_capacity = 16, n_buttons;
device_id = meta_input_device_x11_get_device_id (device);
@@ -204,19 +217,6 @@ change_synaptics_tap_left_handed (ClutterInputDevice *device,
@@ -203,19 +216,6 @@ change_synaptics_tap_left_handed (ClutterInputDevice *device,
if (!xdevice)
return;
@ -703,12 +701,12 @@ index 2658b82172..80bc33c6b5 100644 @@ -703,12 +701,12 @@ index 2658b82172..80bc33c6b5 100644
- XA_INTEGER, 8, tap_action, 7);
- meta_XFree (tap_action);
-
if (x11_display)
meta_x11_error_trap_push (x11_display);
clutter_x11_trap_x_errors();
buttons = g_new (guchar, buttons_capacity);
@@ -240,17 +240,39 @@ change_synaptics_tap_left_handed (ClutterInputDevice *device,
n_buttons = XGetDeviceButtonMapping (xdisplay, xdevice,
@@ -238,17 +238,39 @@ change_synaptics_tap_left_handed (ClutterInputDevice *device,
if (x11_display && meta_x11_error_trap_pop_with_return (x11_display))
if (clutter_x11_untrap_x_errors())
{
- g_warning ("Could not set synaptics touchpad left-handed for %s",
+ g_warning ("Could not set left-handed for %s",
@ -749,8 +747,8 @@ index 2658b82172..80bc33c6b5 100644 @@ -749,8 +747,8 @@ index 2658b82172..80bc33c6b5 100644
+ gdouble speed)
{
MetaDisplay *display = meta_get_display ();
MetaX11Display *x11_display = display ? display->x11_display : NULL;
@@ -349,6 +371,23 @@ change_synaptics_speed (ClutterInputDevice *device,
MetaBackend *backend = meta_get_backend ();
@@ -348,6 +370,23 @@ change_synaptics_speed (ClutterInputDevice *device,
XCloseDevice (xdisplay, xdevice);
}
@ -774,7 +772,7 @@ index 2658b82172..80bc33c6b5 100644 @@ -774,7 +772,7 @@ index 2658b82172..80bc33c6b5 100644
/* Ensure that syndaemon dies together with us, to avoid running several of
* them */
static void
@@ -517,9 +556,10 @@ meta_input_settings_x11_set_speed (MetaInputSettings *settings,
@@ -516,9 +555,10 @@ meta_input_settings_x11_set_speed (MetaInputSettings *settings,
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
gfloat value = speed;
@ -787,7 +785,7 @@ index 2658b82172..80bc33c6b5 100644 @@ -787,7 +785,7 @@ index 2658b82172..80bc33c6b5 100644
return;
}
@@ -561,6 +601,11 @@ meta_input_settings_x11_set_left_handed (MetaInputSettings *settings,
@@ -560,6 +600,11 @@ meta_input_settings_x11_set_left_handed (MetaInputSettings *settings,
g_object_unref (settings);
return;
}
@ -799,7 +797,7 @@ index 2658b82172..80bc33c6b5 100644 @@ -799,7 +797,7 @@ index 2658b82172..80bc33c6b5 100644
change_property (device, "libinput Left Handed Enabled",
XA_INTEGER, 8, &value, 1);
@@ -778,7 +823,14 @@ meta_input_settings_x11_set_scroll_button (MetaInputSettings *settings,
@@ -777,7 +822,14 @@ meta_input_settings_x11_set_scroll_button (MetaInputSettings *settings,
{
gchar lock = button_lock;
@ -815,5 +813,5 @@ index 2658b82172..80bc33c6b5 100644 @@ -815,5 +813,5 @@ index 2658b82172..80bc33c6b5 100644
XA_CARDINAL, 32, &button, 1);
change_property (device, "libinput Button Scrolling Button Lock Enabled",
--
2.31.1
2.36.1


0
SOURCES/mutter-42.alpha-disable-tegra.patch

106
SPECS/mutter.spec

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@

Name: mutter
Version: 40.9
Release: 1%{?dist}
Release: 15%{?dist}
Summary: Window and compositing manager based on Clutter

License: GPLv2+
@ -68,6 +68,51 @@ Patch14: hw-cursor-dumb-buffer.patch @@ -68,6 +68,51 @@ Patch14: hw-cursor-dumb-buffer.patch
# Backport EGLStream overview fixes (#2052584)
Patch15: eglstream-overview-fixes.patch

Patch16: 0001-clutter-Make-ClutterClickAction-independent-of-click.patch
Patch17: add-unsafe-mode-property.patch

# Backport KMS: Survive missing GAMMA_LUT property (#2083091)
Patch18: 0001-kms-crtc-Add-function-meta_kms_crtc_has_gamma.patch
Patch19: 0002-crtc-kms-Don-t-add-gamma-to-the-update-if-unsupporte.patch
Patch20: 0003-kms-crtc-Determine-gamma-support-given-the-gamma-len.patch

# Backport Pass dirty rects to gpu (#2080980)
Patch21: 0001-kms-Allow-passing-framebuffer-damage-metadata.patch
Patch22: 0002-onscreen-native-Pass-damage-rectangles-when-page-fli.patch

Patch23: 0001-backends-Move-MetaKeyboardA11yFlags-to-a-public-head.patch

# GBM support with NVIDIA driver
# https://bugzilla.redhat.com/2015891
# Backports:
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2051
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2052
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2132
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2150
Patch24: 0001-renderer-native-Log-render-mode-per-device.patch
Patch25: 0002-renderer-native-Try-the-gbm-renderer-before-the-EGLD.patch
Patch26: 0003-wayland-Only-init-EGLStream-controller-if-we-didn-t-.patch
Patch27: 0004-renderer-native-Allow-forcing-EGLStream-backend.patch
Patch28: 0005-cursor-renderer-native-Add-a-means-to-disable-HW-cur.patch

# Fix race condition causing stuck pointer grabs (#2090170)
Patch40: 0001-events-Pass-CurrentTime-to-XIAllowEvents-when-unfree.patch

# Backport night light availability property (#2057154)
Patch41: 0001-monitor-manager-Add-NightLightSupported-property-to-.patch

# Don't add common modes if panel already has (#2125032)
Patch42: 0001-output-kms-Add-more-heuristics-to-decide-when-to-off.patch
Patch43: 0002-output-kms-Don-t-attemp-to-add-common-modes-on-conne.patch

Patch44: 0001-backends-Only-apply-EDID-based-tablet-mapping-heuris.patch

# Allow starting headless again (#2116363)
Patch45: 0001-gpu-kms-Report-that-we-can-have-outputs-if-we-have-c.patch
Patch46: 0001-clutter-text-Don-t-query-preferred-size-without-allo.patch

Patch47: 0001-core-Change-MetaWaylandTextInput-event-forwarding-to.patch

BuildRequires: chrpath
BuildRequires: pango-devel
BuildRequires: startup-notification-devel
@ -158,6 +203,7 @@ behaviors to meet the needs of the environment. @@ -158,6 +203,7 @@ behaviors to meet the needs of the environment.
%package devel
Summary: Development package for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: mesa-libEGL-devel

%description devel
Header files and libraries for developing Mutter plugins. Also includes
@ -214,6 +260,62 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop @@ -214,6 +260,62 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%{_datadir}/mutter-%{mutter_api_version}/tests

%changelog
* Mon Jul 10 2023 Carlos Garnacho <cgarnach@redhat.com> - 40.9-15
- Fix ordering of keyboard modifiers relative to other keyboard events
Resolves: #2218146

* Wed Feb 01 2023 Jonas Ådahl <jadahl@redhat.com>) - 40.9-14
- Allow starting headless again
Resolves: #2116363

* Tue Jan 03 2023 Carlos Garnacho <cgarnach@redhat.com>) - 40.9-13
- Do not apply EDID mapping heuristics to non-integrated tablets
Resolves: #2047341

* Tue Dec 06 2022 Jonas Ådahl <jadahl@redhat.com>) - 40.9-12
- Add missing dependency for mutter-devel
Resolves: #2004832

* Tue Dec 06 2022 Olivier Fourdan <ofourdan@redhat.com> - 40.9-11
- Fix downstream synaptics patches breaking xdmcp
Resolves: #2092452

* Thu Oct 20 2022 Jonas Ådahl <jadahl@redhat.com>) - 40.9-10
- Don't add common modes if panel already has
Resolves: #2125032

* Tue Aug 16 2022 Jonas Ådahl <jadahl@redhat.com>) - 40.9-9
- Backport night light availability property
Resolves: #2057154

* Mon Jun 27 2022 Jonas Ådahl <jadahl@redhat.com>) - 40.9-8
- Fix race condition causing stuck pointer grabs
Resolves: #2090170

* Mon Jun 20 2022 Olivier Fourdan <ofourdan@redhat.com> - 40.9-7
- GBM support with NVIDIA driver
Resolves: #2015891

* Mon Jun 20 2022 Florian Müllner <fmuellner@redhat.com> - 40.9-6
- Make moved KeyboardA11yFlags enum public
Related: #2047644

* Mon Jun 13 2022 Jocelyn Falempe <jfalempe@redhat.com - 40.9-5
- Backport Pass dirty rects to gpu
Resolves: #2080980

* Mon Jun 13 2022 Jocelyn Falempe <jfalempe@redhat.com - 40.9-4
- Backport KMS: Survive missing GAMMA_LUT property
Resolves: #2083091

* Fri Apr 01 2022 Florian Müllner <fmuellner@redhat.com> - 40.9-3
- Add MetaBackend:unsafe-mode property
Related: #2055366

* Wed Mar 30 2022 Florian Müllner <fmuellner@redhat.com> - 40.9-2
- Ignore click count for click actions
Resolves: #2052806

* Tue Feb 22 2022 Florian Müllner <fmuellner@redhat.com> - 40.9-1
- Update to 40.9
Resolves: #2056414
@ -250,7 +352,7 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop @@ -250,7 +352,7 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
- Fixes a race in wl_seat capabilities
Resolves: #2003032

* Wed Aug 27 2021 Florian Müllner <fmuellner@redhat.com> - 40.4-2
* Fri Aug 27 2021 Florian Müllner <fmuellner@redhat.com> - 40.4-2
- Remove firstboot(windowmanager) provide
Resolves: #1975355


Loading…
Cancel
Save