e_hwc_windows: check transition of client to none when display state is changed 01/226401/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 2 Mar 2020 07:58:10 +0000 (16:58 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 2 Mar 2020 09:16:56 +0000 (18:16 +0900)
consider the case below for prevent flickering
1. 1st window is displayed by HW Plane
   2nd window is displayed by gl compositing
2. gl compositor call rendering of 2nd window but buffer is not enqueued
3. 3rd window is launched and 1st window is hidden
   2st window should be hided
4. buffer of 2 step is enqueued
5. 1nd window is unset by HW Plane because buffer of 2 step doesn't render 1st window
6. 2nd window is shown without 3rd window

Change-Id: I8307901fd70f181c009a548fc96fb34e7b17576f

src/bin/e_hwc_windows.c

index 93a5952b2942f36a670477235d756edea53eaa5a..e7af101c14bdb7414d76b442a9b3b0eda490f1b4 100644 (file)
@@ -1804,6 +1804,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
    E_Hwc_Window_Target *target_hwc_window = NULL;
    Eina_Bool transition = EINA_FALSE;
    const Eina_List *l;
+   Eina_Bool display_state_changed = EINA_FALSE;
+   Eina_Bool client_to_none_transition = EINA_FALSE;
 
    target_hwc_window = hwc->target_hwc_window;
    EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
@@ -1830,6 +1832,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (!_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_FALSE))
                window_transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_CLIENT;
+
+             display_state_changed = EINA_TRUE;
           }
         /* DEVICE -> NONE */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_DEVICE) &&
@@ -1837,6 +1841,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_NONE;
+
+             display_state_changed = EINA_TRUE;
           }
         /* CURSOR -> CLIENT */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_CURSOR) &&
@@ -1844,6 +1850,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (!_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_FALSE))
                window_transition = E_HWC_WINDOW_TRANSITION_CURSOR_TO_CLIENT;
+
+             display_state_changed = EINA_TRUE;
           }
         /* CURSOR -> NONE */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_CURSOR) &&
@@ -1851,6 +1859,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_CURSOR_TO_NONE;
+
+             display_state_changed = EINA_TRUE;
           }
         /* CLIENT -> DEVICE */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_CLIENT) &&
@@ -1858,6 +1868,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_CLIENT_TO_DEVICE;
+
+             display_state_changed = EINA_TRUE;
           }
         /* CLIENT -> CURSOR */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_CLIENT) &&
@@ -1865,6 +1877,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_CLIENT_TO_CURSOR;
+
+             display_state_changed = EINA_TRUE;
           }
         /* NONE -> DEVICE */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_NONE) &&
@@ -1872,6 +1886,8 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_NONE_TO_DEVICE;
+
+             display_state_changed = EINA_TRUE;
           }
         /* NONE -> CURSOR */
         else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_NONE) &&
@@ -1879,6 +1895,15 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
           {
              if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
                window_transition = E_HWC_WINDOW_TRANSITION_NONE_TO_CURSOR;
+
+             display_state_changed = EINA_TRUE;
+          }
+        /* CLIENT -> NONE */
+        else if ((hwc_window->accepted_state == E_HWC_WINDOW_STATE_CLIENT) &&
+                 (hwc_window->state == E_HWC_WINDOW_STATE_NONE))
+          {
+             if (_e_hwc_windows_target_window_rendered_window_has(hwc, hwc_window, EINA_TRUE))
+               window_transition = E_HWC_WINDOW_TRANSITION_CLIENT_TO_NONE;
           }
 
         if (window_transition)
@@ -1886,10 +1911,20 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
              hwc_window->transition_failures++;
 
              e_hwc_window_transition_set(hwc_window, window_transition);
+
+             if (window_transition == E_HWC_WINDOW_TRANSITION_CLIENT_TO_NONE)
+               {
+                  client_to_none_transition = EINA_TRUE;
+                  continue;
+               }
+
              transition = EINA_TRUE;
           }
      }
 
+    if ((display_state_changed) && (client_to_none_transition))
+      transition = EINA_TRUE;
+
     return transition;
 }