e_hwc_windows: fix the transition of hwc in case hwc mode is hybrid 97/272997/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 28 Mar 2022 12:10:47 +0000 (21:10 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 29 Mar 2022 10:22:26 +0000 (19:22 +0900)
the target hwc window does not have the rendering tsurfaces
after the root target hwc window is introduced in hwc.
we use the rendering tsurfaces of the root target hwc window
for checking the transtion of hwc.

Change-Id: I76cbe9b45c2b0c60bd5290dccc44346e3eeb55e8

src/bin/e_hwc_windows.c

index add69df..21a8849 100644 (file)
@@ -899,7 +899,7 @@ static Eina_Bool
 _e_hwc_windows_target_window_rendered_window_has_no(E_Hwc *hwc, E_Hwc_Window *hwc_window, Eina_Bool all_target)
 {
    Eina_List *rendered_windows = NULL;
-   E_Hwc_Window_Target *target_hwc_window;
+   E_Hwc_Window_Target *target_hwc_window, *root_target_hwc_window;
    E_Hwc_Window *target_window;
    tbm_surface_h target_tsurface;
    const Eina_List *l;
@@ -907,6 +907,9 @@ _e_hwc_windows_target_window_rendered_window_has_no(E_Hwc *hwc, E_Hwc_Window *hw
    target_hwc_window = hwc->target_hwc_window;
    EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
 
+   root_target_hwc_window = _e_hwc_windows_root_target_hwc_window_get(hwc);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(root_target_hwc_window, EINA_FALSE);
+
    target_window = (E_Hwc_Window *)target_hwc_window;
    if (e_hwc_window_state_get(target_window) != E_HWC_WINDOW_STATE_DEVICE) return EINA_FALSE;
 
@@ -919,7 +922,7 @@ _e_hwc_windows_target_window_rendered_window_has_no(E_Hwc *hwc, E_Hwc_Window *hw
         if (!_e_hwc_windows_target_window_rendered_windows_find(rendered_windows, hwc_window))
           return EINA_TRUE;
 
-        EINA_LIST_FOREACH(target_hwc_window->rendering_tsurfaces, l, target_tsurface)
+        EINA_LIST_FOREACH(root_target_hwc_window->rendering_tsurfaces, l, target_tsurface)
           {
              rendered_windows = _e_hwc_windows_target_window_rendered_windows_get(target_tsurface);
              if (!_e_hwc_windows_target_window_rendered_windows_find(rendered_windows, hwc_window))
@@ -940,7 +943,7 @@ static Eina_Bool
 _e_hwc_windows_target_window_rendered_window_has(E_Hwc *hwc, E_Hwc_Window *hwc_window, Eina_Bool all_target)
 {
    Eina_List *rendered_windows = NULL, *new_list = NULL;
-   E_Hwc_Window_Target *target_hwc_window;
+   E_Hwc_Window_Target *target_hwc_window, *root_target_hwc_window;;
    E_Hwc_Window *target_window;
    E_Hwc_Window *hw;
    tbm_surface_h target_tsurface;
@@ -950,6 +953,9 @@ _e_hwc_windows_target_window_rendered_window_has(E_Hwc *hwc, E_Hwc_Window *hwc_w
    target_hwc_window = hwc->target_hwc_window;
    EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
 
+   root_target_hwc_window = _e_hwc_windows_root_target_hwc_window_get(hwc);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(root_target_hwc_window, EINA_FALSE);
+
    target_window = (E_Hwc_Window *)target_hwc_window;
    if (e_hwc_window_state_get(target_window) != E_HWC_WINDOW_STATE_DEVICE) return EINA_FALSE;
 
@@ -962,7 +968,7 @@ _e_hwc_windows_target_window_rendered_window_has(E_Hwc *hwc, E_Hwc_Window *hwc_w
 
         new_list = eina_list_clone(rendered_windows);
 
-        EINA_LIST_FOREACH(target_hwc_window->rendering_tsurfaces, l, target_tsurface)
+        EINA_LIST_FOREACH(root_target_hwc_window->rendering_tsurfaces, l, target_tsurface)
           {
              rendered_windows = _e_hwc_windows_target_window_rendered_windows_get(target_tsurface);
 
@@ -4285,7 +4291,7 @@ e_hwc_windows_mirror_unset(E_Hwc *hwc)
 EINTERN Eina_Bool
 e_hwc_windows_present_sync(E_Hwc *hwc)
 {
-   E_Hwc_Window_Target *target_hwc_window;
+   E_Hwc_Window_Target *root_target_hwc_window;
    E_Hwc_Windows_Comp_Info *comp_info;
    tbm_surface_h tsurface;
    Eina_List *l;
@@ -4293,12 +4299,12 @@ e_hwc_windows_present_sync(E_Hwc *hwc)
    EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE);
    EINA_SAFETY_ON_FALSE_RETURN_VAL(hwc->hwc_policy == E_HWC_POLICY_WINDOWS, EINA_FALSE);
 
-   target_hwc_window = hwc->target_hwc_window;
-   EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
+   root_target_hwc_window = _e_hwc_windows_root_target_hwc_window_get(hwc);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(root_target_hwc_window, EINA_FALSE);
 
    hwc->present_sync = EINA_TRUE;
 
-   EINA_LIST_FOREACH(target_hwc_window->rendering_tsurfaces, l, tsurface)
+   EINA_LIST_FOREACH(root_target_hwc_window->rendering_tsurfaces, l, tsurface)
      {
         comp_info = _e_hwc_windows_comp_info_get(tsurface);
         if (!comp_info) continue;
@@ -4306,7 +4312,7 @@ e_hwc_windows_present_sync(E_Hwc *hwc)
         comp_info->skip = EINA_TRUE;
      }
 
-   e_hwc_window_queue_clear(((E_Hwc_Window *)target_hwc_window)->queue);
+   e_hwc_window_queue_clear(((E_Hwc_Window *)root_target_hwc_window)->queue);
 
    EHWSINF("Present sync", NULL, hwc);