e_hwc_windows: don't release commit_data of target window in list 27/222327/4
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 13 Jan 2020 11:57:41 +0000 (20:57 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 14 Jan 2020 06:34:06 +0000 (06:34 +0000)
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

index 5e8fff73eb49ef2d13a420f1ba4d214454f3bbd4..fe337557416e08b14827e60a037d755996468e4a 100644 (file)
@@ -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)