hwc_windows: update preparation before update render target 76/187276/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 17 Aug 2018 10:54:39 +0000 (19:54 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 22 Aug 2018 02:59:59 +0000 (02:59 +0000)
Change-Id: I38baa108cbb19deb0508a8281a7d281909151fd4

src/bin/e_hwc_window.c
src/bin/e_hwc_window_queue.c
src/bin/e_hwc_windows.c

index c2d3a342a37e13491d50019598ea2184bfb6a951..37e1eae7a5e1430636c48a21cf0821f495f9dccc 100644 (file)
@@ -1829,6 +1829,8 @@ _e_hwc_window_client_recover(E_Hwc_Window *hwc_window)
    /* force update */
    e_comp_wl_surface_attach(ec, recover_buffer);
 
+   e_hwc_window_buffer_fetch(hwc_window);
+
    return;
 }
 
index c1d1ff90bc6c96ee342a7b1973021ea23460bea1..0ce1aeb517a40a54f05f88b2fc53aaa8ab76ef1e 100644 (file)
@@ -552,7 +552,6 @@ _e_hwc_window_queue_buffers_recall(E_Hwc_Window_Queue *queue, E_Hwc_Window *hwc_
    Eina_List *l = NULL;
    E_Hwc_Window_Queue_Buffer *queue_buffer = NULL;
    struct wayland_tbm_client_queue *cqueue = NULL;
-   E_Comp_Wl_Buffer *comp_buffer, *backup_buffer = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(queue, EINA_FALSE);
 
@@ -561,22 +560,7 @@ _e_hwc_window_queue_buffers_recall(E_Hwc_Window_Queue *queue, E_Hwc_Window *hwc_
                                           (void *)queue);
 
    if (hwc_window)
-     {
-        if ((hwc_window->buffer.tsurface) &&
-            (hwc_window->buffer.queue) &&
-            (hwc_window->buffer.tsurface != hwc_window->display.buffer.tsurface))
-           {
-              comp_buffer = _comp_wl_buffer_get(hwc_window->ec);
-              if (comp_buffer->tbm_surface)
-                {
-                   backup_buffer = _comp_wl_backup_buffer_get(comp_buffer->tbm_surface);
-                   e_comp_wl_surface_attach(hwc_window->ec, backup_buffer);
-                   e_hwc_window_buffer_fetch(hwc_window);
-                }
-           }
-
-        cqueue = _user_cqueue_get(hwc_window->ec);
-     }
+     cqueue = _user_cqueue_get(hwc_window->ec);
 
    EINA_LIST_FOREACH(queue->buffers, l, queue_buffer)
      {
index 34b4d256a661728b6e2796933f150f49ebe4304c..94eaeff15255dff3a582e14d7e71564a59504a28 100644 (file)
@@ -1010,6 +1010,29 @@ _e_hwc_windows_transition_check(E_Hwc *hwc)
     return transition;
 }
 
+static void
+_e_hwc_windows_preparation_update(E_Hwc *hwc)
+{
+   tdm_error terror;
+   E_Hwc_Window *hwc_window;
+   const Eina_List *l;
+   int preparation_types;
+
+   EINA_LIST_FOREACH(hwc->hwc_windows, l, hwc_window)
+     {
+        if (hwc_window->is_target) continue;
+        if (!hwc_window->thwc_window) continue;
+
+        terror = tdm_hwc_window_get_preparation_types(hwc_window->thwc_window,
+                                                      &preparation_types);
+        if (terror != TDM_ERROR_NONE) continue;
+
+        e_hwc_window_preparation_set(hwc_window, preparation_types);
+     }
+
+   return;
+}
+
 static void
 _e_hwc_windows_render_target_update(E_Hwc *hwc)
 {
@@ -1097,6 +1120,7 @@ _e_hwc_windows_accept(E_Hwc *hwc, uint32_t num_changes)
         e_hwc_window_state_set(hwc_window, state);
      }
 
+   _e_hwc_windows_preparation_update(hwc);
    _e_hwc_windows_render_target_update(hwc);
 
 #if DBG_EVALUATE
@@ -1528,29 +1552,6 @@ _e_hwc_windows_target_state_set(E_Hwc_Window_Target *target_hwc_window, E_Hwc_Wi
      e_hwc_window_accepted_state_set(target_window, state);
 }
 
-static void
-_e_hwc_windows_preparation_update(E_Hwc *hwc)
-{
-   tdm_error terror;
-   E_Hwc_Window *hwc_window;
-   const Eina_List *l;
-   int preparation_types;
-
-   EINA_LIST_FOREACH(hwc->hwc_windows, l, hwc_window)
-     {
-        if (hwc_window->is_target) continue;
-        if (!hwc_window->thwc_window) continue;
-
-        terror = tdm_hwc_window_get_preparation_types(hwc_window->thwc_window,
-                                                      &preparation_types);
-        if (terror != TDM_ERROR_NONE) continue;
-
-        e_hwc_window_preparation_set(hwc_window, preparation_types);
-     }
-
-   return;
-}
-
 /* evaluate the hwc_windows */
 static Eina_Bool
 _e_hwc_windows_evaluate(E_Hwc *hwc)
@@ -1570,8 +1571,6 @@ _e_hwc_windows_evaluate(E_Hwc *hwc)
    else
      EHWSTRACE(" Need the comopsition re-evaulation.", NULL);
 
-   _e_hwc_windows_preparation_update(hwc);
-
    /* decide the E_HWC_MODE */
    hwc_mode = _e_hwc_windows_hwc_mode_get(hwc);
    if (hwc->hwc_mode != hwc_mode)