From: Changyeon Lee Date: Mon, 27 Jul 2020 10:14:31 +0000 (+0900) Subject: e_hwc_windows: call sync of e_explicit_sync_surface in render pre callback X-Git-Tag: submit/tizen/20200729.055340~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e1b75333801915d2146e3620e92b18b92487df2;p=platform%2Fupstream%2Fenlightenment.git e_hwc_windows: call sync of e_explicit_sync_surface in render pre callback eglWaitSyncKHR of e_explicit_sync_surface should be called before gl call Change-Id: Ia6a2d6b71900fb8d4bb7cd055bbfd482893beca2 --- diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index e338d6184e..50eae424ce 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -940,6 +940,13 @@ _e_hwc_windows_target_window_surface_queue_trace_cb(tbm_surface_queue_h surface_ target_hwc_window->rendering_tsurfaces = eina_list_append(target_hwc_window->rendering_tsurfaces, tsurface); } + + if (e_hwc_windows_fence_enabled_get(target_hwc_window->hwc)) + { + buffer_comp_info = _e_hwc_windows_buffer_comp_info_get(target_hwc_window->dequeued_tsurface); + if (buffer_comp_info && buffer_comp_info->release_fence) + e_egl_sync_wait(buffer_comp_info->release_fence); + } } if (trace == TBM_SURFACE_QUEUE_TRACE_ACQUIRE) @@ -1076,23 +1083,36 @@ _e_hwc_windows_target_window_queue_set(E_Hwc_Window_Target *target_hwc_window) } static void -_e_hwc_windows_target_window_render_flush_pre_cb(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) +_e_hwc_windows_target_window_render_pre_cb(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) { E_Hwc_Window_Target *target_hwc_window = (E_Hwc_Window_Target *)data; E_Hwc_Window *hwc_window; - E_Hwc_Windows_Buffer_Comp_Info *buffer_comp_info; E_Hwc *hwc; Eina_List *l; hwc = target_hwc_window->hwc; if (!e_hwc_windows_fence_enabled_get(hwc)) return; - if (target_hwc_window->dequeued_tsurface) + EINA_LIST_FOREACH(hwc->visible_windows, l, hwc_window) { - buffer_comp_info = _e_hwc_windows_buffer_comp_info_get(target_hwc_window->dequeued_tsurface); - if (buffer_comp_info && buffer_comp_info->release_fence) - e_egl_sync_wait(buffer_comp_info->release_fence); + if (hwc_window->is_deleted) continue; + if (!hwc_window->ec) continue; + if (!hwc_window->ec->explicit_sync_surface) continue; + if (e_hwc_window_accepted_state_get(hwc_window) != E_HWC_WINDOW_STATE_CLIENT) + continue; + + e_explicit_sync_surface_sync(hwc_window->ec->explicit_sync_surface); } +} + +static void +_e_hwc_windows_target_window_render_flush_pre_cb(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) +{ + E_Hwc_Window_Target *target_hwc_window = (E_Hwc_Window_Target *)data; + E_Hwc *hwc; + + hwc = target_hwc_window->hwc; + if (!e_hwc_windows_fence_enabled_get(hwc)) return; if (target_hwc_window->end_render_sync) { @@ -1103,17 +1123,6 @@ _e_hwc_windows_target_window_render_flush_pre_cb(void *data, Evas *e EINA_UNUSED target_hwc_window->end_render_sync = e_egl_sync_fence_create(); if (!target_hwc_window->end_render_sync) EHWSERR("Failed to create E_Egl_Sync", hwc); - - EINA_LIST_FOREACH(hwc->visible_windows, l, hwc_window) - { - if (!hwc_window->is_deleted) continue; - if (!hwc_window->ec) continue; - if (!hwc_window->ec->explicit_sync_surface) continue; - if (e_hwc_window_accepted_state_get(hwc_window) != E_HWC_WINDOW_STATE_CLIENT) - continue; - - e_explicit_sync_surface_sync(hwc_window->ec->explicit_sync_surface); - } } static void @@ -1242,6 +1251,10 @@ _e_hwc_windows_target_window_free(E_Hwc_Window_Target *target_hwc_window) EVAS_CALLBACK_RENDER_FLUSH_PRE, _e_hwc_windows_target_window_render_flush_pre_cb); + evas_event_callback_del(target_hwc_window->evas, + EVAS_CALLBACK_RENDER_PRE, + _e_hwc_windows_target_window_render_pre_cb); + ecore_main_fd_handler_del(target_hwc_window->event_hdlr); close(target_hwc_window->event_fd); @@ -1310,6 +1323,11 @@ _e_hwc_windows_target_window_new(E_Hwc *hwc) _e_hwc_windows_target_window_render_flush_pre_cb, target_hwc_window); + evas_event_callback_add(evas, + EVAS_CALLBACK_RENDER_PRE, + _e_hwc_windows_target_window_render_pre_cb, + target_hwc_window); + return target_hwc_window; fail: