kms/update: Add getter for cursor plane assignment

To be used in tests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2159>
This commit is contained in:
Jonas Ådahl 2021-06-16 10:21:55 +02:00 committed by Marge Bot
parent 501b6f52d3
commit bf398a5f84
2 changed files with 22 additions and 4 deletions

View File

@ -136,6 +136,9 @@ void meta_kms_plane_assignment_set_rotation (MetaKmsPlaneAssignment *plane_assig
MetaKmsPlaneAssignment * meta_kms_update_get_primary_plane_assignment (MetaKmsUpdate *update,
MetaKmsCrtc *crtc);
MetaKmsPlaneAssignment * meta_kms_update_get_cursor_plane_assignment (MetaKmsUpdate *update,
MetaKmsCrtc *crtc);
GList * meta_kms_update_get_plane_assignments (MetaKmsUpdate *update);
GList * meta_kms_update_get_mode_sets (MetaKmsUpdate *update);

View File

@ -595,9 +595,10 @@ meta_kms_result_listener_free (MetaKmsResultListener *listener)
g_free (listener);
}
MetaKmsPlaneAssignment *
meta_kms_update_get_primary_plane_assignment (MetaKmsUpdate *update,
MetaKmsCrtc *crtc)
static MetaKmsPlaneAssignment *
get_first_plane_assignment (MetaKmsUpdate *update,
MetaKmsCrtc *crtc,
MetaKmsPlaneType plane_type)
{
GList *l;
@ -606,7 +607,7 @@ meta_kms_update_get_primary_plane_assignment (MetaKmsUpdate *update,
MetaKmsPlaneAssignment *plane_assignment = l->data;
if (meta_kms_plane_get_plane_type (plane_assignment->plane) !=
META_KMS_PLANE_TYPE_PRIMARY)
plane_type)
continue;
if (plane_assignment->crtc != crtc)
@ -618,6 +619,20 @@ meta_kms_update_get_primary_plane_assignment (MetaKmsUpdate *update,
return NULL;
}
MetaKmsPlaneAssignment *
meta_kms_update_get_primary_plane_assignment (MetaKmsUpdate *update,
MetaKmsCrtc *crtc)
{
return get_first_plane_assignment (update, crtc, META_KMS_PLANE_TYPE_PRIMARY);
}
MetaKmsPlaneAssignment *
meta_kms_update_get_cursor_plane_assignment (MetaKmsUpdate *update,
MetaKmsCrtc *crtc)
{
return get_first_plane_assignment (update, crtc, META_KMS_PLANE_TYPE_CURSOR);
}
GList *
meta_kms_update_get_plane_assignments (MetaKmsUpdate *update)
{