output-kms: Hand over fallback mode management to MetaKms

Eventually we need MetaKmsMode for more than carrying the
drmModeModeInfo, so prepare for that by having the KMS layer create
MetaKmsMode for those as well.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
This commit is contained in:
Jonas Ådahl
2020-07-02 11:54:56 +02:00
committed by Marge Bot
parent 0fa0eeef57
commit d3abaf46a1
7 changed files with 98 additions and 55 deletions

View File

@ -47,6 +47,8 @@ struct _MetaKmsDevice
GList *planes;
MetaKmsDeviceCaps caps;
GList *fallback_modes;
};
G_DEFINE_TYPE (MetaKmsDevice, meta_kms_device, G_TYPE_OBJECT);
@ -157,6 +159,12 @@ meta_kms_device_get_cursor_plane_for (MetaKmsDevice *device,
return get_plane_with_type_for (device, crtc, META_KMS_PLANE_TYPE_CURSOR);
}
GList *
meta_kms_device_get_fallback_modes (MetaKmsDevice *device)
{
return device->fallback_modes;
}
void
meta_kms_device_update_states_in_impl (MetaKmsDevice *device)
{
@ -214,6 +222,7 @@ typedef struct _CreateImplDeviceData
GList *out_connectors;
GList *out_planes;
MetaKmsDeviceCaps out_caps;
GList *out_fallback_modes;
char *out_driver_name;
char *out_driver_description;
} CreateImplDeviceData;
@ -235,6 +244,8 @@ create_impl_device_in_impl (MetaKmsImpl *impl,
data->out_connectors = meta_kms_impl_device_copy_connectors (impl_device);
data->out_planes = meta_kms_impl_device_copy_planes (impl_device);
data->out_caps = *meta_kms_impl_device_get_caps (impl_device);
data->out_fallback_modes =
meta_kms_impl_device_copy_fallback_modes (impl_device);
data->out_driver_name =
g_strdup (meta_kms_impl_device_get_driver_name (impl_device));
data->out_driver_description =
@ -282,6 +293,7 @@ meta_kms_device_new (MetaKms *kms,
device->connectors = data.out_connectors;
device->planes = data.out_planes;
device->caps = data.out_caps;
device->fallback_modes = data.out_fallback_modes;
device->driver_name = data.out_driver_name;
device->driver_description = data.out_driver_description;