From 5a1e8d55fb754b5cee0ac9c04b166c7a552139df Mon Sep 17 00:00:00 2001 From: vanfanel Date: Sun, 15 Jan 2017 13:47:30 +0100 Subject: [PATCH] DISPMANX: Put guard back in to avoid potential lockups! --- gfx/drivers/dispmanx_gfx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gfx/drivers/dispmanx_gfx.c b/gfx/drivers/dispmanx_gfx.c index e899d64864..873eced47c 100644 --- a/gfx/drivers/dispmanx_gfx.c +++ b/gfx/drivers/dispmanx_gfx.c @@ -319,6 +319,13 @@ static void dispmanx_surface_update(void *data, const void *frame, settings_t *settings = config_get_ptr(); + /* Dispmanx doesn't support more than one pending pageflip. + * It causes lockups. */ + slock_lock(_dispvars->pending_mutex); + if (_dispvars->pageflip_pending > 0) + scond_wait(_dispvars->vsync_condition, _dispvars->pending_mutex); + slock_unlock(_dispvars->pending_mutex); + page = dispmanx_get_free_page(_dispvars, surface); /* Frame blitting */