From 851024f7300b0b9a996f27ab830d6ac596eaf0f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 1 Nov 2019 15:23:19 +0100 Subject: [PATCH] kms/update: Add unassign_plane() API Meant to disable a plane. https://gitlab.gnome.org/GNOME/mutter/merge_requests/930 --- src/backends/native/meta-kms-update.c | 23 +++++++++++++++++++++++ src/backends/native/meta-kms-update.h | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c index c946aa7a2..c2a5cc440 100644 --- a/src/backends/native/meta-kms-update.c +++ b/src/backends/native/meta-kms-update.c @@ -102,6 +102,29 @@ meta_kms_update_assign_plane (MetaKmsUpdate *update, return plane_assignment; } +MetaKmsPlaneAssignment * +meta_kms_update_unassign_plane (MetaKmsUpdate *update, + MetaKmsCrtc *crtc, + MetaKmsPlane *plane) +{ + MetaKmsPlaneAssignment *plane_assignment; + + g_assert (!meta_kms_update_is_sealed (update)); + + plane_assignment = g_new0 (MetaKmsPlaneAssignment, 1); + *plane_assignment = (MetaKmsPlaneAssignment) { + .update = update, + .crtc = crtc, + .plane = plane, + .fb_id = 0, + }; + + update->plane_assignments = g_list_prepend (update->plane_assignments, + plane_assignment); + + return plane_assignment; +} + void meta_kms_update_mode_set (MetaKmsUpdate *update, MetaKmsCrtc *crtc, diff --git a/src/backends/native/meta-kms-update.h b/src/backends/native/meta-kms-update.h index 1b6942f27..bb663addb 100644 --- a/src/backends/native/meta-kms-update.h +++ b/src/backends/native/meta-kms-update.h @@ -66,6 +66,10 @@ MetaKmsPlaneAssignment * meta_kms_update_assign_plane (MetaKmsUpdate *upd MetaFixed16Rectangle src_rect, MetaFixed16Rectangle dst_rect); +MetaKmsPlaneAssignment * meta_kms_update_unassign_plane (MetaKmsUpdate *update, + MetaKmsCrtc *crtc, + MetaKmsPlane *plane); + void meta_kms_update_page_flip (MetaKmsUpdate *update, MetaKmsCrtc *crtc, const MetaKmsPageFlipFeedback *feedback,