summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-06-05 09:59:57 -0400
committerChris Michael <cp.michael@samsung.com>2015-06-05 10:00:45 -0400
commit939d221ff119f82fc30674d8c293b6b8a18a4db1 (patch)
treef546e33d7c3e8c3599cea8584b7c3d1844522a35
parenta83bb5e45d9b58788f7a98c2d3f74513495aff68 (diff)
evas-gl-drm: Fix issue with swap mode returning wrong value
Summary: This fixes a crashing issue in evas image cache due to the engine returning an improper swap mode. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/modules/evas/engines/gl_drm/evas_outbuf.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c
index 09f2981b7d..6a9d7b8ded 100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -450,6 +450,9 @@ evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth)
450Render_Engine_Swap_Mode 450Render_Engine_Swap_Mode
451evas_outbuf_buffer_state_get(Outbuf *ob) 451evas_outbuf_buffer_state_get(Outbuf *ob)
452{ 452{
453 /* check for valid output buffer */
454 if (!ob) return MODE_FULL;
455
453 if (ob->swap_mode == MODE_AUTO && _extn_have_buffer_age) 456 if (ob->swap_mode == MODE_AUTO && _extn_have_buffer_age)
454 { 457 {
455 Render_Engine_Swap_Mode swap_mode; 458 Render_Engine_Swap_Mode swap_mode;
@@ -469,6 +472,29 @@ evas_outbuf_buffer_state_get(Outbuf *ob)
469 472
470 return swap_mode; 473 return swap_mode;
471 } 474 }
475 else
476 {
477 int delta;
478
479 delta = (ob->priv.last - ob->priv.curr +
480 (ob->priv.last > ob->priv.last ?
481 0 : ob->priv.num)) % ob->priv.num;
482
483 /* This is the number of frame since last frame */
484 switch (delta)
485 {
486 case 0:
487 return MODE_COPY;
488 case 1:
489 return MODE_DOUBLE;
490 case 2:
491 return MODE_TRIPLE;
492 case 3:
493 return MODE_QUADRUPLE;
494 default:
495 return MODE_FULL;
496 }
497 }
472 498
473 return ob->swap_mode; 499 return ob->swap_mode;
474} 500}