From aff57730695cc880b6dcb8b715ede85f4ea19259 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Mon, 13 Jan 2020 20:57:41 +0900 Subject: [PATCH] e_hwc_windows: don't release commit_data of target window in list it is possible that other hwc_window is freed in _e_hwc_windows_rendered_windows_free. we must don't call commit_data_release of target_window in list. Change-Id: I0916dd36db9e37657deb9b502292040285e1f97e --- src/bin/e_hwc_windows.c | 50 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index 5e8fff73eb..fe33755741 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -280,14 +280,27 @@ _e_hwc_windows_commit_data_release(E_Hwc *hwc, int sequence, { const Eina_List *l, *ll; E_Hwc_Window *hwc_window; + E_Hwc_Window *hwc_window_target; - e_hwc_window_presentation_time_feedback_present(((E_Hwc_Window *)hwc->target_hwc_window), - sequence, - tv_sec, - tv_usec); + hwc_window_target = (E_Hwc_Window *)hwc->target_hwc_window; + if (hwc_window_target) + { + e_hwc_window_presentation_time_feedback_present(hwc_window_target, + sequence, + tv_sec, + tv_usec); + + /* it is possible that other hwc_window is freed in + * _e_hwc_windows_rendered_windows_free. + * we must don't call commit_data_release of target_window in list. + */ + if (hwc_window_target->commit_data) + e_hwc_window_commit_data_release(hwc_window_target); + } EINA_LIST_FOREACH_SAFE(hwc->hwc_windows, l, ll, hwc_window) { + if (hwc_window->is_target) continue; if (!hwc_window->commit_data) continue; e_hwc_window_presentation_time_feedback_present(hwc_window, sequence, tv_sec, tv_usec); @@ -363,13 +376,40 @@ static void _e_hwc_windows_offscreen_commit(E_Hwc *hwc) { E_Hwc_Window *hwc_window = NULL; + E_Hwc_Window *hwc_window_target; Eina_List *l, *ll; Eina_Bool ret = EINA_FALSE; - e_hwc_window_presentation_time_feedback_discard(((E_Hwc_Window *)hwc->target_hwc_window)); + hwc_window_target = (E_Hwc_Window *)hwc->target_hwc_window; + if (hwc_window_target) + { + e_hwc_window_presentation_time_feedback_discard(hwc_window_target); + + if (hwc->pp_set) + { + if (hwc->pp_hwc_window) + ret = e_hwc_window_pp_commit_data_acquire(hwc_window_target, EINA_TRUE); + else + ret = e_hwc_window_pp_commit_data_acquire(hwc_window_target, EINA_FALSE); + } + else + ret = e_hwc_window_commit_data_acquire(hwc_window_target); + + if (ret) + { + /* it is possible that other hwc_window is freed in + * _e_hwc_windows_rendered_windows_free. + * we must don't call commit_data_release of target_window in list. + */ + EHWSTRACE("!!!!!!!! HWC OffScreen Commit !!!!!!!!", NULL, hwc); + e_hwc_window_commit_data_release(hwc_window_target); + } + } EINA_LIST_FOREACH_SAFE(hwc->hwc_windows, l, ll, hwc_window) { + if (hwc_window->is_target) continue; + if (hwc->pp_set) { if (hwc->pp_hwc_window) -- 2.34.1