aboutsummaryrefslogtreecommitdiffstats
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
parentevas drm: Fix software output rotation (diff)
downloadefl-20e9616e6692745c783a95a15b1df117aaa40fd6.tar.gz
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 https://phab.enlightenment.org/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)
_outbuf_rotation_get,
_outbuf_reconfigure,
NULL,
- NULL,
+ _outbuf_damage_region_set,
_outbuf_update_region_new,
_outbuf_update_region_push,
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);
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
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
_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);
+}