diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2016-09-07 22:13:34 -0500 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2016-09-07 22:41:04 -0500 |
commit | 1bb27802180f5ee0b6127d1c5f2827eebab71e5d (patch) | |
tree | cceb8d26993119593d2d8b5eaae2d0883d2d3f59 | |
parent | ad1fd46b7d2e434de27d3de06e11c39dee1f07cc (diff) | |
download | efl-1bb27802180f5ee0b6127d1c5f2827eebab71e5d.tar.gz |
drm2: make flip to NULL buffer mean something
When triple buffering we'll have a buffer in ecore_drm2's "next" position.
Until now we've had to query it from the engine then try to re post it.
Also, when generating ticks we need to flip to the current buffer when no
changes have been made to get another callback.
Now a NULL fb to fb_flip will either flip to next, if available, or current
if there's nothing new to flip to.
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_fb.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c index 36de500870..1c1c94795f 100644 --- a/src/lib/ecore_drm2/ecore_drm2_fb.c +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c @@ -228,18 +228,25 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output) { int ret = 0; - EINA_SAFETY_ON_NULL_RETURN_VAL(fb, -1); EINA_SAFETY_ON_NULL_RETURN_VAL(output, -1); EINA_SAFETY_ON_NULL_RETURN_VAL(output->current_mode, -1); if (!output->enabled) return -1; + if (!fb) fb = output->next; + + /* So we can generate a tick by flipping to the current fb */ + if (!fb) fb = output->current; + if (output->next) { output->next->busy = EINA_FALSE; output->next = NULL; } + /* If we don't have an fb to set by now, BAIL! */ + if (!fb) return -1; + if ((!output->current) || (output->current->stride != fb->stride)) { |