kms/connector: Don't use MetaConnectorType for connector type

Use uint32_t as that is what it is in the drm layer. MetaConnectorType
will be less suitable, as it will grow custom connector types that can't
be mapped.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
This commit is contained in:
Jonas Ådahl 2021-03-09 19:19:47 +01:00 committed by Marge Bot
parent ba38057067
commit e7ae1978f8
3 changed files with 14 additions and 5 deletions

View File

@ -42,7 +42,7 @@ struct _MetaKmsConnector
MetaKmsDevice *device;
uint32_t id;
MetaConnectorType type;
uint32_t type;
uint32_t type_id;
char *name;
@ -76,7 +76,7 @@ meta_kms_connector_get_prop_name (MetaKmsConnector *connector,
return connector->prop_table.props[prop].name;
}
MetaConnectorType
uint32_t
meta_kms_connector_get_connector_type (MetaKmsConnector *connector)
{
return connector->type;
@ -621,7 +621,7 @@ meta_kms_connector_new (MetaKmsImplDevice *impl_device,
connector = g_object_new (META_TYPE_KMS_CONNECTOR, NULL);
connector->device = meta_kms_impl_device_get_device (impl_device);
connector->id = drm_connector->connector_id;
connector->type = (MetaConnectorType) drm_connector->connector_type;
connector->type = drm_connector->connector_type;
connector->type_id = drm_connector->connector_type_id;
connector->name = make_connector_name (drm_connector);

View File

@ -61,7 +61,7 @@ typedef struct _MetaKmsConnectorState
MetaKmsDevice * meta_kms_connector_get_device (MetaKmsConnector *connector);
MetaConnectorType meta_kms_connector_get_connector_type (MetaKmsConnector *connector);
uint32_t meta_kms_connector_get_connector_type (MetaKmsConnector *connector);
uint32_t meta_kms_connector_get_id (MetaKmsConnector *connector);

View File

@ -267,6 +267,12 @@ init_output_modes (MetaOutputInfo *output_info,
return TRUE;
}
static MetaConnectorType
meta_kms_connector_type_from_drm (uint32_t drm_connector_type)
{
return (MetaConnectorType) drm_connector_type;
}
MetaOutputKms *
meta_output_kms_new (MetaGpuKms *gpu_kms,
MetaKmsConnector *kms_connector,
@ -279,6 +285,7 @@ meta_output_kms_new (MetaGpuKms *gpu_kms,
g_autoptr (MetaOutputInfo) output_info = NULL;
MetaOutput *output;
MetaOutputKms *output_kms;
uint32_t drm_connector_type;
const MetaKmsConnectorState *connector_state;
GArray *crtcs;
GList *l;
@ -331,7 +338,9 @@ meta_output_kms_new (MetaGpuKms *gpu_kms,
meta_output_info_parse_edid (output_info, connector_state->edid_data);
output_info->connector_type = meta_kms_connector_get_connector_type (kms_connector);
drm_connector_type = meta_kms_connector_get_connector_type (kms_connector);
output_info->connector_type =
meta_kms_connector_type_from_drm (drm_connector_type);
output_info->tile_info = connector_state->tile_info;