summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-11-18 09:41:52 -0600
committerDerek Foreman <derekf@osg.samsung.com>2016-11-18 09:41:52 -0600
commitaa3479570d0ee48865a1beeeff95fd280178d2d7 (patch)
tree58e50c13ee45729ea9d0a1ec865094bc52ec244c
parentf77a602a096028ec4316e44c92a6ce52549e62a8 (diff)
ecore_drm2: Add a panic mode to drm2_fb_release
Previously we'd call this only when we absolutely needed to, so it made sense to always attempt to free a buffer, including ones on scanout or pending flip. However, it's useful to have a way to release the "next" only, so we can do that before starting a render to free up the buffer that's never going to be scanned out.
-rw-r--r--src/lib/ecore_drm2/Ecore_Drm2.h13
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c3
-rw-r--r--src/modules/evas/engines/drm/evas_outbuf.c2
-rw-r--r--src/modules/evas/engines/gl_drm/evas_outbuf.c2
4 files changed, 12 insertions, 8 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 7712643114..50408be989 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -829,16 +829,19 @@ EAPI void ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy);
829/** 829/**
830 * Try to force a framebuffer release for an output 830 * Try to force a framebuffer release for an output
831 * 831 *
832 * This tries to release the next, pending, or current buffer from 832 * This tries to release the next or optionally pending, or current
833 * the output. If successful there will be a release callback to 833 * buffer from the output. If successful there will be a release callback
834 * the registered handler, and the fb will no longer be flagged busy. 834 * to the registered handler, and the fb will no longer be flagged busy.
835 * 835 *
836 * @param output The output to force release 836 * Releasing buffers committed to scanout will potentially cause flicker,
837 * so this is only done when the panic flag is set.
837 * 838 *
839 * @param output The output to force release
840 * @param panic Try to release even buffers committed to scanout
838 * @ingroup Ecore_Drm2_Fb_Group 841 * @ingroup Ecore_Drm2_Fb_Group
839 * @since 1.19 842 * @since 1.19
840 */ 843 */
841EAPI void ecore_drm2_fb_release(Ecore_Drm2_Output *o); 844EAPI void ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic);
842 845
843/** 846/**
844 * Set the user data for the output's page flip handler 847 * Set the user data for the output's page flip handler
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 3f7b9ef8e4..3737bdfcc0 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -456,7 +456,7 @@ ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy)
456} 456}
457 457
458EAPI void 458EAPI void
459ecore_drm2_fb_release(Ecore_Drm2_Output *o) 459ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic)
460{ 460{
461 EINA_SAFETY_ON_NULL_RETURN(o); 461 EINA_SAFETY_ON_NULL_RETURN(o);
462 462
@@ -466,6 +466,7 @@ ecore_drm2_fb_release(Ecore_Drm2_Output *o)
466 o->next = NULL; 466 o->next = NULL;
467 return; 467 return;
468 } 468 }
469 if (!panic) return;
469 470
470 WRN("Buffer release request when no next buffer"); 471 WRN("Buffer release request when no next buffer");
471 /* If we have to release these we're going to see tearing. 472 /* If we have to release these we're going to see tearing.
diff --git a/src/modules/evas/engines/drm/evas_outbuf.c b/src/modules/evas/engines/drm/evas_outbuf.c
index 2a9afa21a9..9d2454b914 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -249,7 +249,7 @@ _outbuf_fb_assign(Outbuf *ob)
249 ob->priv.draw = _outbuf_fb_wait(ob); 249 ob->priv.draw = _outbuf_fb_wait(ob);
250 while (!ob->priv.draw) 250 while (!ob->priv.draw)
251 { 251 {
252 ecore_drm2_fb_release(ob->priv.output); 252 ecore_drm2_fb_release(ob->priv.output, EINA_TRUE);
253 ob->priv.draw = _outbuf_fb_wait(ob); 253 ob->priv.draw = _outbuf_fb_wait(ob);
254 } 254 }
255 255
diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c
index fb813bf424..e225b42586 100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -96,7 +96,7 @@ _evas_outbuf_buffer_swap(Outbuf *ob)
96 bo = gbm_surface_lock_front_buffer(ob->surface); 96 bo = gbm_surface_lock_front_buffer(ob->surface);
97 if (!bo) 97 if (!bo)
98 { 98 {
99 ecore_drm2_fb_release(ob->priv.output); 99 ecore_drm2_fb_release(ob->priv.output, EINA_TRUE);
100 bo = gbm_surface_lock_front_buffer(ob->surface); 100 bo = gbm_surface_lock_front_buffer(ob->surface);
101 } 101 }
102 if (bo) fb = _evas_outbuf_fb_get(ob, bo); 102 if (bo) fb = _evas_outbuf_fb_get(ob, bo);