From b3072ce9783f3d8baf1da18d1472bddeab6093ed Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Fri, 19 Feb 2016 08:25:59 +0900 Subject: [PATCH] evas-gl-drm: block the pageflip for hwc at enlightenment. When the enlightenment set up the hwc(hardware compositing), gl_drm engine does not display the ecore_evas canvas on a display. Enlightenment will do it. Change-Id: I562d1349d22e02b25d89c3093f89a15e86e157d3 --- .../evas/engines/gl_drm/Evas_Engine_GL_Drm.h | 6 +++ src/modules/evas/engines/gl_drm/evas_engine.c | 3 ++ src/modules/evas/engines/gl_drm/evas_outbuf.c | 51 ++++++++++++++-------- 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h b/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h index 71ab60c..4238ba3 100644 --- a/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h +++ b/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h @@ -26,6 +26,12 @@ struct _Evas_Engine_Info_GL_Drm { struct gbm_device *gbm; + /* HWC: for hwc */ + struct gbm_surface *surface; + Eina_Bool wait_for_showup : 1; + Eina_Bool outbuf_flushed : 1; + Eina_Bool hwc_enable : 1; + unsigned int rotation, depth; unsigned int crtc_id, conn_id, buffer_id; unsigned int format, flags; diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c index 7981b58..30f9b5e 100644 --- a/src/modules/evas/engines/gl_drm/evas_engine.c +++ b/src/modules/evas/engines/gl_drm/evas_engine.c @@ -395,6 +395,9 @@ evgl_eng_native_window_create(void *data) return NULL; } + /* HWC: set the gbm_surface to the engine info */ + if (info->info.hwc_enable) info->info.surface = surface; + return (void *)surface; } diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c index 839bb9d..be2299d 100644 --- a/src/modules/evas/engines/gl_drm/evas_outbuf.c +++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c @@ -425,6 +425,9 @@ evas_outbuf_new(Evas_Engine_Info_GL_Drm *info, int w, int h, Render_Engine_Swap_ return NULL; } + /* HWC: set the gbm_surface to the engine_info */ + if (info->info.hwc_enable) info->info.surface = ob->surface; + return ob; } @@ -806,29 +809,39 @@ evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode) if (ob->info->callback.post_swap) ob->info->callback.post_swap(ob->info->callback.data, ob->evas); - if (rects) + /* HWC: do not display the ecore_evas at gl_drm engine + hwc at enlightenment will update the display device */ + if (ob->info->info.hwc_enable) { - Tilebuf_Rect *r; - Eina_Rectangle *res; - int num, i = 0; - - num = eina_inlist_count(EINA_INLIST_GET(rects)); - res = alloca(sizeof(Eina_Rectangle) * num); - EINA_INLIST_FOREACH(EINA_INLIST_GET(rects), r) - { - res[i].x = r->x; - res[i].y = r->y; - res[i].w = r->w; - res[i].h = r->h; - i++; - } - - _evas_outbuf_buffer_swap(ob, res, num); + /* The pair of evas_outbuf_flush and post_render has to be matched */ + ob->info->info.outbuf_flushed = EINA_TRUE; + INF("HWC: evas outbuf flushed"); } else - //Flush GL Surface data to Framebuffer - _evas_outbuf_buffer_swap(ob, NULL, 0); + { + if (rects) + { + Tilebuf_Rect *r; + Eina_Rectangle *res; + int num, i = 0; + num = eina_inlist_count(EINA_INLIST_GET(rects)); + res = alloca(sizeof(Eina_Rectangle) * num); + EINA_INLIST_FOREACH(EINA_INLIST_GET(rects), r) + { + res[i].x = r->x; + res[i].y = r->y; + res[i].w = r->w; + res[i].h = r->h; + i++; + } + + _evas_outbuf_buffer_swap(ob, res, num); + } + else + //Flush GL Surface data to Framebuffer + _evas_outbuf_buffer_swap(ob, NULL, 0); + } ob->priv.frame_cnt++; end: -- 2.7.4