1
0
Fork 0

kms/impl-device: Add function meta_kms_impl_device_has_cursor_plane_for

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3676>
This commit is contained in:
Daniel van Vugt 2024-04-02 17:13:13 +08:00 committed by Marge Bot
parent dd32f3b3be
commit b620dbb188
2 changed files with 23 additions and 0 deletions

View file

@ -198,6 +198,26 @@ meta_kms_impl_device_peek_planes (MetaKmsImplDevice *impl_device)
return priv->planes;
}
gboolean
meta_kms_impl_device_has_cursor_plane_for (MetaKmsImplDevice *impl_device,
MetaKmsCrtc *crtc)
{
MetaKmsImplDevicePrivate *priv =
meta_kms_impl_device_get_instance_private (impl_device);
GList *l;
for (l = priv->planes; l; l = l->next)
{
MetaKmsPlane *plane = l->data;
if (meta_kms_plane_get_plane_type (plane) == META_KMS_PLANE_TYPE_CURSOR &&
meta_kms_plane_is_usable_with (plane, crtc))
return TRUE;
}
return FALSE;
}
const MetaKmsDeviceCaps *
meta_kms_impl_device_get_caps (MetaKmsImplDevice *impl_device)
{

View file

@ -119,6 +119,9 @@ GList * meta_kms_impl_device_peek_crtcs (MetaKmsImplDevice *impl_device);
GList * meta_kms_impl_device_peek_planes (MetaKmsImplDevice *impl_device);
gboolean meta_kms_impl_device_has_cursor_plane_for (MetaKmsImplDevice *impl_device,
MetaKmsCrtc *crtc);
const MetaKmsDeviceCaps * meta_kms_impl_device_get_caps (MetaKmsImplDevice *impl_device);
GList * meta_kms_impl_device_copy_fallback_modes (MetaKmsImplDevice *impl_device);