summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-03-17 15:32:26 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-03-17 15:32:26 -0500
commit7b687c1a255f19e0d682cf57965eaaf8706facc5 (patch)
tree5279e1393cfce9b4986438ebb77847f32de0ea09
parent39da430878ed0d8b4521694087f7f4ed6e1a2e4a (diff)
gl_drm: Fix KHR partial update support
I fixed this in other engines but missed this one. The result is some terrible flickering on gl_drm on recent mali drivers.
-rw-r--r--src/modules/evas/engines/gl_drm/evas_engine.c2
-rw-r--r--src/modules/evas/engines/gl_drm/evas_engine.h1
-rw-r--r--src/modules/evas/engines/gl_drm/evas_outbuf.c29
3 files changed, 18 insertions, 14 deletions
diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c
index 9af7e8844e..b87a10c478 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -855,7 +855,7 @@ eng_setup(void *in, unsigned int w, unsigned int h)
855 evas_outbuf_rot_get, 855 evas_outbuf_rot_get,
856 evas_outbuf_reconfigure, 856 evas_outbuf_reconfigure,
857 evas_outbuf_update_region_first_rect, 857 evas_outbuf_update_region_first_rect,
858 NULL, 858 evas_outbuf_damage_region_set,
859 evas_outbuf_update_region_new, 859 evas_outbuf_update_region_new,
860 evas_outbuf_update_region_push, 860 evas_outbuf_update_region_push,
861 evas_outbuf_update_region_free, 861 evas_outbuf_update_region_free,
diff --git a/src/modules/evas/engines/gl_drm/evas_engine.h b/src/modules/evas/engines/gl_drm/evas_engine.h
index 295fb65725..95a48ed72a 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.h
+++ b/src/modules/evas/engines/gl_drm/evas_engine.h
@@ -129,6 +129,7 @@ void evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y
129void evas_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update); 129void evas_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update);
130void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); 130void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode);
131void evas_outbuf_release_fb(void *, void *); 131void evas_outbuf_release_fb(void *, void *);
132void evas_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage);
132 133
133Evas_Engine_GL_Context* evas_outbuf_gl_context_get(Outbuf *ob); 134Evas_Engine_GL_Context* evas_outbuf_gl_context_get(Outbuf *ob);
134void *evas_outbuf_egl_display_get(Outbuf *ob); 135void *evas_outbuf_egl_display_get(Outbuf *ob);
diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c
index f246366d7f..0419575dc8 100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -660,18 +660,24 @@ _glcoords_convert(int *result, Outbuf *ob, int x, int y, int w, int h)
660 } 660 }
661} 661}
662 662
663static void 663void
664_damage_rect_set(Outbuf *ob, int x, int y, int w, int h) 664evas_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage)
665{ 665{
666 int rects[4]; 666 if (glsym_eglSetDamageRegionKHR)
667 667 {
668 if ((x == 0) && (y == 0) && 668 Tilebuf_Rect *tr;
669 (((w == ob->gl_context->w) && (h == ob->gl_context->h)) || 669 int *rect, *rects, count;
670 ((h == ob->gl_context->w) && (w == ob->gl_context->h))))
671 return;
672 670
673 _glcoords_convert(rects, ob, x, y, w, h); 671 count = eina_inlist_count(EINA_INLIST_GET(damage));
674 glsym_eglSetDamageRegionKHR(ob->egl.disp, ob->egl.surface, rects, 1); 672 rects = alloca(sizeof(int) * 4 * count);
673 rect = rects;
674 EINA_INLIST_FOREACH(damage, tr)
675 {
676 _glcoords_convert(rect, ob, tr->x, tr->y, tr->w, tr->h);
677 rect += 4;
678 }
679 glsym_eglSetDamageRegionKHR(ob->egl.disp, ob->egl.surface, rects, count);
680 }
675} 681}
676 682
677void * 683void *
@@ -686,9 +692,6 @@ evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx EI
686 ob->gl_context->master_clip.y = y; 692 ob->gl_context->master_clip.y = y;
687 ob->gl_context->master_clip.w = w; 693 ob->gl_context->master_clip.w = w;
688 ob->gl_context->master_clip.h = h; 694 ob->gl_context->master_clip.h = h;
689
690 if (glsym_eglSetDamageRegionKHR)
691 _damage_rect_set(ob, x, y, w, h);
692 } 695 }
693 696
694 return ob->gl_context->def_surface; 697 return ob->gl_context->def_surface;