[mutter] kms: Skip displays with 'non-desktop' property set
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] kms: Skip displays with 'non-desktop' property set
- Date: Wed, 5 Aug 2020 06:18:50 +0000 (UTC)
commit 7564c2f2e41cff1c3ea4354fb7bef59ee3af1722
Author: Philipp Zabel <philipp zabel gmail com>
Date: Sat Aug 1 13:25:31 2020 +0200
kms: Skip displays with 'non-desktop' property set
Detect displays marked as 'non-desktop' by the kernel and skip them when
creating the outputs. Mutter is not able to render images that are shown
properly on those devices anyway.
This avoids lighting up attached VR HMDs and showing the GDM login
screen between the eyes in a VR HMD instead of on the monitor.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1393
src/backends/native/meta-gpu-kms.c | 2 +-
src/backends/native/meta-kms-connector.c | 3 +++
src/backends/native/meta-kms-connector.h | 1 +
3 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
index fa50c98a8f..65eece375a 100644
--- a/src/backends/native/meta-gpu-kms.c
+++ b/src/backends/native/meta-gpu-kms.c
@@ -506,7 +506,7 @@ init_outputs (MetaGpuKms *gpu_kms)
GError *error = NULL;
connector_state = meta_kms_connector_get_current_state (kms_connector);
- if (!connector_state)
+ if (!connector_state || connector_state->non_desktop)
continue;
old_output =
diff --git a/src/backends/native/meta-kms-connector.c b/src/backends/native/meta-kms-connector.c
index ce8d28ae07..4eee7522e6 100644
--- a/src/backends/native/meta-kms-connector.c
+++ b/src/backends/native/meta-kms-connector.c
@@ -206,6 +206,9 @@ state_set_properties (MetaKmsConnectorState *state,
else if ((prop->flags & DRM_MODE_PROP_ENUM) &&
strcmp (prop->name, "panel orientation") == 0)
set_panel_orientation (state, prop, drm_connector->prop_values[i]);
+ if ((prop->flags & DRM_MODE_PROP_RANGE) &&
+ strcmp (prop->name, "non-desktop") == 0)
+ state->non_desktop = drm_connector->prop_values[i];
drmModeFreeProperty (prop);
}
diff --git a/src/backends/native/meta-kms-connector.h b/src/backends/native/meta-kms-connector.h
index b6198b467e..2547dc16d3 100644
--- a/src/backends/native/meta-kms-connector.h
+++ b/src/backends/native/meta-kms-connector.h
@@ -49,6 +49,7 @@ typedef struct _MetaKmsConnectorState
GBytes *edid_data;
gboolean has_scaling;
+ gboolean non_desktop;
CoglSubpixelOrder subpixel_order;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]