Prefer GPUs with built-in panels connected when selecting a primary GPU
Some laptops don't have the integrated GPU come earlier in the PCI topology which means that when mutter enumerates the GPUs it may select the dGPU as the primary. In a laptop context, this is unlikely to work because the eDP panel can only be actively connected to a single GPU at a time. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3746 Suggested-by: Jonas Ådahl Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4114>
This commit is contained in:

committed by
Marge Bot

parent
a280280cff
commit
ecbe4a5dad
@ -849,3 +849,27 @@ meta_kms_device_class_init (MetaKmsDeviceClass *klass)
|
||||
G_TYPE_NONE, 1,
|
||||
META_TYPE_KMS_CRTC);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_kms_device_has_connected_builtin_panel (MetaKmsDevice *device)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = device->connectors; l; l = l->next)
|
||||
{
|
||||
MetaKmsConnector *connector = META_KMS_CONNECTOR (l->data);
|
||||
|
||||
if (!meta_kms_connector_get_current_state (connector))
|
||||
continue;
|
||||
|
||||
switch (meta_kms_connector_get_connector_type (connector))
|
||||
{
|
||||
case DRM_MODE_CONNECTOR_LVDS:
|
||||
case DRM_MODE_CONNECTOR_eDP:
|
||||
case DRM_MODE_CONNECTOR_DSI:
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user