mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
kms: drmModeGetConnector may fail
drmModeGetConnector may fail and return NULL, this may happen when a connector is removed underneath us (which can happen with e.g. DP MST or GPU hot unplug). Deal with this by skipping the connector when enumerating and by assuming it is disconnected when checking its connection state. https://gitlab.gnome.org/GNOME/mutter/merge_requests/713
This commit is contained in:
parent
578ff22464
commit
3ccb7cf4b2
@ -456,7 +456,7 @@ meta_kms_connector_read_state (MetaKmsConnector *connector,
|
|||||||
|
|
||||||
g_clear_pointer (&connector->current_state, meta_kms_connector_state_free);
|
g_clear_pointer (&connector->current_state, meta_kms_connector_state_free);
|
||||||
|
|
||||||
if (drm_connector->connection != DRM_MODE_CONNECTED)
|
if (!drm_connector || drm_connector->connection != DRM_MODE_CONNECTED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
state = meta_kms_connector_state_new ();
|
state = meta_kms_connector_state_new ();
|
||||||
|
@ -209,6 +209,9 @@ init_connectors (MetaKmsImplDevice *impl_device,
|
|||||||
|
|
||||||
drm_connector = drmModeGetConnector (impl_device->fd,
|
drm_connector = drmModeGetConnector (impl_device->fd,
|
||||||
drm_resources->connectors[i]);
|
drm_resources->connectors[i]);
|
||||||
|
if (!drm_connector)
|
||||||
|
continue;
|
||||||
|
|
||||||
connector = meta_kms_connector_new (impl_device, drm_connector,
|
connector = meta_kms_connector_new (impl_device, drm_connector,
|
||||||
drm_resources);
|
drm_resources);
|
||||||
drmModeFreeConnector (drm_connector);
|
drmModeFreeConnector (drm_connector);
|
||||||
|
Loading…
Reference in New Issue
Block a user