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
This commit is contained in:
Philipp Zabel 2020-08-01 13:25:31 +02:00 committed by Jonas Ådahl
parent 769997b0bc
commit 7564c2f2e4
3 changed files with 5 additions and 1 deletions

View File

@ -506,7 +506,7 @@ init_outputs (MetaGpuKms *gpu_kms)
GError *error = NULL; GError *error = NULL;
connector_state = meta_kms_connector_get_current_state (kms_connector); connector_state = meta_kms_connector_get_current_state (kms_connector);
if (!connector_state) if (!connector_state || connector_state->non_desktop)
continue; continue;
old_output = old_output =

View File

@ -206,6 +206,9 @@ state_set_properties (MetaKmsConnectorState *state,
else if ((prop->flags & DRM_MODE_PROP_ENUM) && else if ((prop->flags & DRM_MODE_PROP_ENUM) &&
strcmp (prop->name, "panel orientation") == 0) strcmp (prop->name, "panel orientation") == 0)
set_panel_orientation (state, prop, drm_connector->prop_values[i]); 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); drmModeFreeProperty (prop);
} }

View File

@ -49,6 +49,7 @@ typedef struct _MetaKmsConnectorState
GBytes *edid_data; GBytes *edid_data;
gboolean has_scaling; gboolean has_scaling;
gboolean non_desktop;
CoglSubpixelOrder subpixel_order; CoglSubpixelOrder subpixel_order;