From cfd172c64bf021c70b9c31adae25f7edb09d6eec Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 2 Sep 2016 12:18:06 -0500 Subject: [PATCH] ee_drm: use the ecore_drm2_fb busy bit Use the new busy getter/setter on the fb instead of keeping state in the outbuf --- src/modules/evas/engines/drm/evas_engine.h | 1 - src/modules/evas/engines/drm/evas_outbuf.c | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/modules/evas/engines/drm/evas_engine.h b/src/modules/evas/engines/drm/evas_engine.h index 1bfe40e83b..37336104c0 100644 --- a/src/modules/evas/engines/drm/evas_engine.h +++ b/src/modules/evas/engines/drm/evas_engine.h @@ -48,7 +48,6 @@ typedef struct _Outbuf_Fb Eina_Bool valid : 1; Eina_Bool drawn : 1; - Eina_Bool busy : 1; } Outbuf_Fb; struct _Outbuf diff --git a/src/modules/evas/engines/drm/evas_outbuf.c b/src/modules/evas/engines/drm/evas_outbuf.c index aec09ff67a..e2f0c2eafc 100644 --- a/src/modules/evas/engines/drm/evas_outbuf.c +++ b/src/modules/evas/engines/drm/evas_outbuf.c @@ -91,7 +91,7 @@ _cb_pageflip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int se ob = data; ofb = ob->priv.display; - if (ofb) ofb->busy = EINA_FALSE; + if (ofb) ecore_drm2_fb_busy_set(ofb->fb, EINA_FALSE); next = ecore_drm2_output_next_fb_get(ob->priv.output); if (next) @@ -135,7 +135,7 @@ _outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count) if (next) { next_ofb = _outbuf_fb_find(ob, next); - next_ofb->busy = EINA_FALSE; + ecore_drm2_fb_busy_set(next_ofb->fb, EINA_FALSE); ecore_drm2_output_next_fb_set(ob->priv.output, NULL); } @@ -143,7 +143,7 @@ _outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count) if (ecore_drm2_fb_flip(ofb->fb, ob->priv.output, ob) == 0) ob->priv.display = ofb; - ofb->busy = EINA_TRUE; + ecore_drm2_fb_busy_set(ofb->fb, EINA_TRUE); ofb->drawn = EINA_TRUE; ofb->age = 0; @@ -192,7 +192,6 @@ _outbuf_fb_create(Outbuf *ob, Outbuf_Fb *ofb) if (!ofb->fb) return EINA_FALSE; ofb->age = 0; - ofb->busy = EINA_FALSE; ofb->drawn = EINA_FALSE; ofb->valid = EINA_TRUE; @@ -206,7 +205,6 @@ _outbuf_fb_destroy(Outbuf_Fb *ofb) memset(ofb, 0, sizeof(*ofb)); ofb->valid = EINA_FALSE; - ofb->busy = EINA_FALSE; ofb->drawn = EINA_FALSE; ofb->age = 0; } @@ -370,7 +368,7 @@ _outbuf_fb_wait(Outbuf *ob) for (i = 0; i < ob->priv.num; i++) { if (&ob->priv.ofb[i] == ob->priv.display) continue; - if (ob->priv.ofb[i].busy) continue; + if (ecore_drm2_fb_busy_get(ob->priv.ofb[i].fb)) continue; if (ob->priv.ofb[i].valid) return &(ob->priv.ofb[i]); } @@ -394,7 +392,7 @@ _outbuf_fb_assign(Outbuf *ob) { if (ob->priv.ofb[i].valid) { - ob->priv.ofb[i].busy = 0; + ecore_drm2_fb_busy_set(ob->priv.ofb[i].fb, EINA_FALSE); ob->priv.ofb[i].age = 0; ob->priv.ofb[i].drawn = EINA_FALSE; }