summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-03-19 10:12:36 -0400
committerChristopher Michael <cp.michael@samsung.com>2019-03-21 14:00:15 -0400
commit20e9616e6692745c783a95a15b1df117aaa40fd6 (patch)
tree484bbc1c6a30aad73cb0f202f6352d6aa653c553
parentf74faaa00d60e3190b73bf83edee872ee8d2dbc5 (diff)
evas drm: Implement support for damage_region_set
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 Differential Revision: https://phab.enlightenment.org/D8404
-rw-r--r--src/modules/evas/engines/drm/evas_engine.c2
-rw-r--r--src/modules/evas/engines/drm/evas_engine.h1
-rw-r--r--src/modules/evas/engines/drm/evas_outbuf.c27
3 files changed, 29 insertions, 1 deletions
diff --git a/src/modules/evas/engines/drm/evas_engine.c b/src/modules/evas/engines/drm/evas_engine.c
index d72e4ef1cc..8e9eb67773 100644
--- a/src/modules/evas/engines/drm/evas_engine.c
+++ b/src/modules/evas/engines/drm/evas_engine.c
@@ -38,7 +38,7 @@ eng_output_setup(void *engine, void *einfo, unsigned int w, unsigned int h)
38 _outbuf_rotation_get, 38 _outbuf_rotation_get,
39 _outbuf_reconfigure, 39 _outbuf_reconfigure,
40 NULL, 40 NULL,
41 NULL, 41 _outbuf_damage_region_set,
42 _outbuf_update_region_new, 42 _outbuf_update_region_new,
43 _outbuf_update_region_push, 43 _outbuf_update_region_push,
44 NULL, 44 NULL,
diff --git a/src/modules/evas/engines/drm/evas_engine.h b/src/modules/evas/engines/drm/evas_engine.h
index ecaedc5c1b..85e16caf1a 100644
--- a/src/modules/evas/engines/drm/evas_engine.h
+++ b/src/modules/evas/engines/drm/evas_engine.h
@@ -82,5 +82,6 @@ Render_Output_Swap_Mode _outbuf_state_get(Outbuf *ob);
82void *_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); 82void *_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
83void _outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); 83void _outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
84void _outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode); 84void _outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage, Tilebuf_Rect *buffer_damage, Evas_Render_Mode render_mode);
85void _outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage);
85 86
86#endif 87#endif
diff --git a/src/modules/evas/engines/drm/evas_outbuf.c b/src/modules/evas/engines/drm/evas_outbuf.c
index 1da70a495e..e30175f10e 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -545,3 +545,30 @@ _outbuf_flush(Outbuf *ob, Tilebuf_Rect *surface_damage EINA_UNUSED, Tilebuf_Rect
545 545
546 _outbuf_buffer_swap(ob); 546 _outbuf_buffer_swap(ob);
547} 547}
548
549void
550_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage)
551{
552 Tilebuf_Rect *tr;
553 Eina_Rectangle *rects;
554 Ecore_Drm2_Fb *fb;
555 int count, i = 0;
556
557 if (!ob->priv.draw) return;
558
559 fb = ob->priv.draw->fb;
560
561 count = eina_inlist_count(EINA_INLIST_GET(damage));
562 rects = alloca(count * sizeof(Eina_Rectangle));
563
564 EINA_INLIST_FOREACH(damage, tr)
565 {
566 rects[i].x = tr->x;
567 rects[i].y = tr->y;
568 rects[i].w = tr->w;
569 rects[i].h = tr->h;
570 i++;
571 }
572
573 ecore_drm2_fb_dirty(fb, rects, count);
574}