evas drm: Implement support for damage_region_set
authorChristopher Michael <cp.michael@samsung.com>
Fri, 22 Mar 2019 16:41:47 +0000 (12:41 -0400)
committerYeongjong Lee <yj34.lee@samsung.com>
Tue, 2 Apr 2019 03:45:17 +0000 (12:45 +0900)
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

src/modules/evas/engines/drm/evas_engine.c
src/modules/evas/engines/drm/evas_engine.h
src/modules/evas/engines/drm/evas_outbuf.c

index d72e4ef..8e9eb67 100644 (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,
index ecaedc5..85e16ca 100644 (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
index 1da70a4..e30175f 100644 (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);
+}