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>
Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
Daniel van Vugt 2024-07-18 17:26:38 +08:00 committed by Mingi Sung
parent 1815af679f
commit bc74aadcc2
Signed by: sungmg
GPG key ID: 41BAFD6FFD8036C5

View file

@ -1395,9 +1395,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:
@ -1422,6 +1419,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