check the visible windows at every idle time.... sandbox/srk/hwc
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 5 Feb 2018 08:57:09 +0000 (17:57 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 5 Feb 2018 10:24:16 +0000 (19:24 +0900)
Change-Id: I386ddafe73989fd5ed87ea24b66e4ed11727cd6b

src/bin/e_hwc_window.c
src/bin/e_hwc_window.h
src/bin/e_output_hwc_windows.c

index 6393b1e522e688f23b1dc33f47eb90777d111015..ae352afc7be989177bea03f3f3267a22f176edec 100644 (file)
@@ -324,9 +324,7 @@ _e_hwc_window_target_new(E_Output_Hwc *output_hwc)
    EINA_SAFETY_ON_NULL_GOTO(target_hwc_window, fail);
 
    ((E_Hwc_Window *)target_hwc_window)->is_target = EINA_TRUE;
-   /* the target hwc_window is always displayed on hw layer */
-   ((E_Hwc_Window *)target_hwc_window)->type = TDM_COMPOSITION_NONE;
-   ((E_Hwc_Window *)target_hwc_window)->state = E_HWC_WINDOW_STATE_NONE;
+   ((E_Hwc_Window *)target_hwc_window)->state = E_HWC_WINDOW_STATE_DEVICE;
    ((E_Hwc_Window *)target_hwc_window)->output_hwc = output_hwc;
 
    target_hwc_window->ee = e_comp->ee;
@@ -965,49 +963,6 @@ _e_hwc_window_correct_transformation_check(E_Hwc_Window *hwc_window)
 }
 #endif
 
-#if 0
-/* whether an hwc_window exists on a target_buffer which is currently set at the target_window */
-static Eina_Bool
-_e_hwc_window_is_on_target_window(E_Hwc_Window *hwc_window)
-{
-    Eina_List *ee_rendered_hw_list = NULL;
-    E_Hwc_Window_Target *target_hwc_window;
-    E_Hwc_Window *hw;
-    const Eina_List *l;
-    tbm_surface_h target_tsurface;
-
-    target_hwc_window = _e_hwc_window_target_window_get(hwc_window);
-    EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
-
-    target_tsurface = target_hwc_window->hwc_window.tsurface;
-
-    tbm_surface_internal_get_user_data(target_tsurface, ee_rendered_hw_list_key, (void**)&ee_rendered_hw_list);
-
-    EINA_LIST_FOREACH(ee_rendered_hw_list, l, hw)
-       if (hw == hwc_window) return EINA_TRUE;
-
-    return EINA_FALSE;
-}
-
-static Eina_Bool
-_e_hwc_window_is_device_to_client_transition(E_Hwc_Window *hwc_window)
-{
-   E_Hwc_Window_Target *target_hwc_window;
-
-   if (hwc_window->is_deleted) return EINA_FALSE;
-
-   target_hwc_window = _e_hwc_window_target_window_get(hwc_window);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
-
-   if (((E_Hwc_Window *)target_hwc_window)->state == E_HWC_WINDOW_STATE_NONE) return EINA_FALSE;
-   if (!hwc_window->is_device_to_client_transition) return EINA_FALSE;
-   if (e_hwc_window_is_target(hwc_window)) return EINA_FALSE;
-   if (_e_hwc_window_is_on_target_window(hwc_window)) return EINA_FALSE;
-
-   return EINA_TRUE;
-}
-#endif
-
 EINTERN Eina_Bool
 e_hwc_window_init(E_Output_Hwc *output_hwc)
 {
@@ -1094,12 +1049,6 @@ e_hwc_window_new(E_Output_Hwc *output_hwc, E_Client *ec, E_Hwc_Window_State stat
         return NULL;
      }
 
-   error = tdm_hwc_window_set_composition_type(hwc_window->thwc_window, TDM_COMPOSITION_NONE);
-   EINA_SAFETY_ON_TRUE_RETURN_VAL(error != TDM_ERROR_NONE, NULL);
-
-   hwc_window->state = E_HWC_WINDOW_STATE_NONE;
-   hwc_window->type = TDM_COMPOSITION_NONE;
-
    /* cursor window */
    if (e_policy_client_is_cursor(ec))
      hwc_window->is_cursor = EINA_TRUE;
index 01a87b6a4b4847d7a669ce9619f2a7c94cd96009..3498144173e769b3ef3bbf78818eba3461774f55 100644 (file)
@@ -49,7 +49,6 @@ struct _E_Hwc_Window
    E_Output_Hwc                  *output_hwc;
    tdm_hwc_window                *thwc_window;
    int                            zpos;
-   tdm_hwc_window_composition     type;
    Eina_Bool                      is_target;
    Eina_Bool                      is_video;
    Eina_Bool                      is_cursor;
index eed363fe287e4c2aec026c5b734dfb7f229b0422..d2033d3e204386da5821313143b6cefddcdff953 100644 (file)
@@ -1314,27 +1314,19 @@ _e_output_hwc_windows_states_evaluate(E_Output_Hwc *output_hwc)
 
 /* evaluate the hwc_windows */
 static Eina_Bool
-_e_output_hwc_windows_evaluate(E_Output_Hwc *output_hwc)
+_e_output_hwc_windows_evaluate(E_Output_Hwc *output_hwc, Eina_List *visible_windows_list)
 {
    E_Output_Hwc_Mode hwc_mode = E_OUTPUT_HWC_MODE_NONE;
    E_Hwc_Window *target_window = (E_Hwc_Window *)output_hwc->target_hwc_window;
-   Eina_List *visible_windows_list = NULL;
 
    ELOGF("HWC-WINS", "====================== Output HWC Apply (evaluate) ======================", NULL, NULL);
 
-   /* evaulate the current states */
-   visible_windows_list = _e_output_hwc_windows_states_evaluate(output_hwc);
-
    /* evaulate the compositions with the states*/
    if (_e_output_hwc_windows_composition_evaulate(output_hwc, visible_windows_list))
         ELOGF("HWC-WINS", " Succeed the compsition_evaulation.", NULL, NULL);
    else
         ELOGF("HWC-WINS", " Need the comopsition re-evaulation.", NULL, NULL);
 
-
-   if (visible_windows_list)
-     eina_list_free(visible_windows_list);
-
    /* update the activate/decativate state */
    _e_output_hwc_windows_activation_states_update(output_hwc);
 
@@ -1465,6 +1457,7 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
    Eina_List *l;
    E_Output *output = NULL;
    tdm_error error = TDM_ERROR_NONE;
+   Eina_List *visible_windows_list = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(output_hwc, EINA_FALSE);
 
@@ -1490,15 +1483,18 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
         return EINA_TRUE;
      }
 
+   /* evaulate the current states */
+   visible_windows_list = _e_output_hwc_windows_states_evaluate(output_hwc);
+
    if (_e_output_hwc_windows_update_changes(output_hwc) ||
        output_hwc->hwc_mode == E_OUTPUT_HWC_MODE_NONE)
      {
-        if (!_e_output_hwc_windows_evaluate(output_hwc))
+        if (!_e_output_hwc_windows_evaluate(output_hwc, visible_windows_list))
           {
              ELOGF("HWC-WINS", "Evaluation is not completed. No Commit at this time.", NULL, NULL);
              /* update the previous states. */
              _e_output_hwc_windows_prev_states_update(output_hwc);
-             return EINA_TRUE;
+             goto fail;
           }
 
         EINA_LIST_FOREACH(output_hwc->hwc_windows, l, hwc_window)
@@ -1511,7 +1507,7 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
              if (!_e_output_hwc_windows_pp_commit(output_hwc))
                {
                   ERR("_e_output_hwc_windows_pp_commit failed.");
-                  return EINA_FALSE;
+                  goto fail;
                }
           }
         else
@@ -1526,7 +1522,7 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
              {
                 ERR("tdm_output_commit failed.");
                 _e_output_hwc_windows_commit_handler(output->toutput, 0, 0, 0, output_hwc);
-                return EINA_FALSE;
+                goto fail;
              }
 
              output_hwc->wait_commit = EINA_TRUE;
@@ -1536,7 +1532,17 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
        _e_output_hwc_windows_prev_states_update(output_hwc);
      }
 
+   if (visible_windows_list)
+     eina_list_free(visible_windows_list);
+
    return EINA_TRUE;
+
+fail:
+
+   if (visible_windows_list)
+     eina_list_free(visible_windows_list);
+
+   return EINA_FALSE;
 }
 
 EINTERN Eina_Bool