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.
This commit is contained in:
Derek Foreman 2017-03-17 15:32:26 -05:00
parent 39da430878
commit 7b687c1a25
3 changed files with 18 additions and 14 deletions

View File

@ -855,7 +855,7 @@ eng_setup(void *in, unsigned int w, unsigned int h)
evas_outbuf_rot_get,
evas_outbuf_reconfigure,
evas_outbuf_update_region_first_rect,
NULL,
evas_outbuf_damage_region_set,
evas_outbuf_update_region_new,
evas_outbuf_update_region_push,
evas_outbuf_update_region_free,

View File

@ -129,6 +129,7 @@ void evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y
void evas_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update);
void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode);
void evas_outbuf_release_fb(void *, void *);
void evas_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage);
Evas_Engine_GL_Context* evas_outbuf_gl_context_get(Outbuf *ob);
void *evas_outbuf_egl_display_get(Outbuf *ob);

View File

@ -660,18 +660,24 @@ _glcoords_convert(int *result, Outbuf *ob, int x, int y, int w, int h)
}
}
static void
_damage_rect_set(Outbuf *ob, int x, int y, int w, int h)
void
evas_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage)
{
int rects[4];
if (glsym_eglSetDamageRegionKHR)
{
Tilebuf_Rect *tr;
int *rect, *rects, count;
if ((x == 0) && (y == 0) &&
(((w == ob->gl_context->w) && (h == ob->gl_context->h)) ||
((h == ob->gl_context->w) && (w == ob->gl_context->h))))
return;
_glcoords_convert(rects, ob, x, y, w, h);
glsym_eglSetDamageRegionKHR(ob->egl.disp, ob->egl.surface, rects, 1);
count = eina_inlist_count(EINA_INLIST_GET(damage));
rects = alloca(sizeof(int) * 4 * count);
rect = rects;
EINA_INLIST_FOREACH(damage, tr)
{
_glcoords_convert(rect, ob, tr->x, tr->y, tr->w, tr->h);
rect += 4;
}
glsym_eglSetDamageRegionKHR(ob->egl.disp, ob->egl.surface, rects, count);
}
}
void *
@ -686,9 +692,6 @@ evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx EI
ob->gl_context->master_clip.y = y;
ob->gl_context->master_clip.w = w;
ob->gl_context->master_clip.h = h;
if (glsym_eglSetDamageRegionKHR)
_damage_rect_set(ob, x, y, w, h);
}
return ob->gl_context->def_surface;