mirror of
https://github.com/brl/mutter.git
synced 2025-04-02 08:33:47 +00:00
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>
This commit is contained in:
parent
3bad37482d
commit
b693e58c53
@ -141,9 +141,10 @@ meta_kms_mode_set_free (MetaKmsModeSet *mode_set)
|
|||||||
g_free (mode_set);
|
g_free (mode_set);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static gboolean
|
||||||
meta_kms_update_drop_plane_assignment (MetaKmsUpdate *update,
|
drop_plane_assignment (MetaKmsUpdate *update,
|
||||||
MetaKmsPlane *plane)
|
MetaKmsPlane *plane,
|
||||||
|
MetaKmsAssignPlaneFlag *out_flags)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
@ -155,10 +156,21 @@ meta_kms_update_drop_plane_assignment (MetaKmsUpdate *update,
|
|||||||
{
|
{
|
||||||
update->plane_assignments =
|
update->plane_assignments =
|
||||||
g_list_delete_link (update->plane_assignments, l);
|
g_list_delete_link (update->plane_assignments, l);
|
||||||
|
if (out_flags)
|
||||||
|
*out_flags = plane_assignment->flags;
|
||||||
meta_kms_plane_assignment_free (plane_assignment);
|
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 *
|
MetaKmsPlaneAssignment *
|
||||||
@ -171,6 +183,7 @@ meta_kms_update_assign_plane (MetaKmsUpdate *update,
|
|||||||
MetaKmsAssignPlaneFlag flags)
|
MetaKmsAssignPlaneFlag flags)
|
||||||
{
|
{
|
||||||
MetaKmsPlaneAssignment *plane_assignment;
|
MetaKmsPlaneAssignment *plane_assignment;
|
||||||
|
MetaKmsAssignPlaneFlag old_flags;
|
||||||
|
|
||||||
g_assert (!meta_kms_update_is_locked (update));
|
g_assert (!meta_kms_update_is_locked (update));
|
||||||
g_assert (meta_kms_crtc_get_device (crtc) == update->device);
|
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 ||
|
META_KMS_PLANE_TYPE_PRIMARY ||
|
||||||
!(flags & META_KMS_ASSIGN_PLANE_FLAG_ALLOW_FAIL));
|
!(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 = g_new0 (MetaKmsPlaneAssignment, 1);
|
||||||
*plane_assignment = (MetaKmsPlaneAssignment) {
|
*plane_assignment = (MetaKmsPlaneAssignment) {
|
||||||
.update = update,
|
.update = update,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user