e_hwc_windows: remove unnecessary struct member value and relation code about pp 65/226865/2
authorJunkyeong Kim <jk0430.kim@samsung.com>
Fri, 6 Mar 2020 04:52:41 +0000 (13:52 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 10 Mar 2020 11:29:15 +0000 (11:29 +0000)
previous code (plane mode) unset 'wait_commit' flag after pp done for the performance.
so need pending list for the pp result's output commit.
but now (window mode) unset 'wait_commit' flag after pp output commit done for sync.
so no more need pending list.

Change-Id: I004d104745a70efe103953b87a6aa15fcf828773
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/bin/e_hwc.h
src/bin/e_hwc_windows.c

index c6039f2..7f326de 100644 (file)
@@ -107,15 +107,12 @@ struct _E_Hwc
    /* variables for pp at hwc_windows policy */
    tdm_pp               *tpp;
    Eina_List            *pp_hwc_window_list;
-   Eina_List            *pending_pp_hwc_window_list;
-   Eina_List            *pending_pp_commit_data_list;
    tbm_surface_queue_h   pp_tqueue;
    tbm_surface_h         pp_tsurface;
    Eina_Bool             pp_set_info;
    Eina_Bool             pp_set;
    Eina_Bool             pp_unset;
    Eina_Bool             pp_commit;
-   Eina_Bool             pp_output_commit;
    E_Hwc_Window_Commit_Data  *pp_output_commit_data;
    Eina_Rectangle        pp_rect;
    Eina_Rectangle        pp_src_rect_prev;
index 1aa2150..468929a 100644 (file)
@@ -1313,42 +1313,6 @@ _e_hwc_windows_pp_window_get(E_Hwc *hwc, tbm_surface_h tsurface)
 }
 
 static void
-_e_hwc_windows_pp_pending_data_remove(E_Hwc *hwc)
-{
-   E_Hwc_Window_Commit_Data *data = NULL;
-   Eina_List *l = NULL, *ll = NULL;
-
-   if (eina_list_count(hwc->pending_pp_commit_data_list) != 0)
-     {
-        EINA_LIST_FOREACH_SAFE(hwc->pending_pp_commit_data_list, l, ll, data)
-          {
-             if (!data) continue;
-             hwc->pending_pp_commit_data_list = eina_list_remove_list(hwc->pending_pp_commit_data_list, l);
-             tbm_surface_queue_release(hwc->pp_tqueue, data->buffer.tsurface);
-             tbm_surface_internal_unref(data->buffer.tsurface);
-             E_FREE(data);
-          }
-     }
-   eina_list_free(hwc->pending_pp_commit_data_list);
-   hwc->pending_pp_commit_data_list = NULL;
-
-   if (eina_list_count(hwc->pending_pp_hwc_window_list) != 0)
-     {
-        E_Hwc_Window *hwc_window;
-        EINA_LIST_FOREACH_SAFE(hwc->pending_pp_hwc_window_list, l, ll, hwc_window)
-          {
-             if (!hwc_window) continue;
-             hwc->pending_pp_hwc_window_list = eina_list_remove_list(hwc->pending_pp_hwc_window_list, l);
-
-             if (hwc_window->ec) e_pixmap_image_clear(hwc_window->ec->pixmap, 1);
-             e_hwc_window_commit_data_release(hwc_window);
-          }
-     }
-   eina_list_free(hwc->pending_pp_hwc_window_list);
-   hwc->pending_pp_hwc_window_list = NULL;
-}
-
-static void
 _e_hwc_windows_pp_output_commit_handler(tdm_output *toutput, unsigned int sequence,
                                               unsigned int tv_sec, unsigned int tv_usec,
                                               void *user_data)
@@ -1361,8 +1325,6 @@ _e_hwc_windows_pp_output_commit_handler(tdm_output *toutput, unsigned int sequen
 
    hwc = user_data;
 
-   hwc->pp_output_commit = EINA_FALSE;
-
    _e_hwc_windows_commit_data_release(hwc, sequence, tv_sec, tv_usec);
    hwc->wait_commit = EINA_FALSE;
    hwc->pp_commit = EINA_FALSE;
@@ -1405,52 +1367,7 @@ _e_hwc_windows_pp_output_commit_handler(tdm_output *toutput, unsigned int sequen
 
    output = hwc->output;
    if (e_output_dpms_get(output))
-     {
-        _e_hwc_windows_pp_pending_data_remove(hwc);
-        return;
-     }
-
-   /* deal with the pending layer commit */
-   if (eina_list_count(hwc->pending_pp_commit_data_list) != 0)
-     {
-        data = eina_list_nth(hwc->pending_pp_commit_data_list, 0);
-        if (data)
-          {
-             hwc->pending_pp_commit_data_list = eina_list_remove(hwc->pending_pp_commit_data_list, data);
-
-             EHWSTRACE("PP Output Commit Handler start pending commit data(%p) tsurface(%p)", NULL, hwc, data, data->buffer.tsurface);
-
-             if (!_e_hwc_windows_pp_output_data_commit(hwc, data))
-               {
-                  EHWSERR("fail to _e_hwc_windows_pp_output_data_commit", hwc);
-                  return;
-               }
-          }
-     }
-
-   /* deal with the pending pp commit */
-   if (eina_list_count(hwc->pending_pp_hwc_window_list) != 0)
-     {
-        E_Hwc_Window *hwc_window;
-
-        hwc_window = eina_list_nth(hwc->pending_pp_hwc_window_list, 0);
-        if (hwc_window)
-          {
-             if (!tbm_surface_queue_can_dequeue(hwc->pp_tqueue, 0))
-               return;
-
-             hwc->pending_pp_hwc_window_list = eina_list_remove(hwc->pending_pp_hwc_window_list, hwc_window);
-
-             EHWSTRACE("PP Output Commit Handler start pending pp data(%p) tsurface(%p)", NULL, hwc, hwc_window, hwc_window->buffer.tsurface);
-
-             if (!_e_hwc_windows_pp_window_commit(hwc, hwc_window))
-               {
-                  EHWSERR("fail _e_hwc_windows_pp_data_commit", hwc);
-                  e_hwc_window_commit_data_release(hwc_window);
-                  return;
-               }
-          }
-     }
+     return;
 }
 
 static Eina_Bool
@@ -1468,10 +1385,7 @@ _e_hwc_windows_pp_output_data_commit(E_Hwc *hwc, E_Hwc_Window_Commit_Data *data)
    output = hwc->output;
 
    if (e_output_dpms_get(output))
-     {
-        _e_hwc_windows_pp_pending_data_remove(hwc);
-        goto fail;
-     }
+     goto fail;
 
    EHWSTRACE("!!!!!!!! HWC PP Output Commit !!!!!!!!", NULL, hwc);
    EHWSTRACE("   tsurface(%p)", NULL, hwc, data->buffer.tsurface);
@@ -1499,7 +1413,6 @@ _e_hwc_windows_pp_output_data_commit(E_Hwc *hwc, E_Hwc_Window_Commit_Data *data)
         goto fail;
      }
 
-   hwc->pp_output_commit = EINA_TRUE;
    hwc->pp_output_commit_data = data;
 
    return EINA_TRUE;
@@ -1542,12 +1455,6 @@ _e_hwc_windows_pp_output_commit(E_Hwc *hwc, tbm_surface_h tsurface)
    data->buffer.tsurface = pp_tsurface;
    tbm_surface_internal_ref(data->buffer.tsurface);
 
-   if (hwc->pp_output_commit)
-     {
-        hwc->pending_pp_commit_data_list = eina_list_append(hwc->pending_pp_commit_data_list, data);
-        return EINA_TRUE;
-     }
-
    if (!_e_hwc_windows_pp_output_data_commit(hwc, data))
      {
         EHWSERR("fail to _e_hwc_windows_pp_output_data_commit", hwc);
@@ -1599,7 +1506,6 @@ _e_hwc_windows_pp_commit_handler(tdm_pp *pp, tbm_surface_h tsurface_src, tbm_sur
    output = hwc->output;
    if (e_output_dpms_get(output))
      {
-        _e_hwc_windows_pp_pending_data_remove(hwc);
         tbm_surface_queue_release(hwc->pp_tqueue, tsurface_dst);
         _e_hwc_windows_commit_data_release(hwc, 0, 0, 0);
 
@@ -1706,10 +1612,7 @@ _e_hwc_windows_pp_window_commit(E_Hwc *hwc, E_Hwc_Window *hwc_window)
 
    output = hwc->output;
    if (e_output_dpms_get(output))
-     {
-        _e_hwc_windows_pp_pending_data_remove(hwc);
-        return EINA_FALSE;
-     }
+     return EINA_FALSE;
 
    tbm_err = tbm_surface_queue_dequeue(hwc->pp_tqueue, &pp_tsurface);
    if (tbm_err != TBM_ERROR_NONE)
@@ -1823,19 +1726,6 @@ _e_hwc_windows_pp_commit(E_Hwc *hwc)
         EHWSTRACE("PP Commit  Can Dequeue failed tsurface(%p) tqueue(%p) wl_buffer(%p) data(%p)",
                   NULL, hwc, commit_data->buffer.tsurface, hwc->pp_tqueue,
                   commit_data->buffer_ref.buffer ? commit_data->buffer_ref.buffer->resource : NULL, commit_data);
-        hwc->pending_pp_hwc_window_list = eina_list_append(hwc->pending_pp_hwc_window_list, hwc_window);
-
-        hwc->wait_commit = EINA_TRUE;
-
-        return EINA_TRUE;
-     }
-
-   if (eina_list_count(hwc->pending_pp_hwc_window_list) != 0)
-     {
-        EHWSTRACE("PP Commit  Pending pp data remained tsurface(%p) tqueue(%p) wl_buffer(%p) data(%p)",
-                  NULL, hwc, commit_data->buffer.tsurface, hwc->pp_tqueue,
-                  commit_data->buffer_ref.buffer ? commit_data->buffer_ref.buffer->resource : NULL, commit_data);
-        hwc->pending_pp_hwc_window_list = eina_list_append(hwc->pending_pp_hwc_window_list, hwc_window);
 
         hwc->wait_commit = EINA_TRUE;
 
@@ -2646,28 +2536,6 @@ _e_hwc_windows_target_buffer_prepared(E_Hwc *hwc)
    return EINA_TRUE;
 }
 
-static Eina_Bool
-_e_hwc_windos_pp_pending_window_check(E_Hwc *hwc)
-{
-   E_Hwc_Window *hwc_window = NULL;
-   E_Hwc_Window *hwc_window_pp = NULL;
-   const Eina_List *l;
-
-   if (eina_list_count(hwc->pending_pp_hwc_window_list) != 0)
-     {
-        hwc_window_pp = _e_hwc_windows_pp_get_hwc_window_for_zoom(hwc);
-        EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window_pp, EINA_FALSE);
-
-        EINA_LIST_FOREACH(hwc->pending_pp_hwc_window_list, l, hwc_window)
-          {
-             if (hwc_window == hwc_window_pp)
-               return EINA_TRUE;
-          }
-     }
-
-   return EINA_FALSE;
-}
-
 static void
 _e_hwc_windows_center_rect_get(int src_w, int src_h, int dst_w, int dst_h, Eina_Rectangle *fit)
 {
@@ -3392,12 +3260,6 @@ e_hwc_windows_commit(E_Hwc *hwc, E_Output_Display_Mode display_mode)
         return EINA_TRUE;
      }
 
-   if (hwc->pp_set)
-     {
-        if (_e_hwc_windos_pp_pending_window_check(hwc))
-          return EINA_TRUE;
-     }
-
    if (!_e_hwc_windows_commit_data_acquire(hwc))
      return EINA_TRUE;
 
@@ -3493,12 +3355,6 @@ e_hwc_windows_pp_commit_possible_check(E_Hwc *hwc)
           return EINA_FALSE;
      }
 
-   if (hwc->pending_pp_hwc_window_list)
-     {
-        if (eina_list_count(hwc->pending_pp_hwc_window_list) != 0)
-          return EINA_FALSE;
-     }
-
    return EINA_TRUE;
 }
 
@@ -3591,8 +3447,6 @@ e_hwc_windows_zoom_unset(E_Hwc *hwc)
         hwc->pp_hwc_window = NULL;
         hwc->pp_unset = EINA_TRUE;
 
-        _e_hwc_windows_pp_pending_data_remove(hwc);
-
         if (hwc->pp_tsurface)
           tbm_surface_queue_release(hwc->pp_tqueue, hwc->pp_tsurface);