summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-02-13 13:43:21 -0500
committerChris Michael <cp.michael@samsung.com>2017-02-13 13:43:21 -0500
commit6aad6d27f228dacc1a9c27d13f79ac3bc5fde3c9 (patch)
treef41a95f487598eeb0c6c5a29d6013119e7166c32 /src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
parent60c7891598d1e2343ff33f3b41e3b426cf0dd034 (diff)
ecore-evas-drm: Fix setting rotation during async render
If we are in async render and a call to rotation_set has been made, then we should delay setting that rotation until rendering is completed. This patch fixes that issue by setting ee->delayed.rotation and handling it during _drm_render_updates @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c39
1 files changed, 31 insertions, 8 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 911b4692d9..75613bca6e 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -169,6 +169,20 @@ _drm_free(Ecore_Evas *ee)
169 free(edata); 169 free(edata);
170} 170}
171 171
172static void
173_drm_rotation_do(Ecore_Evas *ee, int rotation, int resize EINA_UNUSED)
174{
175 Evas_Engine_Info_Drm *einfo;
176
177 if (ee->rotation == rotation) return;
178 ee->rotation = rotation;
179 einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas);
180 if (!einfo) return;
181 einfo->info.rotation = rotation;
182 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
183 ERR("evas_engine_info_set() for engine '%s' failed", ee->driver);
184}
185
172static int 186static int
173_drm_render_updates_process(Ecore_Evas *ee, Eina_List *updates) 187_drm_render_updates_process(Ecore_Evas *ee, Eina_List *updates)
174{ 188{
@@ -200,6 +214,13 @@ _drm_render_updates(void *data, Evas *evas EINA_UNUSED, void *event)
200 if (!ee) return; 214 if (!ee) return;
201 215
202 ee->in_async_render = EINA_FALSE; 216 ee->in_async_render = EINA_FALSE;
217
218 if (ee->delayed.rotation_changed)
219 {
220 _drm_rotation_do(ee, ee->delayed.rotation, ee->delayed.rotation_resize);
221 ee->delayed.rotation_changed = EINA_FALSE;
222 }
223
203 _drm_render_updates_process(ee, ev->updated_area); 224 _drm_render_updates_process(ee, ev->updated_area);
204} 225}
205 226
@@ -362,16 +383,18 @@ _drm_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
362} 383}
363 384
364static void 385static void
365_drm_rotation_set(Ecore_Evas *ee, int rotation, int resize EINA_UNUSED) 386_drm_rotation_set(Ecore_Evas *ee, int rotation, int resize)
366{ 387{
367 Evas_Engine_Info_Drm *einfo;
368
369 if (ee->rotation == rotation) return; 388 if (ee->rotation == rotation) return;
370 einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas); 389
371 if (!einfo) return; 390 if (ee->in_async_render)
372 einfo->info.rotation = rotation; 391 {
373 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 392 ee->delayed.rotation = rotation;
374 ERR("evas_engine_info_set() for engine '%s' failed", ee->driver); 393 ee->delayed.rotation_resize = resize;
394 ee->delayed.rotation_changed = EINA_TRUE;
395 }
396 else
397 _drm_rotation_do(ee, rotation, resize);
375} 398}
376 399
377static void 400static void