summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-07-10 16:13:52 -0400
committerChris Michael <cp.michael@samsung.com>2018-07-10 16:13:52 -0400
commit5d30f2b0b380be6be4d742009eb31685a98518e4 (patch)
tree93e8a8258c57b0e9f4f17a9cb49cb34d1dbe304b /src/modules/evas/engines
parentf783163ca5a47a13797fff96eb4dc3beefd49c4f (diff)
evas_drm: replace outbuf fb array with a list
Summary: This is just a step towards making it a variable length. ref T7099 Depends on D6562 Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #committers, zmike Tags: #efl Maniphest Tasks: T7099 Differential Revision: https://phab.enlightenment.org/D6563
Diffstat (limited to 'src/modules/evas/engines')
-rw-r--r--src/modules/evas/engines/drm/evas_engine.h3
-rw-r--r--src/modules/evas/engines/drm/evas_outbuf.c46
2 files changed, 26 insertions, 23 deletions
diff --git a/src/modules/evas/engines/drm/evas_engine.h b/src/modules/evas/engines/drm/evas_engine.h
index d200f42463..ff5c10dbf5 100644
--- a/src/modules/evas/engines/drm/evas_engine.h
+++ b/src/modules/evas/engines/drm/evas_engine.h
@@ -63,7 +63,8 @@ struct _Outbuf
63 struct 63 struct
64 { 64 {
65 int num; 65 int num;
66 Outbuf_Fb *ofb[MAX_BUFFERS], *draw; 66 Eina_List *fb_list;
67 Outbuf_Fb *draw;
67 Ecore_Drm2_Output *output; 68 Ecore_Drm2_Output *output;
68 Ecore_Drm2_Plane *plane; 69 Ecore_Drm2_Plane *plane;
69 Eina_List *pending; 70 Eina_List *pending;
diff --git a/src/modules/evas/engines/drm/evas_outbuf.c b/src/modules/evas/engines/drm/evas_outbuf.c
index d205723505..2631d8ae38 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -118,7 +118,7 @@ _outbuf_setup(Evas_Engine_Info_Drm *info, int w, int h)
118 WRN("Failed to create framebuffer %d", i); 118 WRN("Failed to create framebuffer %d", i);
119 continue; 119 continue;
120 } 120 }
121 ob->priv.ofb[i] = ofb; 121 ob->priv.fb_list = eina_list_append(ob->priv.fb_list, ofb);
122 } 122 }
123 123
124 return ob; 124 return ob;
@@ -127,7 +127,7 @@ _outbuf_setup(Evas_Engine_Info_Drm *info, int w, int h)
127void 127void
128_outbuf_free(Outbuf *ob) 128_outbuf_free(Outbuf *ob)
129{ 129{
130 int i = 0; 130 Outbuf_Fb *ofb;
131 131
132 while (ob->priv.pending) 132 while (ob->priv.pending)
133 { 133 {
@@ -154,8 +154,8 @@ _outbuf_free(Outbuf *ob)
154 154
155 _outbuf_flush(ob, NULL, NULL, EVAS_RENDER_MODE_UNDEF); 155 _outbuf_flush(ob, NULL, NULL, EVAS_RENDER_MODE_UNDEF);
156 156
157 for (i = 0; i < ob->priv.num; i++) 157 EINA_LIST_FREE(ob->priv.fb_list, ofb)
158 _outbuf_fb_destroy(ob->priv.ofb[i]); 158 _outbuf_fb_destroy(ofb);
159 159
160 free(ob); 160 free(ob);
161} 161}
@@ -222,8 +222,8 @@ _outbuf_reconfigure(Outbuf *ob, int w, int h, int rotation, Outbuf_Depth depth)
222 ob->format = format; 222 ob->format = format;
223 ob->rotation = rotation; 223 ob->rotation = rotation;
224 224
225 for (i = 0; i < ob->priv.num; i++) 225 EINA_LIST_FREE(ob->priv.fb_list, ofb)
226 _outbuf_fb_destroy(ob->priv.ofb[i]); 226 _outbuf_fb_destroy(ofb);
227 227
228 if ((ob->rotation == 0) || (ob->rotation == 180)) 228 if ((ob->rotation == 0) || (ob->rotation == 180))
229 { 229 {
@@ -245,7 +245,7 @@ _outbuf_reconfigure(Outbuf *ob, int w, int h, int rotation, Outbuf_Depth depth)
245 WRN("Failed to create framebuffer %d", i); 245 WRN("Failed to create framebuffer %d", i);
246 continue; 246 continue;
247 } 247 }
248 ob->priv.ofb[i] = ofb; 248 ob->priv.fb_list = eina_list_append(ob->priv.fb_list, ofb);
249 } 249 }
250 250
251 /* TODO: idle flush */ 251 /* TODO: idle flush */
@@ -254,29 +254,31 @@ _outbuf_reconfigure(Outbuf *ob, int w, int h, int rotation, Outbuf_Depth depth)
254static Outbuf_Fb * 254static Outbuf_Fb *
255_outbuf_fb_wait(Outbuf *ob) 255_outbuf_fb_wait(Outbuf *ob)
256{ 256{
257 int i = 0, best = -1, best_age = -1; 257 Eina_List *l;
258 Outbuf_Fb *ofb, *best = NULL;
259 int best_age = -1;
258 260
259 /* We pick the oldest available buffer to avoid using the same two 261 /* We pick the oldest available buffer to avoid using the same two
260 * repeatedly and then having the third be stale when we need it 262 * repeatedly and then having the third be stale when we need it
261 */ 263 */
262 for (i = 0; i < ob->priv.num; i++) 264 EINA_LIST_FOREACH(ob->priv.fb_list, l, ofb)
263 { 265 {
264 if (ecore_drm2_fb_busy_get(ob->priv.ofb[i]->fb)) continue; 266 if (ecore_drm2_fb_busy_get(ofb->fb)) continue;
265 if (ob->priv.ofb[i]->valid && (ob->priv.ofb[i]->age > best_age)) 267 if (ofb->valid && (ofb->age > best_age))
266 { 268 {
267 best = i; 269 best = ofb;
268 best_age = ob->priv.ofb[i]->age; 270 best_age = best->age;
269 } 271 }
270 } 272 }
271 273
272 if (best >= 0) return ob->priv.ofb[best]; 274 return best;
273 return NULL;
274} 275}
275 276
276static Eina_Bool 277static Eina_Bool
277_outbuf_fb_assign(Outbuf *ob) 278_outbuf_fb_assign(Outbuf *ob)
278{ 279{
279 int i; 280 Outbuf_Fb *ofb;
281 Eina_List *l;
280 282
281 ob->priv.draw = _outbuf_fb_wait(ob); 283 ob->priv.draw = _outbuf_fb_wait(ob);
282 while (!ob->priv.draw) 284 while (!ob->priv.draw)
@@ -285,15 +287,15 @@ _outbuf_fb_assign(Outbuf *ob)
285 ob->priv.draw = _outbuf_fb_wait(ob); 287 ob->priv.draw = _outbuf_fb_wait(ob);
286 } 288 }
287 289
288 for (i = 0; i < ob->priv.num; i++) 290 EINA_LIST_FOREACH(ob->priv.fb_list, l, ofb)
289 { 291 {
290 if ((ob->priv.ofb[i]->valid) && (ob->priv.ofb[i]->drawn)) 292 if ((ofb->valid) && (ofb->drawn))
291 { 293 {
292 ob->priv.ofb[i]->age++; 294 ofb->age++;
293 if (ob->priv.ofb[i]->age > 4) 295 if (ofb->age > 4)
294 { 296 {
295 ob->priv.ofb[i]->age = 0; 297 ofb->age = 0;
296 ob->priv.ofb[i]->drawn = EINA_FALSE; 298 ofb->drawn = EINA_FALSE;
297 } 299 }
298 } 300 }
299 } 301 }