kms/impl-device/simple: Ensure buffer fb_id on test update too

This ensures the fb_id will be there when we actually apply the update,
and will also make scanout test case pass if we run it with the
non-atomic KMS API.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2456>
This commit is contained in:
Jonas Ådahl 2022-06-03 18:32:17 +02:00 committed by Marge Bot
parent e0145447a3
commit 5823d2d1ae

View File

@ -1414,6 +1414,7 @@ perform_update_test (MetaKmsImplDevice *impl_device,
MetaKmsCrtc *crtc = plane_assignment->crtc;
MetaDrmBuffer *buffer = plane_assignment->buffer;
CachedModeSet *cached_mode_set;
g_autoptr (GError) error = NULL;
if (!plane_assignment->crtc ||
!plane_assignment->buffer)
@ -1432,6 +1433,17 @@ perform_update_test (MetaKmsImplDevice *impl_device,
continue;
}
if (!meta_drm_buffer_ensure_fb_id (plane_assignment->buffer, &error))
{
MetaKmsPlaneFeedback *plane_feedback;
plane_feedback =
meta_kms_plane_feedback_new_take_error (plane, crtc,
g_steal_pointer (&error));
failed_planes = g_list_append (failed_planes, plane_feedback);
continue;
}
if (meta_drm_buffer_get_width (buffer) != cached_mode_set->width ||
meta_drm_buffer_get_height (buffer) != cached_mode_set->height ||
meta_drm_buffer_get_stride (buffer) != cached_mode_set->stride ||