evas drm: Implement support for damage_region_set

Summary:
This patch implements engine support for outbuf_damage_region_set that
we can use to mark a framebuffer as being dirty, and to set the dirty
regions on that framebuffer.

ref T7690
Depends on D8403

Reviewers: raster, cedric, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7690

Differential Revision: https://phab.enlightenment.org/D8404
This commit is contained in:
Christopher Michael 2019-03-22 12:41:47 -04:00
parent 745de87c78
commit 3dfec81be1
3 changed files with 29 additions and 1 deletions

View File

@ -38,7 +38,7 @@ eng_output_setup(void *engine, void *einfo, unsigned int w, unsigned int h)
_outbuf_rotation_get,
_outbuf_reconfigure,
NULL,
NULL,
_outbuf_damage_region_set,
_outbuf_update_region_new,
_outbuf_update_region_push,
NULL,

View File

@ -82,5 +82,6 @@ Render_Output_Swap_Mode _outbuf_state_get(Outbuf *ob);
void *_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
void _outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
void _outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode);
void _outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage);
#endif

View File

@ -545,3 +545,30 @@ _outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_Rect
_outbuf_buffer_swap(ob);
}
void
_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage)
{
Tilebuf_Rect *tr;
Eina_Rectangle *rects;
Ecore_Drm2_Fb *fb;
int count, i = 0;
if (!ob->priv.draw) return;
fb = ob->priv.draw->fb;
count = eina_inlist_count(EINA_INLIST_GET(damage));
rects = alloca(count * sizeof(Eina_Rectangle));
EINA_INLIST_FOREACH(damage, tr)
{
rects[i].x = tr->x;
rects[i].y = tr->y;
rects[i].w = tr->w;
rects[i].h = tr->h;
i++;
}
ecore_drm2_fb_dirty(fb, rects, count);
}