import mutter-3.32.2-55.el8

This commit is contained in:
CentOS Sources 2021-03-30 10:27:42 -04:00 committed by Stepan Oksanichenko
parent c54b5032f1
commit 4782a43ef8
13 changed files with 5457 additions and 16 deletions

View File

@ -1,4 +1,4 @@
From 8d7356fd7439f94f163438d55f2b2d3d918de96d Mon Sep 17 00:00:00 2001
From fd67e75df470b50510b68ccf0f52b0b98d05c63f Mon Sep 17 00:00:00 2001
From: "Owen W. Taylor" <otaylor@fishsoup.net>
Date: Thu, 8 May 2014 18:44:15 -0400
Subject: [PATCH] Add support for quad-buffer stereo
@ -21,7 +21,7 @@ texture_from_pixmap.
src/compositor/compositor-private.h | 9 ++
src/compositor/compositor.c | 125 +++++++++++++++
src/compositor/meta-shaped-texture-private.h | 5 +-
src/compositor/meta-shaped-texture.c | 84 +++++++++-
src/compositor/meta-shaped-texture.c | 85 +++++++++-
src/compositor/meta-surface-actor-wayland.c | 2 +-
src/compositor/meta-surface-actor-x11.c | 54 ++++++-
src/compositor/meta-surface-actor-x11.h | 5 +
@ -32,7 +32,7 @@ texture_from_pixmap.
src/core/stereo.h | 28 ++++
src/meson.build | 2 +
src/wayland/meta-wayland-surface.c | 2 +-
14 files changed, 481 insertions(+), 20 deletions(-)
14 files changed, 482 insertions(+), 20 deletions(-)
create mode 100644 src/core/stereo.c
create mode 100644 src/core/stereo.h
@ -265,7 +265,7 @@ index a86a2bff0..d0efdd4dc 100644
gboolean is_y_inverted);
void meta_shaped_texture_set_snippet (MetaShapedTexture *stex,
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index d64e214e5..e77a32109 100644
index d64e214e5..332b4c814 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -88,8 +88,10 @@ struct _MetaShapedTexture
@ -287,7 +287,7 @@ index d64e214e5..e77a32109 100644
stex->texture = NULL;
stex->mask_texture = NULL;
@@ -297,6 +300,9 @@ meta_shaped_texture_dispose (GObject *object)
@@ -297,7 +300,11 @@ meta_shaped_texture_dispose (GObject *object)
meta_texture_tower_free (stex->paint_tower);
stex->paint_tower = NULL;
@ -295,9 +295,11 @@ index d64e214e5..e77a32109 100644
+ g_clear_pointer (&stex->paint_tower_right, meta_texture_tower_free);
+
g_clear_pointer (&stex->texture, cogl_object_unref);
+ g_clear_pointer (&stex->texture_right, cogl_object_unref);
g_clear_pointer (&stex->opaque_region, cairo_region_destroy);
@@ -507,8 +513,9 @@ paint_clipped_rectangle (MetaShapedTexture *stex,
meta_shaped_texture_set_mask_texture (stex, NULL);
@@ -507,8 +514,9 @@ paint_clipped_rectangle (MetaShapedTexture *stex,
}
static void
@ -309,7 +311,7 @@ index d64e214e5..e77a32109 100644
{
int width, height;
@@ -516,8 +523,11 @@ set_cogl_texture (MetaShapedTexture *stex,
@@ -516,8 +524,11 @@ set_cogl_texture (MetaShapedTexture *stex,
if (stex->texture)
cogl_object_unref (stex->texture);
@ -321,7 +323,7 @@ index d64e214e5..e77a32109 100644
if (cogl_tex != NULL)
{
@@ -531,6 +541,9 @@ set_cogl_texture (MetaShapedTexture *stex,
@@ -531,6 +542,9 @@ set_cogl_texture (MetaShapedTexture *stex,
height = 0;
}
@ -331,7 +333,7 @@ index d64e214e5..e77a32109 100644
if (stex->tex_width != width ||
stex->tex_height != height)
{
@@ -544,8 +557,23 @@ set_cogl_texture (MetaShapedTexture *stex,
@@ -544,8 +558,23 @@ set_cogl_texture (MetaShapedTexture *stex,
* previous buffer. We only queue a redraw in response to surface
* damage. */
@ -356,7 +358,7 @@ index d64e214e5..e77a32109 100644
}
static gboolean
@@ -779,7 +807,9 @@ meta_shaped_texture_paint (ClutterActor *actor)
@@ -779,7 +808,9 @@ meta_shaped_texture_paint (ClutterActor *actor)
{
MetaShapedTexture *stex = META_SHAPED_TEXTURE (actor);
CoglTexture *paint_tex;
@ -366,7 +368,7 @@ index d64e214e5..e77a32109 100644
if (!stex->texture)
return;
@@ -841,7 +871,32 @@ meta_shaped_texture_paint (ClutterActor *actor)
@@ -841,7 +872,32 @@ meta_shaped_texture_paint (ClutterActor *actor)
return;
fb = cogl_get_draw_framebuffer ();
@ -400,7 +402,7 @@ index d64e214e5..e77a32109 100644
}
static void
@@ -915,6 +970,12 @@ meta_shaped_texture_set_create_mipmaps (MetaShapedTexture *stex,
@@ -915,6 +971,12 @@ meta_shaped_texture_set_create_mipmaps (MetaShapedTexture *stex,
stex->create_mipmaps = create_mipmaps;
base_texture = create_mipmaps ? stex->texture : NULL;
meta_texture_tower_set_base_texture (stex->paint_tower, base_texture);
@ -413,7 +415,7 @@ index d64e214e5..e77a32109 100644
}
}
@@ -1046,6 +1107,12 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
@@ -1046,6 +1108,12 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
clip.y,
clip.width,
clip.height);
@ -426,7 +428,7 @@ index d64e214e5..e77a32109 100644
stex->prev_invalidation = stex->last_invalidation;
stex->last_invalidation = g_get_monotonic_time ();
@@ -1092,17 +1159,18 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
@@ -1092,17 +1160,18 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
}
/**
@ -901,5 +903,5 @@ index da0acfcbb..ddad1a45c 100644
meta_shaped_texture_set_is_y_inverted (stex, is_y_inverted);
g_clear_pointer (&snippet, cogl_object_unref);
--
2.25.1
2.28.0

View File

@ -0,0 +1,46 @@
From 7bcc274dbc6cb75814cce3e5c2e7f45cf25b0538 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Tue, 9 Feb 2021 17:59:08 +0100
Subject: [PATCH 1/2] clutter/stage-view: Hide double buffered shadowfb behind
envvar
It still results in worse performance than a single FBO based shadowfb,
so don't use it. It will need a new EGL extension for zero copy CPU
memory based FBO to be feasable.
---
clutter/clutter/clutter-stage-view.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index 5e5966d06..ec18db7b8 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -282,6 +282,14 @@ init_dma_buf_shadowfbs (ClutterStageView *view,
CoglRenderer *cogl_renderer = cogl_context_get_renderer (cogl_context);
CoglFramebuffer *initial_shadowfb;
+ if (g_strcmp0 (g_getenv ("MUTTER_DEBUG_ENABLE_DOUBLE_BUFFER_SHADOWFB"),
+ "1") != 0)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Double buffered shadowfb not enabled");
+ return FALSE;
+ }
+
if (!cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
@@ -390,8 +398,8 @@ init_shadowfb (ClutterStageView *view)
return;
}
- g_warning ("Failed to initialize double buffered shadow fb for %s: %s",
- priv->name, error->message);
+ g_debug ("Failed to initialize double buffered shadow fb for %s: %s",
+ priv->name, error->message);
g_clear_error (&error);
if (!init_fallback_shadowfb (view, cogl_context, width, height, &error))
--
2.29.2

View File

@ -0,0 +1,248 @@
From 7f6f326a1bb96aad0b7aea9c4d7e257bf53c026c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 21 Feb 2020 21:03:16 +0100
Subject: [PATCH] display: Make check-alive timeout configureable
The check-alive feature is there for the user to be able to terminate
frozen applications more easily. However, sometimes applications are
implemented in a way where they fail to be reply to ping requests in a
timely manner, resulting in that, to the compositor, they are
indistinguishable from clients that have frozen indefinitely.
When using an application that has these issues, the GUI showed in
response to the failure to respond to ping requests can become annoying,
as it disrupts the visual presentation of the application.
To allow users to work-around these issues, add a setting allowing them
to configure the timeout waited until an application is considered
frozen, or disabling the check completely.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1080
---
data/org.gnome.mutter.gschema.xml.in | 10 ++++
src/core/display.c | 18 ++++----
src/core/prefs.c | 68 ++++++++++++++++++++++++++++
src/meta/prefs.h | 3 ++
4 files changed, 90 insertions(+), 9 deletions(-)
diff --git a/data/org.gnome.mutter.gschema.xml.in b/data/org.gnome.mutter.gschema.xml.in
index 6cbd9c1b5..4d37b1488 100644
--- a/data/org.gnome.mutter.gschema.xml.in
+++ b/data/org.gnome.mutter.gschema.xml.in
@@ -123,6 +123,16 @@
</description>
</key>
+ <key name="check-alive-timeout" type="u">
+ <default>5000</default>
+ <summary>Timeout for check-alive ping</summary>
+ <description>
+ Number of milliseconds a client has to respond to a ping request in
+ order to not be detected as frozen. Using 0 will disable the alive check
+ completely.
+ </description>
+ </key>
+
<child name="keybindings" schema="org.gnome.mutter.keybindings"/>
</schema>
diff --git a/src/core/display.c b/src/core/display.c
index eb7dc43b6..c30a03385 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1923,12 +1923,6 @@ meta_set_syncing (gboolean setting)
}
}
-/*
- * How long, in milliseconds, we should wait after pinging a window
- * before deciding it's not going to get back to us.
- */
-#define PING_TIMEOUT_DELAY 5000
-
/**
* meta_display_ping_timeout:
* @data: All the information about this ping. It is a #MetaPingData
@@ -1986,6 +1980,11 @@ meta_display_ping_window (MetaWindow *window,
{
MetaDisplay *display = window->display;
MetaPingData *ping_data;
+ unsigned int check_alive_timeout;
+
+ check_alive_timeout = meta_prefs_get_check_alive_timeout ();
+ if (check_alive_timeout == 0)
+ return;
if (serial == 0)
{
@@ -1999,9 +1998,10 @@ meta_display_ping_window (MetaWindow *window,
ping_data = g_new (MetaPingData, 1);
ping_data->window = window;
ping_data->serial = serial;
- ping_data->ping_timeout_id = g_timeout_add (PING_TIMEOUT_DELAY,
- meta_display_ping_timeout,
- ping_data);
+ ping_data->ping_timeout_id =
+ g_timeout_add (check_alive_timeout,
+ meta_display_ping_timeout,
+ ping_data);
g_source_set_name_by_id (ping_data->ping_timeout_id, "[mutter] meta_display_ping_timeout");
display->pending_pings = g_slist_prepend (display->pending_pings, ping_data);
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 3f0db8afc..4892406ce 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -99,6 +99,7 @@ static gboolean bell_is_visible = FALSE;
static gboolean bell_is_audible = TRUE;
static gboolean gnome_accessibility = FALSE;
static gboolean gnome_animations = TRUE;
+static unsigned int check_alive_timeout = 5000;
static char *cursor_theme = NULL;
/* cursor_size will, when running as an X11 compositing window manager, be the
* actual cursor size, multiplied with the global window scaling factor. On
@@ -213,6 +214,12 @@ typedef struct
gint *target;
} MetaIntPreference;
+typedef struct
+{
+ MetaBasePreference base;
+ unsigned int *target;
+} MetaUintPreference;
+
/* All preferences that are not keybindings must be listed here,
* plus in the GSettings schemas and the MetaPreference enum.
@@ -491,6 +498,18 @@ static MetaIntPreference preferences_int[] =
{ { NULL, 0, 0 }, NULL },
};
+static MetaUintPreference preferences_uint[] =
+ {
+ {
+ { "check-alive-timeout",
+ SCHEMA_MUTTER,
+ META_PREF_CHECK_ALIVE_TIMEOUT,
+ },
+ &check_alive_timeout,
+ },
+ { { NULL, 0, 0 }, NULL },
+ };
+
static void
handle_preference_init_enum (void)
{
@@ -613,6 +632,21 @@ handle_preference_init_int (void)
}
}
+static void
+handle_preference_init_uint (void)
+{
+ MetaUintPreference *cursor = preferences_uint;
+
+ while (cursor->base.key != NULL)
+ {
+ if (cursor->target)
+ *cursor->target = g_settings_get_uint (SETTINGS (cursor->base.schema),
+ cursor->base.key);
+
+ ++cursor;
+ }
+}
+
static void
handle_preference_update_enum (GSettings *settings,
gchar *key)
@@ -788,6 +822,28 @@ handle_preference_update_int (GSettings *settings,
}
}
+static void
+handle_preference_update_uint (GSettings *settings,
+ char *key)
+{
+ MetaUintPreference *cursor = preferences_uint;
+ unsigned int new_value;
+
+ while (cursor->base.key && strcmp (key, cursor->base.key) != 0)
+ ++cursor;
+
+ if (!cursor->base.key || !cursor->target)
+ return;
+
+ new_value = g_settings_get_uint (SETTINGS (cursor->base.schema), key);
+
+ if (*cursor->target != new_value)
+ {
+ *cursor->target = new_value;
+ queue_changed (cursor->base.pref);
+ }
+}
+
/****************************************************************************/
/* Listeners. */
@@ -964,6 +1020,7 @@ meta_prefs_init (void)
handle_preference_init_string ();
handle_preference_init_string_array ();
handle_preference_init_int ();
+ handle_preference_init_uint ();
init_bindings ();
}
@@ -1017,6 +1074,8 @@ settings_changed (GSettings *settings,
handle_preference_update_bool (settings, key);
else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT32))
handle_preference_update_int (settings, key);
+ else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT32))
+ handle_preference_update_uint (settings, key);
else if (g_variant_type_equal (type, G_VARIANT_TYPE_STRING_ARRAY))
handle_preference_update_string_array (settings, key);
else if (g_variant_type_equal (type, G_VARIANT_TYPE_STRING))
@@ -1640,6 +1699,9 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_AUTO_MAXIMIZE:
return "AUTO_MAXIMIZE";
+
+ case META_PREF_CHECK_ALIVE_TIMEOUT:
+ return "CHECK_ALIVE_TIMEOUT";
}
return "(unknown)";
@@ -1966,6 +2028,12 @@ meta_prefs_get_overlay_binding (MetaKeyCombo *combo)
*combo = overlay_key_combo;
}
+unsigned int
+meta_prefs_get_check_alive_timeout (void)
+{
+ return check_alive_timeout;
+}
+
const char *
meta_prefs_get_iso_next_group_option (void)
{
diff --git a/src/meta/prefs.h b/src/meta/prefs.h
index 9664b5c07..f42d1c63c 100644
--- a/src/meta/prefs.h
+++ b/src/meta/prefs.h
@@ -103,6 +103,7 @@ typedef enum
META_PREF_AUTO_MAXIMIZE,
META_PREF_CENTER_NEW_WINDOWS,
META_PREF_DRAG_THRESHOLD,
+ META_PREF_CHECK_ALIVE_TIMEOUT,
} MetaPreference;
typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
@@ -475,4 +476,6 @@ gboolean meta_prefs_bell_is_audible (void);
META_EXPORT
GDesktopVisualBellType meta_prefs_get_visual_bell_type (void);
+unsigned int meta_prefs_get_check_alive_timeout (void);
+
#endif
--
2.28.0

View File

@ -0,0 +1,211 @@
From 19024a5b2eff02b22cdb3fc90142f522dd361996 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Fri, 27 Nov 2020 09:03:38 +0100
Subject: [PATCH] monitor-config-manager: Handle multiple builtin panels
gracefully
While multiple built-in panels isn't actually supported in any
meaningful manner, if we would ever end up with such a situation, e.g.
due to kernel bugs[0], we shouldn't crash when trying to set an
'external only' without any external monitors.
While we could handle this with more degraded functionality (e.g. don't
support the 'switch' method of monitor configuration at all), handle it
by simply not trying to switch to external-only when there are no,
according to the kernel, external monitors available. This would e.g.
still allow betwene 'mirror-all', and 'linear' switches.
The crash itself was disguised as an arbitrary X11 BadValue error, due
to mutter trying to resize the root window to 0x0, as the monitor
configuration that was applied consisted of zero logical monitors, thus
was effectively empty.
[0] https://bugzilla.redhat.com/show_bug.cgi?id=1896904
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1899260
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1607>
---
src/backends/meta-monitor-config-manager.c | 3 +
src/tests/monitor-unit-tests.c | 145 +++++++++++++++++++++
2 files changed, 148 insertions(+)
diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c
index bc1a39db8..d62bad52d 100644
--- a/src/backends/meta-monitor-config-manager.c
+++ b/src/backends/meta-monitor-config-manager.c
@@ -1157,6 +1157,9 @@ create_for_switch_config_external (MetaMonitorConfigManager *config_manager)
x += logical_monitor_config->layout.width;
}
+ if (!logical_monitor_configs)
+ return NULL;
+
return meta_monitors_config_new (monitor_manager,
logical_monitor_configs,
layout_mode,
diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c
index f47544b03..725f84173 100644
--- a/src/tests/monitor-unit-tests.c
+++ b/src/tests/monitor-unit-tests.c
@@ -3175,6 +3175,149 @@ meta_test_monitor_non_upright_panel (void)
check_monitor_configuration (&test_case);
}
+static void
+meta_test_monitor_switch_external_without_external (void)
+{
+ MonitorTestCase test_case = {
+ .setup = {
+ .modes = {
+ {
+ .width = 1024,
+ .height = 768,
+ .refresh_rate = 60.0
+ }
+ },
+ .n_modes = 1,
+ .outputs = {
+ {
+ .crtc = 0,
+ .modes = { 0 },
+ .n_modes = 1,
+ .preferred_mode = 0,
+ .possible_crtcs = { 0 },
+ .n_possible_crtcs = 1,
+ .width_mm = 222,
+ .height_mm = 125,
+ .is_laptop_panel = TRUE
+ },
+ {
+ .crtc = 1,
+ .modes = { 0 },
+ .n_modes = 1,
+ .preferred_mode = 0,
+ .possible_crtcs = { 1 },
+ .n_possible_crtcs = 1,
+ .width_mm = 222,
+ .height_mm = 125,
+ .is_laptop_panel = TRUE
+ }
+ },
+ .n_outputs = 2,
+ .crtcs = {
+ {
+ .current_mode = 0
+ },
+ {
+ .current_mode = 0
+ }
+ },
+ .n_crtcs = 2
+ },
+
+ .expect = {
+ .monitors = {
+ {
+ .outputs = { 0 },
+ .n_outputs = 1,
+ .modes = {
+ {
+ .width = 1024,
+ .height = 768,
+ .refresh_rate = 60.0,
+ .crtc_modes = {
+ {
+ .output = 0,
+ .crtc_mode = 0
+ }
+ }
+ }
+ },
+ .n_modes = 1,
+ .current_mode = 0,
+ .width_mm = 222,
+ .height_mm = 125
+ },
+ {
+ .outputs = { 1 },
+ .n_outputs = 1,
+ .modes = {
+ {
+ .width = 1024,
+ .height = 768,
+ .refresh_rate = 60.0,
+ .crtc_modes = {
+ {
+ .output = 1,
+ .crtc_mode = 0
+ }
+ }
+ }
+ },
+ .n_modes = 1,
+ .current_mode = 0,
+ .width_mm = 222,
+ .height_mm = 125
+ }
+ },
+ .n_monitors = 2,
+ .logical_monitors = {
+ {
+ .monitors = { 0 },
+ .n_monitors = 1,
+ .layout = { .x = 0, .y = 0, .width = 1024, .height = 768 },
+ .scale = 1
+ },
+ {
+ .monitors = { 1 },
+ .n_monitors = 1,
+ .layout = { .x = 1024, .y = 0, .width = 1024, .height = 768 },
+ .scale = 1
+ }
+ },
+ .n_logical_monitors = 2,
+ .primary_logical_monitor = 0,
+ .n_outputs = 2,
+ .crtcs = {
+ {
+ .current_mode = 0,
+ },
+ {
+ .current_mode = 0,
+ },
+ },
+ .n_crtcs = 2,
+ .n_tiled_monitors = 0,
+ .screen_width = 2048,
+ .screen_height = 768
+ }
+ };
+ MetaMonitorTestSetup *test_setup;
+ MetaBackend *backend = meta_get_backend ();
+ MetaMonitorManager *monitor_manager =
+ meta_backend_get_monitor_manager (backend);
+
+ test_setup = create_monitor_test_setup (&test_case.setup,
+ MONITOR_TEST_FLAG_NO_STORED);
+ emulate_hotplug (test_setup);
+ check_monitor_configuration (&test_case);
+
+ meta_monitor_manager_switch_config (monitor_manager,
+ META_MONITOR_SWITCH_CONFIG_EXTERNAL);
+ check_monitor_configuration (&test_case);
+
+ check_monitor_test_clients_state ();
+}
+
static void
meta_test_monitor_custom_vertical_config (void)
{
@@ -5969,6 +6112,8 @@ init_monitor_tests (void)
meta_test_monitor_preferred_non_first_mode);
add_monitor_test ("/backends/monitor/non-upright-panel",
meta_test_monitor_non_upright_panel);
+ add_monitor_test ("/backends/monitor/switch-external-without-external",
+ meta_test_monitor_switch_external_without_external);
add_monitor_test ("/backends/monitor/custom/vertical-config",
meta_test_monitor_custom_vertical_config);
--
2.29.2

View File

@ -0,0 +1,41 @@
From 9f8564ce066aeb704341d6f926daec0045243b70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 25 Jun 2020 10:06:38 +0200
Subject: [PATCH 1/2] monitor-manager-kms: Trigger hotplug processing on gpu
removal
---
src/backends/native/meta-monitor-manager-kms.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c
index 9a0364441a..2819881576 100644
--- a/src/backends/native/meta-monitor-manager-kms.c
+++ b/src/backends/native/meta-monitor-manager-kms.c
@@ -470,12 +470,18 @@ on_uevent (GUdevClient *client,
if (!g_strcmp0 (seat_id, device_seat))
handle_gpu_hotplug (manager_kms, device);
- }
-
- if (!g_udev_device_get_property_as_boolean (device, "HOTPLUG"))
- return;
- handle_hotplug_event (manager);
+ handle_hotplug_event (manager);
+ }
+ else if (g_str_equal (action, "remove") &&
+ g_udev_device_get_device_file (device) != NULL)
+ {
+ handle_hotplug_event (manager);
+ }
+ else if (g_udev_device_get_property_as_boolean (device, "HOTPLUG"))
+ {
+ handle_hotplug_event (manager);
+ }
}
static void
--
2.26.2

View File

@ -0,0 +1,304 @@
From d366b2bc4e89ed5807f0221afc25e66cb3d289ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Wed, 9 Dec 2020 11:23:37 +0100
Subject: [PATCH 1/2] xwayland: Don't spew warnings when looking for X11
displays
It's not important, so only show it when doing MUTTER_DEBUG=wayland.
Instead report what display numbers were eventually found.
---
src/wayland/meta-xwayland.c | 123 +++++++++++++++++++++++++++---------
1 file changed, 92 insertions(+), 31 deletions(-)
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 15c85df69..699d5561c 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -146,9 +146,10 @@ meta_xwayland_is_xwayland_surface (MetaWaylandSurface *surface)
}
static gboolean
-try_display (int display,
- char **filename_out,
- int *fd_out)
+try_display (int display,
+ char **filename_out,
+ int *fd_out,
+ GError **error)
{
gboolean ret = FALSE;
char *filename;
@@ -164,11 +165,32 @@ try_display (int display,
char pid[11];
char *end;
pid_t other;
+ int read_bytes;
fd = open (filename, O_CLOEXEC, O_RDONLY);
- if (fd < 0 || read (fd, pid, 11) != 11)
+ if (fd < 0)
{
- g_warning ("can't read lock file %s: %m", filename);
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+ "Failed to open lock file %s: %s",
+ filename, g_strerror (errno));
+ goto out;
+ }
+
+ read_bytes = read (fd, pid, 11);
+ if (read_bytes != 11)
+ {
+ if (read_bytes < 0)
+ {
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+ "Failed to read lock file %s: %s",
+ filename, g_strerror (errno));
+ }
+ else
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Failed to read lock file %s",
+ filename);
+ }
goto out;
}
close (fd);
@@ -178,7 +200,8 @@ try_display (int display,
other = strtol (pid, &end, 0);
if (end != pid + 10)
{
- g_warning ("can't parse lock file %s", filename);
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA,
+ "Can't parse lock file %s", filename);
goto out;
}
@@ -187,18 +210,23 @@ try_display (int display,
/* Process is dead. Try unlinking the lock file and trying again. */
if (unlink (filename) < 0)
{
- g_warning ("failed to unlink stale lock file %s: %m", filename);
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+ "Failed to unlink stale lock file %s: %m", filename);
goto out;
}
goto again;
}
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Lock file %s already occupied", filename);
goto out;
}
else if (fd < 0)
{
- g_warning ("failed to create lock file %s: %m", filename);
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Failed to create lock file %s: %s",
+ filename, g_strerror (errno));
goto out;
}
@@ -223,24 +251,34 @@ try_display (int display,
}
static char *
-create_lock_file (int display, int *display_out)
+create_lock_file (int display,
+ int *display_out,
+ GError **error)
{
+ g_autoptr (GError) local_error = NULL;
char *filename;
int fd;
-
char pid[12];
int size;
int number_of_tries = 0;
- while (!try_display (display, &filename, &fd))
+ while (!try_display (display, &filename, &fd, &local_error))
{
+ meta_verbose ("Failed to open display %d: %s\n",
+ display, local_error->message);
+ g_clear_error (&local_error);
+
display++;
number_of_tries++;
/* If we can't get a display after 50 times, then something's wrong. Just
* abort in this case. */
if (number_of_tries >= 50)
- return NULL;
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Tried to bind 50 display numbers, giving up");
+ return NULL;
+ }
}
/* Subtle detail: we use the pid of the wayland compositor, not the xserver
@@ -248,11 +286,22 @@ create_lock_file (int display, int *display_out)
* it _would've_ written without either the NUL or the size clamping, hence
* the disparity in size. */
size = snprintf (pid, 12, "%10d\n", getpid ());
+ errno = 0;
if (size != 11 || write (fd, pid, 11) != 11)
{
+ if (errno != 0)
+ {
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+ "Failed to write pid to lock file: %s",
+ g_strerror (errno));
+ }
+ else
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Failed to write pid to lock file");
+ }
unlink (filename);
close (fd);
- g_warning ("failed to write pid to lock file %s", filename);
g_free (filename);
return NULL;
}
@@ -264,8 +313,8 @@ create_lock_file (int display, int *display_out)
}
static int
-bind_to_abstract_socket (int display,
- gboolean *fatal)
+bind_to_abstract_socket (int display,
+ GError **error)
{
struct sockaddr_un addr;
socklen_t size, name_size;
@@ -274,8 +323,8 @@ bind_to_abstract_socket (int display,
fd = socket (PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (fd < 0)
{
- *fatal = TRUE;
- g_warning ("Failed to create socket: %m");
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+ "Failed to create socket: %s", g_strerror (errno));
return -1;
}
@@ -285,17 +334,18 @@ bind_to_abstract_socket (int display,
size = offsetof (struct sockaddr_un, sun_path) + name_size;
if (bind (fd, (struct sockaddr *) &addr, size) < 0)
{
- *fatal = errno != EADDRINUSE;
- g_warning ("failed to bind to @%s: %m", addr.sun_path + 1);
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+ "Failed to bind to @%s: %s",
+ addr.sun_path + 1, g_strerror (errno));
close (fd);
return -1;
}
if (listen (fd, 1) < 0)
{
- *fatal = errno != EADDRINUSE;
- g_warning ("Failed to listen on abstract socket @%s: %m",
- addr.sun_path + 1);
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+ "Failed to listen on abstract socket @%s: %s",
+ addr.sun_path + 1, g_strerror (errno));
close (fd);
return -1;
}
@@ -304,7 +354,8 @@ bind_to_abstract_socket (int display,
}
static int
-bind_to_unix_socket (int display)
+bind_to_unix_socket (int display,
+ GError **error)
{
struct sockaddr_un addr;
socklen_t size, name_size;
@@ -321,13 +372,18 @@ bind_to_unix_socket (int display)
unlink (addr.sun_path);
if (bind (fd, (struct sockaddr *) &addr, size) < 0)
{
- g_warning ("failed to bind to %s: %m\n", addr.sun_path);
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+ "Failed to bind to %s: %s",
+ addr.sun_path, g_strerror (errno));
close (fd);
return -1;
}
if (listen (fd, 1) < 0)
{
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+ "Failed to listen on %s: %s",
+ addr.sun_path, g_strerror (errno));
unlink (addr.sun_path);
close (fd);
return -1;
@@ -385,7 +441,6 @@ choose_xdisplay (MetaXWaylandManager *manager)
{
int display = 0;
char *lock_file = NULL;
- gboolean fatal = FALSE;
if (display_number_override != -1)
display = display_number_override;
@@ -394,33 +449,37 @@ choose_xdisplay (MetaXWaylandManager *manager)
do
{
- lock_file = create_lock_file (display, &display);
+ g_autoptr (GError) error = NULL;
+
+ lock_file = create_lock_file (display, &display, &error);
if (!lock_file)
{
- g_warning ("Failed to create an X lock file");
+ g_warning ("Failed to create an X lock file: %s", error->message);
return FALSE;
}
- manager->abstract_fd = bind_to_abstract_socket (display, &fatal);
+ manager->abstract_fd = bind_to_abstract_socket (display, &error);
if (manager->abstract_fd < 0)
{
unlink (lock_file);
- if (!fatal)
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_ADDRESS_IN_USE))
{
+ meta_verbose ("Failed to bind abstract socket: %s\n", error->message);
display++;
continue;
}
else
{
- g_warning ("Failed to bind abstract socket");
+ g_warning ("Failed to bind abstract socket: %s", error->message);
return FALSE;
}
}
- manager->unix_fd = bind_to_unix_socket (display);
+ manager->unix_fd = bind_to_unix_socket (display, &error);
if (manager->unix_fd < 0)
{
+ meta_verbose ("Failed to bind unix socket: %s\n", error->message);
unlink (lock_file);
close (manager->abstract_fd);
display++;
@@ -435,6 +494,8 @@ choose_xdisplay (MetaXWaylandManager *manager)
manager->display_name = g_strdup_printf (":%d", manager->display_index);
manager->lock_file = lock_file;
+ g_message ("Using X11 display %s for Xwayland", manager->display_name);
+
return TRUE;
}
--
2.29.2

View File

@ -0,0 +1,27 @@
From 03c30b76bae4c2e3f51a6689ebb7c0c60bd7b29a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Tue, 9 Feb 2021 18:00:26 +0100
Subject: [PATCH 2/2] cogl/gpu-info: Fix software acceleration detection
The string used to match mesa changed; update to fix software rendering
detection.
---
cogl/cogl/cogl-gpu-info.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cogl/cogl/cogl-gpu-info.c b/cogl/cogl/cogl-gpu-info.c
index f44319e96..c1817b3b0 100644
--- a/cogl/cogl/cogl-gpu-info.c
+++ b/cogl/cogl/cogl-gpu-info.c
@@ -192,6 +192,8 @@ check_mesa_vendor (const CoglGpuInfoStrings *strings)
return TRUE;
else if (strcmp (strings->vendor_string, "Mesa Project") == 0)
return TRUE;
+ else if (strcmp (strings->vendor_string, "Mesa/X.org") == 0)
+ return TRUE;
return FALSE;
}
--
2.29.2

View File

@ -0,0 +1,28 @@
From a192b9abd77aa14ae794850e41d210472f86b9b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 25 Jun 2020 10:09:48 +0200
Subject: [PATCH 2/2] gpu-kms: Reset CRTC, mode and output list if no resources
On device removal, the next resource retrieval will fail; handle this by
just clearing the CRTC, mode and outputs.
---
src/backends/native/meta-gpu-kms.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
index 93e509def5..dc93abb7b1 100644
--- a/src/backends/native/meta-gpu-kms.c
+++ b/src/backends/native/meta-gpu-kms.c
@@ -871,6 +871,9 @@ meta_gpu_kms_read_current (MetaGpu *gpu,
local_error->message);
gpu_kms->resources_init_failed_before = TRUE;
}
+ meta_gpu_take_outputs (gpu, NULL);
+ meta_gpu_take_modes (gpu, NULL);
+ meta_gpu_take_crtcs (gpu, NULL);
return TRUE;
}
--
2.26.2

View File

@ -0,0 +1,90 @@
From 56c2e4efdcef14531dcf752e89117d22a21ec8ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Wed, 9 Dec 2020 15:18:29 +0100
Subject: [PATCH 2/2] xwayland: Make sure /tmp/.X11-unix/ exists
When we're running under a polyinstantiated SELinux environment, we'll
likely start with an isolated and empty /tmp, meannig no /tmp/.X11-unix
directory to add things to. To make it possible to still function in
this kind of setup, make sure said directory exists.
---
src/wayland/meta-xwayland.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 699d5561c..f3df9766e 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -30,6 +30,7 @@
#include <glib-unix.h>
#include <glib.h>
#include <sys/socket.h>
+#include <sys/stat.h>
#include <sys/un.h>
#include "compositor/meta-surface-actor-wayland.h"
@@ -436,9 +437,27 @@ meta_xwayland_override_display_number (int number)
display_number_override = number;
}
+static gboolean
+ensure_x11_unix_dir (GError **error)
+{
+ if (mkdir ("/tmp/.X11-unix", 01777) != 0)
+ {
+ if (errno == EEXIST)
+ return TRUE;
+
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+ "Failed to create directory \"/tmp/.X11-unix\": %s",
+ g_strerror (errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
static gboolean
choose_xdisplay (MetaXWaylandManager *manager)
{
+ g_autoptr (GError) error = NULL;
int display = 0;
char *lock_file = NULL;
@@ -447,10 +466,15 @@ choose_xdisplay (MetaXWaylandManager *manager)
else if (g_getenv ("RUNNING_UNDER_GDM"))
display = 1024;
- do
+ if (!ensure_x11_unix_dir (&error))
{
- g_autoptr (GError) error = NULL;
+ g_warning ("Failed to ensure X11 socket directory: %s",
+ error->message);
+ return FALSE;
+ }
+ do
+ {
lock_file = create_lock_file (display, &display, &error);
if (!lock_file)
{
@@ -466,6 +490,7 @@ choose_xdisplay (MetaXWaylandManager *manager)
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_ADDRESS_IN_USE))
{
meta_verbose ("Failed to bind abstract socket: %s\n", error->message);
+ g_clear_error (&error);
display++;
continue;
}
@@ -480,6 +505,7 @@ choose_xdisplay (MetaXWaylandManager *manager)
if (manager->unix_fd < 0)
{
meta_verbose ("Failed to bind unix socket: %s\n", error->message);
+ g_clear_error (&error);
unlink (lock_file);
close (manager->abstract_fd);
display++;
--
2.29.2

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
diff --git a/src/backends/meta-screen-cast.c b/src/backends/meta-screen-cast.c
index 268155e..18fc779 100644
--- a/src/backends/meta-screen-cast.c
+++ b/src/backends/meta-screen-cast.c
@@ -32,7 +32,7 @@
#define META_SCREEN_CAST_DBUS_SERVICE "org.gnome.Mutter.ScreenCast"
#define META_SCREEN_CAST_DBUS_PATH "/org/gnome/Mutter/ScreenCast"
-#define META_SCREEN_CAST_API_VERSION 2
+#define META_SCREEN_CAST_API_VERSION 3
struct _MetaScreenCast
{

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
Name: mutter
Version: 3.32.2
Release: 44%{?dist}
Release: 55%{?dist}
Summary: Window and compositing manager based on Clutter
License: GPLv2+
@ -144,6 +144,10 @@ Patch404: 0001-backend-Add-getter-for-MetaScreenCast.patch
Patch405: 0002-renderer-native-Add-API-to-get-primary-GPU.patch
Patch406: 0003-screen-cast-Move-DMA-buffer-allocation-to-MetaScreen.patch
Patch407: 0004-screen-cast-Disable-DMA-buffer-based-screen-casting-.patch
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1351
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1365
Patch408: cursor-move-only-screen-cast-fixes.patch
Patch409: mutter-bump-screencast-api-version.patch
# Only treat WM_PROTOCOLS messages as WM_PROTOCOL messages (#1847203)
Patch500: 0001-stage-x11-Check-that-message-is-WM_PROTOCOLS-before-.patch
@ -151,6 +155,28 @@ Patch500: 0001-stage-x11-Check-that-message-is-WM_PROTOCOLS-before-.patch
# Don't show widow actor until explictly shown (#1719937)
Patch501: 0001-window-actor-Don-t-show-actor-until-meta_window_acto.patch
# Handle GPU unplug gracefully (#1846191)
Patch502: 0001-monitor-manager-kms-Trigger-hotplug-processing-on-gp.patch
Patch503: 0002-gpu-kms-Reset-CRTC-mode-and-output-list-if-no-resour.patch
# Add tile based shadow buffer damage tracking (#1670273)
Patch504: shadow-buffer-tile-damage.patch
# Add PING_TIMEOUT_DELAY to mutter MetaPreferences (#1886034)
Patch505: 0001-display-Make-check-alive-timeout-configureable.patch
# Polyinstantiation (#1861769)
Patch506: 0001-xwayland-Don-t-spew-warnings-when-looking-for-X11-di.patch
Patch507: 0002-xwayland-Make-sure-tmp-.X11-unix-exists.patch
# Mitigate nouveau misidentifying connectors (#1786496)
Patch508: 0001-monitor-config-manager-Handle-multiple-builtin-panel.patch
# Don't ever enable double buffered shadowfb and fix software rendering
# detection (#1921151)
Patch509: 0001-clutter-stage-view-Hide-double-buffered-shadowfb-beh.patch
Patch510: 0002-cogl-gpu-info-Fix-software-acceleration-detection.patch
BuildRequires: chrpath
BuildRequires: pango-devel
BuildRequires: startup-notification-devel
@ -292,6 +318,48 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%{_datadir}/mutter-%{mutter_api_version}/tests
%changelog
* Tue Feb 09 2021 Jonas Ådahl <jadahl@redhat.com> - 3.32.2-55
- Fix slow nouveau with llvmpipe
Resolves: #1921151
* Tue Jan 12 2021 Jonas Ådahl <jadahl@redhat.com> - 3.32.2-54
- Fix polyinstantiation patch backport
Resolves: #1861769
* Thu Dec 17 2020 Jonas Ådahl <jadahl@redhat.com> - 3.32.2-53
- Fix test case backport
Related: #1786496
* Thu Dec 17 2020 Jonas Ådahl <jadahl@redhat.com> - 3.32.2-52
- Support polyinstantiation
Resolves: #1861769
- Mitigate nouveau misidentifying connectors
Resolves: #1786496
* Mon Dec 07 2020 Jonas Ådahl <jadahl@redhat.com> - 3.32.2-51
- Add PING_TIMEOUT_DELAY to mutter MetaPreferences
Resolves: #1886034
* Thu Nov 26 2020 Jonas Ådahl <jadahl@redhat.com> - 3.32.2-50
- Fix GLX stereo buffer rebase error
Resolves: #1889528
* Tue Nov 10 2020 Jonas Ådahl <jadahl@redhat.com> - 3.32.2-49
- Add tile based shadow buffer damage tracking
Resolves: #1670273
* Thu Sep 03 2020 Florian Müllner <fmuellner@redhat.com> - 3.32.2-47
- Fix screen sharing on wayland
Resolves: #1873963
* Wed Jul 15 2020 Jonas Ådahl <jadahl@redhat.com> - 3.32.2-46
- Handle cursor only screen cast frames better
Related: #1837381
* Thu Jul 02 2020 Jonas Ådahl <jadahl@redhat.com> - 3.32.2-45
- Handle GPU unplug gracefully
Resolves: #1846191
* Thu Jun 25 2020 Jonas Ådahl <jadahl@redhat.com> - 3.32.2-44
- Don't show widow actor until explictly shown
Resolves: #1719937