1
0
Fork 0

onscreen/native: Move next_frame storage to later in the function

It won't be used until later when we flip, and in fact assigning
it early could have led to its own assertion failing on the next frame
in the unlikely event that we return with "Failed to ensure KMS FB ID...

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3891>
This commit is contained in:
Daniel van Vugt 2024-07-18 17:26:38 +08:00
parent 288d57f6a5
commit c4d0e970dc

View file

@ -1365,9 +1365,6 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
primary_gpu_fb,
secondary_gpu_fb);
g_warn_if_fail (!onscreen_native->next_frame);
onscreen_native->next_frame = clutter_frame_ref (frame);
switch (renderer_gpu_data->mode)
{
case META_RENDERER_NATIVE_MODE_GBM:
@ -1392,6 +1389,9 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
#endif
}
g_warn_if_fail (!onscreen_native->next_frame);
onscreen_native->next_frame = clutter_frame_ref (frame);
/*
* If we changed EGL context, cogl will have the wrong idea about what is
* current, making it fail to set it when it needs to. Avoid that by making