1
0
Fork 0

MetaOnscreenNative: Make flip waiting state more generic

Use a boolean to keep track whether a flipped event is pending or not,
and use that instead of looking at the framebuffer id field.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
This commit is contained in:
Jonas Ådahl 2016-09-29 22:15:26 +08:00
parent ad784501a6
commit 59b4b5e9e8

View file

@ -73,6 +73,7 @@ typedef struct _MetaOnscreenNative
struct gbm_bo *next_bo; struct gbm_bo *next_bo;
} gbm; } gbm;
gboolean pending_queue_swap_notify;
gboolean pending_swap_notify; gboolean pending_swap_notify;
gboolean pending_set_crtc; gboolean pending_set_crtc;
@ -399,6 +400,8 @@ on_crtc_flipped (GClosure *closure,
onscreen_native->pending_flips--; onscreen_native->pending_flips--;
if (onscreen_native->pending_flips == 0) if (onscreen_native->pending_flips == 0)
{ {
onscreen_native->pending_queue_swap_notify = FALSE;
meta_onscreen_native_queue_swap_notify (onscreen); meta_onscreen_native_queue_swap_notify (onscreen);
meta_onscreen_native_swap_drm_fb (onscreen); meta_onscreen_native_swap_drm_fb (onscreen);
} }
@ -425,8 +428,12 @@ flip_closure_destroyed (MetaRendererView *view)
onscreen_native->gbm.next_bo); onscreen_native->gbm.next_bo);
onscreen_native->gbm.next_bo = NULL; onscreen_native->gbm.next_bo = NULL;
onscreen_native->gbm.next_fb_id = 0; onscreen_native->gbm.next_fb_id = 0;
}
if (onscreen_native->pending_queue_swap_notify)
{
meta_onscreen_native_queue_swap_notify (onscreen); meta_onscreen_native_queue_swap_notify (onscreen);
onscreen_native->pending_queue_swap_notify = FALSE;
} }
g_object_unref (view); g_object_unref (view);
@ -586,6 +593,8 @@ meta_onscreen_native_flip_crtcs (CoglOnscreen *onscreen)
meta_onscreen_native_swap_drm_fb (onscreen); meta_onscreen_native_swap_drm_fb (onscreen);
} }
onscreen_native->pending_queue_swap_notify = TRUE;
g_closure_unref (flip_closure); g_closure_unref (flip_closure);
} }