From: Jean-Philippe Andre Date: Tue, 18 Oct 2016 08:36:43 +0000 (+0900) Subject: wayland_shm: Add swap mode fallback when buffer age changes X-Git-Tag: upstream/1.20.0~4043 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62ca4486ea30fd63a5589ea7af373a5cb9982031;p=platform%2Fupstream%2Fefl.git wayland_shm: Add swap mode fallback when buffer age changes This copies the behaviour in opengl_x11 engine, where the buffer age needs to be continuously the same to be taken into account. If the age varies, then we fallback to a full redraw. Apparently this fixes issues on actual devices. I tested this patch in weston (I didn't have issues before and buffer age is 1). --- diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.h b/src/modules/evas/engines/wayland_shm/evas_engine.h index 7436c6b..bae4e37 100644 --- a/src/modules/evas/engines/wayland_shm/evas_engine.h +++ b/src/modules/evas/engines/wayland_shm/evas_engine.h @@ -107,6 +107,7 @@ struct _Outbuf int rotation; int onebuf; int num_buff; + int prev_age; Outbuf_Depth depth; Evas_Engine_Info_Wayland_Shm *info; diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c b/src/modules/evas/engines/wayland_shm/evas_outbuf.c index 6dafa85..b372864 100644 --- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c @@ -314,17 +314,22 @@ _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects EINA_UNUSED, Evas_Render_Mode Render_Engine_Swap_Mode _evas_outbuf_swap_mode_get(Outbuf *ob) { + Render_Engine_Swap_Mode mode; int age; LOGFN(__FILE__, __LINE__, __FUNCTION__); age = ob->surface->funcs.assign(ob->surface); - if (age == 1) return MODE_COPY; - else if (age == 2) return MODE_DOUBLE; - else if (age == 3) return MODE_TRIPLE; - else if (age == 4) return MODE_QUADRUPLE; + if (age == 1) mode = MODE_COPY; + else if (age == 2) mode = MODE_DOUBLE; + else if (age == 3) mode = MODE_TRIPLE; + else if (age == 4) mode = MODE_QUADRUPLE; + else mode = MODE_FULL; - return MODE_FULL; + if (ob->prev_age != age) mode = MODE_FULL; + ob->prev_age = age; + + return mode; } int