[mutter] kms/update: If reassigning a plane handle the fb changed flag
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] kms/update: If reassigning a plane handle the fb changed flag
- Date: Fri, 22 Jan 2021 17:08:30 +0000 (UTC)
commit b693e58c538143ec8b066a47c1244da9339f93a7
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Oct 2 16:53:16 2020 +0200
kms/update: If reassigning a plane handle the fb changed flag
If we reassign e.g. a cursor plane twice before it's updated, we need to
make sure the 'fb-unchanged' flag is correctly handled, so that if we
changed the fb first, then updated the assignment again only changing
the position, the new assignment should not be flagged with
fb-unchanged.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
src/backends/native/meta-kms-update.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
---
diff --git a/src/backends/native/meta-kms-update.c b/src/backends/native/meta-kms-update.c
index 197ebc3bd3..e03d035335 100644
--- a/src/backends/native/meta-kms-update.c
+++ b/src/backends/native/meta-kms-update.c
@@ -141,9 +141,10 @@ meta_kms_mode_set_free (MetaKmsModeSet *mode_set)
g_free (mode_set);
}
-void
-meta_kms_update_drop_plane_assignment (MetaKmsUpdate *update,
- MetaKmsPlane *plane)
+static gboolean
+drop_plane_assignment (MetaKmsUpdate *update,
+ MetaKmsPlane *plane,
+ MetaKmsAssignPlaneFlag *out_flags)
{
GList *l;
@@ -155,10 +156,21 @@ meta_kms_update_drop_plane_assignment (MetaKmsUpdate *update,
{
update->plane_assignments =
g_list_delete_link (update->plane_assignments, l);
+ if (out_flags)
+ *out_flags = plane_assignment->flags;
meta_kms_plane_assignment_free (plane_assignment);
- return;
+ return TRUE;
}
}
+
+ return FALSE;
+}
+
+void
+meta_kms_update_drop_plane_assignment (MetaKmsUpdate *update,
+ MetaKmsPlane *plane)
+{
+ drop_plane_assignment (update, plane, NULL);
}
MetaKmsPlaneAssignment *
@@ -171,6 +183,7 @@ meta_kms_update_assign_plane (MetaKmsUpdate *update,
MetaKmsAssignPlaneFlag flags)
{
MetaKmsPlaneAssignment *plane_assignment;
+ MetaKmsAssignPlaneFlag old_flags;
g_assert (!meta_kms_update_is_locked (update));
g_assert (meta_kms_crtc_get_device (crtc) == update->device);
@@ -179,6 +192,12 @@ meta_kms_update_assign_plane (MetaKmsUpdate *update,
META_KMS_PLANE_TYPE_PRIMARY ||
!(flags & META_KMS_ASSIGN_PLANE_FLAG_ALLOW_FAIL));
+ if (drop_plane_assignment (update, plane, &old_flags))
+ {
+ if (!(old_flags & META_KMS_ASSIGN_PLANE_FLAG_FB_UNCHANGED))
+ flags &= ~META_KMS_ASSIGN_PLANE_FLAG_FB_UNCHANGED;
+ }
+
plane_assignment = g_new0 (MetaKmsPlaneAssignment, 1);
*plane_assignment = (MetaKmsPlaneAssignment) {
.update = update,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]