e_hwc_windows: Fix flickering when hwc mode is changed HYBRID to NONE 03/315503/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 2 Dec 2024 03:31:16 +0000 (12:31 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 2 Dec 2024 10:40:14 +0000 (19:40 +0900)
if tdm backend set TDM_HWC_COMMIT_INTERVAL_VBLANK, hwc mode changes
between commit and commit_handler.
so commit buffer should be checked in _e_hwc_windows_present_sync_check
and hwc does not need to skip target buffer in e_hwc_windows_present_sync.

Change-Id: Ic7378f59fe21a02621765ce2dd1442d727c85c46

src/bin/displaymgr/e_hwc_windows.c

index b2c0a6b02ccc849287fb27ec8a6d4cf5a2e66a5d..7559a8c545497ca735873a8f5d53644d3f62f945 100644 (file)
@@ -630,50 +630,6 @@ e_hwc_windows_target_window_force_render(E_Hwc_Window_Target *target_hwc_window)
    evas_damage_rectangle_add(root_target_hwc_window->evas, 0, 0, w,  h);
 }
 
-static Eina_Bool
-_e_hwc_windows_target_window_buffer_skip(E_Hwc *hwc)
-{
-   E_Hwc_Window_Target *target_hwc_window;
-   E_Hwc_Window *hwc_window;
-   tdm_hwc *thwc;
-   tdm_region fb_damage;
-
-   target_hwc_window = hwc->target_hwc_window;
-   EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
-
-   hwc_window = (E_Hwc_Window *)target_hwc_window;
-
-   thwc = hwc->thwc;
-   EINA_SAFETY_ON_NULL_RETURN_VAL(thwc, EINA_FALSE);
-
-   CLEAR(fb_damage);
-
-   if ((hwc_window->current.buffer.tsurface) &&
-       (hwc_window->current.buffer.tsurface != hwc_window->display.buffer.tsurface))
-     {
-        e_hwc_window_queue_buffer_reference(&hwc_window->current.queue_buffer_ref, hwc_window->display.queue_buffer_ref.buffer);
-        e_hwc_window_buffer_set(&hwc_window->current.buffer, hwc_window->display.buffer.tsurface,
-                                hwc_window->display.buffer.queue, hwc_window->display.buffer.transform);
-        tdm_hwc_set_client_target_buffer(thwc, hwc_window->display.buffer.tsurface, fb_damage);
-
-        e_hwc_windows_target_window_force_render(target_hwc_window);
-     }
-
-   if (hwc->root_target_hwc_window)
-     {
-        hwc_window = (E_Hwc_Window *)hwc->root_target_hwc_window;
-
-        if (hwc_window->current.buffer.tsurface)
-          e_hwc_windows_presentation_time_feedback_and_callback_take(hwc, hwc_window->current.buffer.tsurface);
-
-        e_hwc_window_queue_buffer_reference(&hwc_window->current.queue_buffer_ref, hwc_window->display.queue_buffer_ref.buffer);
-        e_hwc_window_buffer_set(&hwc_window->current.buffer, hwc_window->display.buffer.tsurface,
-                                hwc_window->display.buffer.queue, hwc_window->display.buffer.transform);
-     }
-
-   return EINA_TRUE;
-}
-
 static void
 _e_hwc_windows_target_window_queue_clear(E_Hwc_Window_Target *target_hwc_window)
 {
@@ -1916,24 +1872,25 @@ _e_hwc_windows_window_state_get(tdm_hwc_window_composition composition_type)
 static Eina_Bool
 _e_hwc_windows_present_sync_check(E_Hwc *hwc)
 {
-   E_Hwc_Window_Target *target_hwc_window;
    E_Hwc_Window_Target *root_target_hwc_window;
+   E_Hwc_Window *hwc_window;
 
    if (!hwc->present_sync) return EINA_FALSE;
 
-   target_hwc_window = hwc->target_hwc_window;
-   EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
+   hwc_window = (E_Hwc_Window *)hwc->target_hwc_window;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
 
    if (hwc->hwc_mode != E_HWC_MODE_FULL)
      {
-        if ((((E_Hwc_Window *)target_hwc_window)->display.buffer.tsurface) ==
-            (((E_Hwc_Window *)target_hwc_window)->current.buffer.tsurface))
+        if ((!hwc_window->current.buffer.tsurface) ||
+            (e_hwc_window_display_or_commit_buffer_check(hwc_window,
+                                                         hwc_window->current.buffer.tsurface)))
           {
              root_target_hwc_window = _e_hwc_windows_root_target_hwc_window_get(hwc);
              if (root_target_hwc_window)
                {
                   if (!eina_list_count(root_target_hwc_window->rendering_tsurfaces))
-                    e_hwc_windows_target_window_force_render(target_hwc_window);
+                    e_hwc_windows_target_window_force_render(hwc->target_hwc_window);
                }
 
              return EINA_TRUE;
@@ -4072,9 +4029,6 @@ e_hwc_windows_present_sync(E_Hwc *hwc)
      }
 
    _e_hwc_windows_target_window_queue_clear(root_target_hwc_window);
-
-   _e_hwc_windows_target_window_buffer_skip(hwc);
-
    e_hwc_windows_target_window_force_render(hwc->target_hwc_window);
 
    EHWSINF("Present sync", NULL, hwc);