diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c index 3160e5c7a9..36de500870 100644 --- a/src/lib/ecore_drm2/ecore_drm2_fb.c +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c @@ -235,7 +235,10 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output) if (!output->enabled) return -1; if (output->next) - WRN("Fb reused too soon, tearing may be visible"); + { + output->next->busy = EINA_FALSE; + output->next = NULL; + } if ((!output->current) || (output->current->stride != fb->stride)) @@ -266,10 +269,13 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output) DBG("Pageflip Failed for Crtc %u on Connector %u: %m", output->crtc_id, output->conn_id); output->next = fb; + fb->busy = EINA_TRUE; return ret; } + if (output->current) output->current->busy = EINA_FALSE; output->current = fb; + fb->busy = EINA_TRUE; return 0; } diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c index e53ffdab81..9b456b7a53 100644 --- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c +++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c @@ -634,14 +634,11 @@ _cb_pageflip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int se { Ecore_Evas *ee; Ecore_Evas_Engine_Drm_Data *edata; - Ecore_Drm2_Fb *current, *next; + Ecore_Drm2_Fb *next; ee = data; edata = ee->engine.data; - current = ecore_drm2_output_current_fb_get(edata->output); - if (current) ecore_drm2_fb_busy_set(current, EINA_FALSE); - next = ecore_drm2_output_next_fb_get(edata->output); if (next) { diff --git a/src/modules/evas/engines/drm/evas_outbuf.c b/src/modules/evas/engines/drm/evas_outbuf.c index 891be790a8..97e4f108db 100644 --- a/src/modules/evas/engines/drm/evas_outbuf.c +++ b/src/modules/evas/engines/drm/evas_outbuf.c @@ -8,43 +8,19 @@ #define GREEN_MASK 0x00ff00 #define BLUE_MASK 0x0000ff -Outbuf_Fb * -_outbuf_fb_find(Outbuf *ob, Ecore_Drm2_Fb *key) -{ - int i; - - for (i = 0; i < ob->priv.num; i++) - if (key == ob->priv.ofb[i].fb) return &ob->priv.ofb[i]; - - return NULL; -} - static void _outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count) { /* Ecore_Drm2_Plane *plane; */ - Outbuf_Fb *ofb, *next_ofb; - Ecore_Drm2_Fb *next; + Outbuf_Fb *ofb; ofb = ob->priv.draw; if (!ofb) return; - /* If there's a next buffer set, we just dump it back into - * the available buffers and it becomes a dropped frame - */ - next = ecore_drm2_output_next_fb_get(ob->priv.output); - if (next) - { - next_ofb = _outbuf_fb_find(ob, next); - ecore_drm2_fb_busy_set(next_ofb->fb, EINA_FALSE); - ecore_drm2_output_next_fb_set(ob->priv.output, NULL); - } - ecore_drm2_fb_dirty(ofb->fb, rects, count); if (ecore_drm2_fb_flip(ofb->fb, ob->priv.output) == 0) ob->priv.display = ofb; - ecore_drm2_fb_busy_set(ofb->fb, EINA_TRUE); ofb->drawn = EINA_TRUE; ofb->age = 0;