1
0
Fork 0

onscreen/native: Notify frame complete on failure to lock front buffer

If such a failure is followed by a successful frame then the Cogl frame
queue would have size 2, leading to an assertion failure in
`meta_onscreen_native_notify_frame_complete`:

```
g_assert (!cogl_onscreen_peek_head_frame_info (onscreen));
```

Notifying on the failure however keeps the Cogl frame queue limited to
a size of 1 and we recover gracefully with only a missed frame and a
warning message.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3278
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3565>
This commit is contained in:
Daniel van Vugt 2024-02-07 15:16:43 +08:00 committed by Marge Bot
parent 0eb9c43908
commit 1c58c8cb92

View file

@ -1277,6 +1277,9 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
g_warning ("Failed to lock front buffer on %s: %s",
meta_device_file_get_path (render_device_file),
error->message);
frame_info->flags |= COGL_FRAME_INFO_FLAG_SYMBOLIC;
meta_onscreen_native_notify_frame_complete (onscreen);
return;
}