diff --git a/src/backends/native/meta-kms-update-private.h b/src/backends/native/meta-kms-update-private.h index 44c950ea2..4fcc170c2 100644 --- a/src/backends/native/meta-kms-update-private.h +++ b/src/backends/native/meta-kms-update-private.h @@ -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); diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c index 18999210f..d3a6b85a2 100644 --- a/src/backends/native/meta-kms-update.c +++ b/src/backends/native/meta-kms-update.c @@ -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) {