e_hwc_windows: dequeue the pending update data of all hwc 30/271330/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 11 Feb 2022 11:31:37 +0000 (20:31 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 18 Feb 2022 02:16:13 +0000 (11:16 +0900)
all hwc use same the root target window (ecore_evas)
so the root target window should dequeue the pending
update data of all hwc

Change-Id: Ic019da2bc315a49e5cefac755c0dd1b8eac7e1ae

src/bin/e_hwc_windows.c

index 91402c9..1dcf41c 100644 (file)
@@ -1242,14 +1242,17 @@ _e_hwc_windows_pending_update_data_enqueue(E_Hwc_Windows_Comp_Info *comp_info)
 }
 
 static Eina_Bool
-_e_hwc_windows_pending_update_data_dequeue(E_Hwc_Window_Target *target_hwc_window,
+_e_hwc_windows_pending_update_data_dequeue(E_Hwc_Window_Target *root_target_hwc_window,
                                            E_Hwc_Windows_Comp_Info *comp_info)
 {
+   E_Hwc_Window_Target *target_hwc_window;
    Eina_List *pending_update_list = NULL;
    E_Hwc_Window_Update_Data *update;
    E_Hwc_Window *hwc_window;
+   E_Output *output;
+   Eina_List *l;
 
-   EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(root_target_hwc_window, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(comp_info, EINA_FALSE);
 
    EINA_LIST_FREE(comp_info->pending_update_list, update)
@@ -1257,22 +1260,31 @@ _e_hwc_windows_pending_update_data_dequeue(E_Hwc_Window_Target *target_hwc_windo
 
    e_comp_wl_tizen_hwc_feedback_list_enqueue(&comp_info->feedback_list);
 
-   EINA_LIST_FREE(target_hwc_window->present_sync_windows, hwc_window)
+   EINA_LIST_FOREACH(e_comp->e_comp_screen->outputs, l, output)
      {
-        hwc_window->present_sync = EINA_FALSE;
+        if (!output->hwc) continue;
+
+        target_hwc_window = output->hwc->target_hwc_window;
+        if (!target_hwc_window) continue;
 
-        update = e_hwc_window_pending_update_data_dequeue(hwc_window);
-        if (update)
+        EINA_LIST_FREE(target_hwc_window->present_sync_windows, hwc_window)
           {
-             pending_update_list = eina_list_append(pending_update_list, update);
-             if (e_hwc_window_is_video(hwc_window))
-               e_client_video_commit_data_release(hwc_window->ec, 0, 0, 0);
-          }
+             hwc_window->present_sync = EINA_FALSE;
 
-        if (hwc_window->ec)
-          e_comp_wl_tizen_hwc_feedback_list_dequeue(hwc_window->ec, &comp_info->feedback_list);
+             update = e_hwc_window_pending_update_data_dequeue(hwc_window);
+             if (update)
+               {
+                  pending_update_list = eina_list_append(pending_update_list, update);
+                  if (e_hwc_window_is_video(hwc_window))
+                    e_client_video_commit_data_release(hwc_window->ec, 0, 0, 0);
+               }
+
+             if (hwc_window->ec)
+               e_comp_wl_tizen_hwc_feedback_list_dequeue(hwc_window->ec, &comp_info->feedback_list);
+
+             e_object_unref(E_OBJECT(hwc_window));
+          }
 
-        e_object_unref(E_OBJECT(hwc_window));
      }
 
    comp_info->pending_update_list = pending_update_list;
@@ -1281,23 +1293,33 @@ _e_hwc_windows_pending_update_data_dequeue(E_Hwc_Window_Target *target_hwc_windo
 }
 
 static Eina_Bool
-_e_hwc_windows_pending_update_data_clear(E_Hwc_Window_Target *target_hwc_window)
+_e_hwc_windows_pending_update_data_clear(E_Hwc_Window_Target *root_target_hwc_window)
 {
+   E_Hwc_Window_Target *target_hwc_window;
    E_Hwc_Window *hwc_window;
    E_Hwc_Window_Update_Data *update;
    tbm_surface_h tsurface;
    E_Hwc_Windows_Comp_Info *comp_info;
    Eina_List *l, *ll;
+   E_Output *output;
 
-   EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(root_target_hwc_window, EINA_FALSE);
 
-   EINA_LIST_FREE(target_hwc_window->present_sync_windows, hwc_window)
+   EINA_LIST_FOREACH(e_comp->e_comp_screen->outputs, l, output)
      {
-        hwc_window->present_sync = EINA_FALSE;
-        e_object_unref(E_OBJECT(hwc_window));
+        if (!output->hwc) continue;
+
+        target_hwc_window = output->hwc->target_hwc_window;
+        if (!target_hwc_window) continue;
+
+        EINA_LIST_FREE(target_hwc_window->present_sync_windows, hwc_window)
+          {
+             hwc_window->present_sync = EINA_FALSE;
+             e_object_unref(E_OBJECT(hwc_window));
+          }
      }
 
-   EINA_LIST_FOREACH_SAFE(target_hwc_window->rendering_tsurfaces, l, ll, tsurface)
+   EINA_LIST_FOREACH_SAFE(root_target_hwc_window->rendering_tsurfaces, l, ll, tsurface)
      {
         comp_info = _e_hwc_windows_comp_info_get(tsurface);
         if (!comp_info) continue;
@@ -2659,8 +2681,11 @@ _e_hwc_windows_target_state_set(E_Hwc_Window_Target *target_hwc_window, E_Hwc_Wi
 {
    E_Hwc_Window *target_window = (E_Hwc_Window *)target_hwc_window;
 
-   if ((state == E_HWC_WINDOW_STATE_NONE) && (e_hwc_window_state_get(target_window) != state))
-     _e_hwc_windows_pending_update_data_clear(target_hwc_window);
+   if (target_window->is_root_target)
+     {
+       if ((state == E_HWC_WINDOW_STATE_NONE) && (e_hwc_window_state_get(target_window) != state))
+         _e_hwc_windows_pending_update_data_clear(target_hwc_window);
+     }
 
    e_hwc_window_state_set(target_window, state, EINA_FALSE);
    e_hwc_window_accepted_state_set(target_window, state);