summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-08-11 14:51:30 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-08-11 17:11:12 -0500
commite893d7de7deb54a0ef730318e3bee4cb9b754da6 (patch)
tree1a37e3ed9a24c99fda257a716521fba63f467ff3 /src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
parenteec565cc0fe9eca6aea73fc8963f0ebbb2bbc154 (diff)
ecore_evas_drm: Let ecore_drm2 track pending page flips
Since the engines can call the flip functions, we need to protect the ticker from missing those flips. Thus, we let ecore_drm2, which obviously sees all flips, track them.
Diffstat (limited to 'src/modules/ecore_evas/engines/drm/ecore_evas_drm.c')
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index f2da72ff6f..80d78077d4 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -59,7 +59,6 @@ typedef struct _Ecore_Evas_Engine_Drm_Data
59 Ecore_Drm2_Device *dev; 59 Ecore_Drm2_Device *dev;
60 Ecore_Drm2_Output *output; 60 Ecore_Drm2_Output *output;
61 Evas_Device *seat; 61 Evas_Device *seat;
62 Eina_Bool pending : 1;
63 Eina_Bool ticking : 1; 62 Eina_Bool ticking : 1;
64 Eina_Bool once : 1; 63 Eina_Bool once : 1;
65} Ecore_Evas_Engine_Drm_Data; 64} Ecore_Evas_Engine_Drm_Data;
@@ -608,8 +607,6 @@ _cb_pageflip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int se
608 607
609 ret = ecore_drm2_fb_flip_complete(edata->output); 608 ret = ecore_drm2_fb_flip_complete(edata->output);
610 609
611 edata->pending = EINA_FALSE;
612
613 if (edata->ticking) 610 if (edata->ticking)
614 { 611 {
615 double t = (double)sec + ((double)usec / 1000000); 612 double t = (double)sec + ((double)usec / 1000000);
@@ -618,10 +615,7 @@ _cb_pageflip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int se
618 ecore_evas_animator_tick(ee, NULL, t - edata->offset); 615 ecore_evas_animator_tick(ee, NULL, t - edata->offset);
619 } 616 }
620 else if (ret) 617 else if (ret)
621 { 618 ecore_drm2_fb_flip(NULL, edata->output);
622 edata->pending = EINA_TRUE;
623 ecore_drm2_fb_flip(NULL, edata->output);
624 }
625} 619}
626 620
627static void 621static void
@@ -632,11 +626,8 @@ _drm_evas_changed(Ecore_Evas *ee, Eina_Bool changed)
632 if (changed) return; 626 if (changed) return;
633 627
634 edata = ee->engine.data; 628 edata = ee->engine.data;
635 if (edata->ticking && !edata->pending) 629 if (edata->ticking && !ecore_drm2_output_pending_get(edata->output))
636 { 630 ecore_drm2_fb_flip(NULL, edata->output);
637 edata->pending = EINA_TRUE;
638 ecore_drm2_fb_flip(NULL, edata->output);
639 }
640} 631}
641 632
642static void 633static void
@@ -679,11 +670,8 @@ _drm_animator_register(Ecore_Evas *ee)
679 } 670 }
680 } 671 }
681 672
682 if (!edata->pending && !ee->in_async_render) 673 if (!ecore_drm2_output_pending_get(edata->output) && !ee->in_async_render)
683 { 674 ecore_drm2_fb_flip(NULL, edata->output);
684 edata->pending = EINA_TRUE;
685 ecore_drm2_fb_flip(NULL, edata->output);
686 }
687} 675}
688 676
689static void 677static void