summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-04-07 13:03:28 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2015-04-10 11:09:50 +0200
commit8d1e57e52ef3138e3e5d55bdbaf87f3002cffadd (patch)
treec8645ddb3f2af37072184db182c8cbfac69c7eb3 /src
parente7538322e90632812f13741446c604d42c2dd929 (diff)
ecore-drm: Delay destroy of output if there is a pending flip
Summary: If an output has a pending page flip, we cannot destroy it until the page flip has completed. This commit adds support to delay destroying an output until the page flip is completed. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c10
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c10
-rw-r--r--src/lib/ecore_drm/ecore_drm_private.h14
3 files changed, 23 insertions, 11 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index 69a8e1c05f..1ba4a2668d 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -24,7 +24,13 @@ _ecore_drm_device_cb_page_flip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSE
24 } 24 }
25 25
26 output->pending_flip = EINA_FALSE; 26 output->pending_flip = EINA_FALSE;
27 if (!output->pending_vblank) ecore_drm_output_repaint(output); 27 if (output->pending_destroy)
28 {
29 output->pending_destroy = EINA_FALSE;
30 ecore_drm_output_free(output);
31 }
32 else if (!output->pending_vblank)
33 ecore_drm_output_repaint(output);
28} 34}
29 35
30static void 36static void
@@ -79,7 +85,7 @@ _ecore_drm_device_cb_idle(void *data)
79 85
80 EINA_LIST_FOREACH(dev->outputs, l, output) 86 EINA_LIST_FOREACH(dev->outputs, l, output)
81 { 87 {
82 output->need_repaint = EINA_TRUE; 88 if ((!output->enabled) || (!output->need_repaint)) continue;
83 if (output->repaint_scheduled) continue; 89 if (output->repaint_scheduled) continue;
84 _ecore_drm_output_repaint_start(output); 90 _ecore_drm_output_repaint_start(output);
85 } 91 }
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index 58761412c4..7bced0c9aa 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -594,6 +594,12 @@ _ecore_drm_output_free(Ecore_Drm_Output *output)
594 /* check for valid output */ 594 /* check for valid output */
595 if (!output) return; 595 if (!output) return;
596 596
597 if (output->pending_flip)
598 {
599 output->pending_destroy = EINA_TRUE;
600 return;
601 }
602
597 /* delete the backlight struct */ 603 /* delete the backlight struct */
598 if (output->backlight) 604 if (output->backlight)
599 _ecore_drm_output_backlight_shutdown(output->backlight); 605 _ecore_drm_output_backlight_shutdown(output->backlight);
@@ -649,6 +655,7 @@ _ecore_drm_output_repaint_start(Ecore_Drm_Output *output)
649 /* DBG("Output Repaint Start"); */ 655 /* DBG("Output Repaint Start"); */
650 656
651 if (!output) return; 657 if (!output) return;
658 if (output->pending_destroy) return;
652 659
653 if (!output->current) 660 if (!output->current)
654 { 661 {
@@ -902,7 +909,8 @@ ecore_drm_output_repaint(Ecore_Drm_Output *output)
902 Ecore_Drm_Sprite *sprite; 909 Ecore_Drm_Sprite *sprite;
903 int ret = 0; 910 int ret = 0;
904 911
905 if (!output) return; 912 EINA_SAFETY_ON_NULL_RETURN(output);
913 EINA_SAFETY_ON_TRUE_RETURN(output->pending_destroy);
906 914
907 /* DBG("Output Repaint: %d %d", output->crtc_id, output->conn_id); */ 915 /* DBG("Output Repaint: %d %d", output->crtc_id, output->conn_id); */
908 916
diff --git a/src/lib/ecore_drm/ecore_drm_private.h b/src/lib/ecore_drm/ecore_drm_private.h
index beea203b90..4460064ffb 100644
--- a/src/lib/ecore_drm/ecore_drm_private.h
+++ b/src/lib/ecore_drm/ecore_drm_private.h
@@ -117,15 +117,10 @@ struct _Ecore_Drm_Output
117 117
118 int x, y, phys_width, phys_height; 118 int x, y, phys_width, phys_height;
119 119
120 Eina_Bool need_repaint : 1;
121 Eina_Bool repaint_scheduled : 1;
122
123 Eina_Bool pending_flip : 1;
124 Eina_Bool pending_vblank : 1;
125
126 int pipe; 120 int pipe;
127 const char *make, *model, *name; 121 const char *make, *model, *name;
128 unsigned int subpixel; 122 unsigned int subpixel;
123 uint16_t gamma;
129 124
130 Ecore_Drm_Output_Mode *current_mode; 125 Ecore_Drm_Output_Mode *current_mode;
131 Eina_List *modes; 126 Eina_List *modes;
@@ -142,10 +137,13 @@ struct _Ecore_Drm_Output
142 Ecore_Drm_Fb *dumb[NUM_FRAME_BUFFERS]; 137 Ecore_Drm_Fb *dumb[NUM_FRAME_BUFFERS];
143 Ecore_Drm_Backlight *backlight; 138 Ecore_Drm_Backlight *backlight;
144 139
145 uint16_t gamma;
146
147 Eina_Bool enabled : 1; 140 Eina_Bool enabled : 1;
148 Eina_Bool cloned : 1; 141 Eina_Bool cloned : 1;
142 Eina_Bool need_repaint : 1;
143 Eina_Bool repaint_scheduled : 1;
144 Eina_Bool pending_destroy : 1;
145 Eina_Bool pending_flip : 1;
146 Eina_Bool pending_vblank : 1;
149}; 147};
150 148
151struct _Ecore_Drm_Seat 149struct _Ecore_Drm_Seat