add log
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 25 Jan 2018 10:44:47 +0000 (19:44 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 25 Jan 2018 10:44:47 +0000 (19:44 +0900)
Change-Id: Iae0303f18d54c39b2f464f364284f72b75cd4b73

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

index 0f23e8c72690c0911ac5e022cfdb249b56d3e35d..e93337a7142d13c092565150bff6e8e8fd206169 100644 (file)
@@ -818,8 +818,13 @@ _e_hwc_window_cursor_surface_acquire(E_Hwc_Window *hwc_window)
              hwc_window);
         return NULL;
      }
-
-   if (!e_comp_object_hwc_update_exists(ec->frame) && hwc_window->tsurface) return NULL;
+#if 1
+   if (hwc_window->cursor_tsurface) return hwc_window->cursor_tsurface;
+#else
+   /* return the exist tsurface when there is no update on cursor image(pointer image) */
+   if (!e_comp_object_hwc_update_exists(ec->frame) && hwc_window->tsurface)
+     return hwc_window->tsurface;
+#endif
 
    e_comp_object_hwc_update_set(ec->frame, EINA_FALSE);
 
@@ -1166,7 +1171,7 @@ e_hwc_window_free(E_Hwc_Window *hwc_window)
         /* mark as deleted and delete when commit_data will be released */
         hwc_window->is_deleted = EINA_TRUE;
         hwc_window->ec = NULL;
-        hwc_window->state = E_HWC_WINDOW_STATE_NONE;
+        e_hwc_window_state_set(hwc_window, E_HWC_WINDOW_STATE_NONE);
         return;
      }
    else
@@ -1243,11 +1248,12 @@ e_hwc_window_update(E_Hwc_Window *hwc_window)
    error = tdm_hwc_window_set_buffer(hwc_window->thwc_window, hwc_window->tsurface);
    EINA_SAFETY_ON_TRUE_RETURN_VAL(error != TDM_ERROR_NONE, EINA_FALSE);
 
-   ELOGF("HWC-WINS", " ehw:%p sets ts:%p ------- {%25s}, state:%s, zpos:%d, deleted:%s",
-         hwc_window->ec ? hwc_window->ec->pixmap : NULL, hwc_window->ec,
-         hwc_window, hwc_window->tsurface, hwc_window->ec ? hwc_window->ec->icccm.title : "UNKNOWN",
-         e_hwc_window_state_string_get(hwc_window->state),
-         hwc_window->zpos, hwc_window->is_deleted ? "yes" : "no");
+   if (hwc_window->update_exist)
+     ELOGF("HWC-WINS", " ehw:%p sets ts:%10p ------- {%25s}, state:%s, zpos:%d, deleted:%s",
+           hwc_window->ec ? hwc_window->ec->pixmap : NULL, hwc_window->ec,
+           hwc_window, hwc_window->tsurface, hwc_window->ec ? hwc_window->ec->icccm.title : "UNKNOWN",
+           e_hwc_window_state_string_get(hwc_window->state),
+           hwc_window->zpos, hwc_window->is_deleted ? "yes" : "no");
 
    return EINA_TRUE;
 }
@@ -1276,28 +1282,6 @@ e_hwc_window_is_cursor(E_Hwc_Window *hwc_window)
    return hwc_window->is_cursor;
 }
 
-static void
-_e_hwc_window_client_buffer_reset(E_Hwc_Window *hwc_window)
-{
-   if (!hwc_window->tsurface) return;
-
-   tdm_hwc_window_set_buffer(hwc_window->thwc_window, NULL);
-
-   if (hwc_window->cursor_tsurface)
-     {
-        tbm_surface_destroy(hwc_window->cursor_tsurface);
-        hwc_window->cursor_tsurface = NULL;
-     }
-
-   ELOGF("HWC-WINS", " ehw:%p sets ts:(NULL) ------- {%25s}, state:%s, zpos:%d, deleted:%s",
-         hwc_window->ec ? hwc_window->ec->pixmap : NULL, hwc_window->ec,
-         hwc_window, hwc_window->ec ? hwc_window->ec->icccm.title : "UNKNOWN",
-         e_hwc_window_state_string_get(hwc_window->state),
-         hwc_window->zpos, hwc_window->is_deleted ? "yes" : "no");
-
-   hwc_window->tsurface = NULL;
-}
-
 EINTERN Eina_Bool
 e_hwc_window_buffer_fetch(E_Hwc_Window *hwc_window)
 {
@@ -1305,73 +1289,68 @@ e_hwc_window_buffer_fetch(E_Hwc_Window *hwc_window)
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
 
-   if (hwc_window->is_deleted)
-     {
-        ELOGF("HWC-WINS", "[soolim] ehw:%p is_delete.",
-              hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec, hwc_window);
-        return EINA_FALSE;
-     }
-
    /* set the buffer to be null  */
    if (hwc_window->state == E_HWC_WINDOW_STATE_NONE)
      {
-        _e_hwc_window_client_buffer_reset(hwc_window);
-        return EINA_TRUE;
-     }
+        if (hwc_window->cursor_tsurface)
+          {
+             tbm_surface_destroy(hwc_window->cursor_tsurface);
+             hwc_window->cursor_tsurface = NULL;
+          }
 
-   /* for video we set buffer in the video module */
-   if (e_hwc_window_is_video(hwc_window))
+        hwc_window->tsurface = NULL;
+     }
+   else
      {
-        tsurface = e_comp_wl_video_hwc_widow_surface_get(hwc_window);
-        if (!tsurface)
+        /* for video we set buffer in the video module */
+        if (e_hwc_window_is_video(hwc_window))
           {
-              ELOGF("HWC-WINS", " ehw:%p no buffer yet -- {%25s}, state:%s, zpos:%d, deleted:%s",
-                    hwc_window->ec ? hwc_window->ec->pixmap : NULL, hwc_window->ec,
-                    hwc_window, hwc_window->ec ? hwc_window->ec->icccm.title : "UNKNOWN",
-                    e_hwc_window_state_string_get(hwc_window->state),
-                    hwc_window->zpos, hwc_window->is_deleted ? "yes" : "no");
-             return EINA_FALSE;
+             tsurface = e_comp_wl_video_hwc_widow_surface_get(hwc_window);
+             if (!tsurface)
+                {
+                   ELOGF("HWC-WINS", " ehw:%p no buffer yet -- {%25s}, state:%s, zpos:%d, deleted:%s",
+                         hwc_window->ec ? hwc_window->ec->pixmap : NULL, hwc_window->ec,
+                         hwc_window, hwc_window->ec ? hwc_window->ec->icccm.title : "UNKNOWN",
+                         e_hwc_window_state_string_get(hwc_window->state),
+                         hwc_window->zpos, hwc_window->is_deleted ? "yes" : "no");
+                   return EINA_FALSE;
+                }
+          }
+        else if (e_hwc_window_is_cursor(hwc_window))
+          {
+             tsurface = _e_hwc_window_cursor_surface_acquire(hwc_window);
+             if (!tsurface)
+               {
+                  ELOGF("HWC-WINS", "[soolim] ehw:%p cursor buffer is null.",
+                        hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec, hwc_window);
+                  return EINA_FALSE;
+               }
+          }
+        else
+          {
+             /* acquire the surface */
+             tsurface = _e_hwc_window_client_surface_acquire(hwc_window);
+             if (!tsurface)
+               {
+                  ELOGF("HWC-WINS", "[soolim] ehw:%p client buffer is null.",
+                        hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec, hwc_window);
+                  return EINA_FALSE;
+               }
           }
 
+        /* exist tsurface for update hwc_window */
         hwc_window->tsurface = tsurface;
+     }
 
-        ELOGF("HWC-WINS", " ehw:%p sets ts:%p ------- {%25s}, state:%s, zpos:%d, deleted:%s",
+   if (hwc_window->tsurface != tsurface)
+     {
+        ELOGF("HWC-WINS", " ehw:%p sets ts:%10p ------- {%25s}, state:%s, zpos:%d, deleted:%s",
               hwc_window->ec ? hwc_window->ec->pixmap : NULL, hwc_window->ec,
               hwc_window, hwc_window->tsurface, hwc_window->ec ? hwc_window->ec->icccm.title : "UNKNOWN",
               e_hwc_window_state_string_get(hwc_window->state),
               hwc_window->zpos, hwc_window->is_deleted ? "yes" : "no");
-
-        goto done;
-     }
-
-#if 0
-   /* Do not fetch the buffers of the windows except the video window at the canvas_norender. */
-   if (e_comp_canvas_norender_get() > 0)
-     {
-        ELOGF("HWC-WINS", " NoRender get. no updated surface {%25s} on the ehw:%p.",
-              hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec,
-              hwc_window->ec ? hwc_window->ec->icccm.title : "UNKNOWN",
-              hwc_window);
-        return EINA_FALSE;
-     }
-#endif
-
-   if (e_hwc_window_is_cursor(hwc_window))
-     {
-        tsurface = _e_hwc_window_cursor_surface_acquire(hwc_window);
-        if (!tsurface) return EINA_FALSE;
-     }
-   else
-     {
-        /* acquire the surface */
-        tsurface = _e_hwc_window_client_surface_acquire(hwc_window);
-        if (!tsurface) return EINA_FALSE;
      }
 
-   /* exist tsurface for update hwc_window */
-   hwc_window->tsurface = tsurface;
-
-done:
    hwc_window->update_exist = EINA_TRUE;
 
    return EINA_TRUE;
@@ -1382,6 +1361,8 @@ e_hwc_window_commit_data_aquire(E_Hwc_Window *hwc_window)
 {
    E_Hwc_Window_Commit_Data *commit_data = NULL;
 
+   if (hwc_window->update_exist == EINA_FALSE) return EINA_FALSE;
+
 #if 0
    if (!e_hwc_window_is_on_hw_overlay(hwc_window))
      {
@@ -1423,6 +1404,9 @@ e_hwc_window_commit_data_aquire(E_Hwc_Window *hwc_window)
    commit_data = E_NEW(E_Hwc_Window_Commit_Data, 1);
    EINA_SAFETY_ON_NULL_RETURN_VAL(commit_data, EINA_FALSE);
 
+   /* fake commit data for free the e_hwc_window resource */
+   if (hwc_window->is_deleted) goto done;
+
    if (e_hwc_window_is_target(hwc_window) ||
        e_hwc_window_is_video(hwc_window))
      {
@@ -1437,8 +1421,8 @@ e_hwc_window_commit_data_aquire(E_Hwc_Window *hwc_window)
         e_comp_wl_buffer_reference(&commit_data->buffer_ref, _e_hwc_window_comp_wl_buffer_get(hwc_window));
      }
 
+done:
    hwc_window->commit_data = commit_data;
-
    hwc_window->update_exist = EINA_FALSE;
 
    return EINA_TRUE;
@@ -1453,43 +1437,51 @@ e_hwc_window_commit_data_release(E_Hwc_Window *hwc_window)
    /* we don't have data to release */
    if (!hwc_window->commit_data) return EINA_FALSE;
 
-   tsurface = hwc_window->commit_data->tsurface;
-
-   if (!tsurface)
-     {
-        e_comp_wl_buffer_reference(&hwc_window->display_info.buffer_ref, NULL);
-     }
-   else if (e_hwc_window_is_target(hwc_window) || e_hwc_window_is_video(hwc_window))
+   if (hwc_window->is_deleted)
      {
-        e_comp_wl_buffer_reference(&hwc_window->display_info.buffer_ref, NULL);
+        displaying_surface = e_hwc_window_displaying_surface_get(hwc_window);
+        if (displaying_surface) tbm_surface_internal_unref(displaying_surface);
+        hwc_window->display_info.tsurface = NULL;
+
+        free(hwc_window->commit_data);
+        e_hwc_window_free(hwc_window);
      }
    else
      {
-        e_comp_wl_buffer_reference(&hwc_window->display_info.buffer_ref, hwc_window->commit_data->buffer_ref.buffer);
-     }
+        tsurface = hwc_window->commit_data->tsurface;
 
-   e_comp_wl_buffer_reference(&hwc_window->commit_data->buffer_ref, NULL);
-
-   displaying_surface = e_hwc_window_displaying_surface_get(hwc_window);
-   if (displaying_surface)
-     {
-        if (e_hwc_window_is_target(hwc_window))
+        if (!tsurface)
           {
-             _e_hwc_window_target_window_surface_release((E_Hwc_Window_Target *)hwc_window, displaying_surface);
+             e_comp_wl_buffer_reference(&hwc_window->display_info.buffer_ref, NULL);
+          }
+        else if (e_hwc_window_is_target(hwc_window) || e_hwc_window_is_video(hwc_window))
+          {
+             e_comp_wl_buffer_reference(&hwc_window->display_info.buffer_ref, NULL);
+          }
+        else
+          {
+             e_comp_wl_buffer_reference(&hwc_window->display_info.buffer_ref, hwc_window->commit_data->buffer_ref.buffer);
           }
-     }
 
-   /* update hwc_window display info */
-   if (displaying_surface)
-     tbm_surface_internal_unref(displaying_surface);
+        e_comp_wl_buffer_reference(&hwc_window->commit_data->buffer_ref, NULL);
 
-   hwc_window->display_info.tsurface = tsurface;
+        /* release and unreference the previous surface */
+        displaying_surface = e_hwc_window_displaying_surface_get(hwc_window);
+        if (displaying_surface)
+          {
+             if (e_hwc_window_is_target(hwc_window))
+               {
+                  _e_hwc_window_target_window_surface_release((E_Hwc_Window_Target *)hwc_window, displaying_surface);
+               }
+             tbm_surface_internal_unref(displaying_surface);
+          }
 
-   free(hwc_window->commit_data);
-   hwc_window->commit_data = NULL;
+        /* update hwc_window display info */
+        hwc_window->display_info.tsurface = tsurface;
 
-   if (hwc_window->is_deleted && !e_hwc_window_displaying_surface_get(hwc_window))
-     e_hwc_window_free(hwc_window);
+        free(hwc_window->commit_data);
+        hwc_window->commit_data = NULL;
+     }
 
    return EINA_TRUE;
 }
@@ -1548,7 +1540,16 @@ e_hwc_window_target_buffer_fetch(E_Hwc_Window_Target *target_hwc_window)
      {
         /* acquire the surface */
         tsurface = _e_hwc_window_target_window_surface_acquire((E_Hwc_Window_Target *)hwc_window);
-        if (!tsurface) return EINA_FALSE;
+        if (!tsurface)
+          {
+             ELOGF("HWC-WINS", " the surface of target is null.", NULL, NULL);
+             return EINA_FALSE;
+          }
+        if (tsurface == hwc_window->tsurface)
+          {
+             ELOGF("HWC-WINS", " aquired buffer is same.(ts:%p)", NULL, NULL, hwc_window->tsurface);
+             return EINA_FALSE;
+          }
 
         hwc_window->tsurface = tsurface;
 
@@ -1711,28 +1712,13 @@ e_hwc_window_displaying_surface_get(E_Hwc_Window *hwc_window)
 EINTERN Eina_Bool
 e_hwc_window_state_set(E_Hwc_Window *hwc_window, E_Hwc_Window_State state)
 {
-   tdm_hwc_window_composition composition_type;
-   tdm_error error;
-
    EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
 
-   if (hwc_window->state != state)
-     {
-        /* target window and video window do not set the composition type */
-        if (e_hwc_window_is_target(hwc_window))
-          hwc_window->state = state;
-        else
-          {
-             composition_type = _get_composition_type(state);
-             error = tdm_hwc_window_set_composition_type(hwc_window->thwc_window, composition_type);
-             EINA_SAFETY_ON_TRUE_RETURN_VAL(error != TDM_ERROR_NONE, EINA_FALSE);
-
-             hwc_window->type = composition_type;
-             hwc_window->state = state;
+   if (hwc_window->state != state) hwc_window->state = state;
 
-             e_hwc_window_zpos_set(hwc_window, -999);
-          }
-     }
+   /* zpos is -999 at state none */
+   if (state == E_HWC_WINDOW_STATE_NONE)
+     e_hwc_window_zpos_set(hwc_window, -999);
 
    return EINA_TRUE;
 }
@@ -1787,6 +1773,7 @@ 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 *target_window;
    E_Hwc_Window *hw;
    const Eina_List *l;
    tbm_surface_h target_tsurface;
@@ -1794,6 +1781,9 @@ e_hwc_window_is_on_target_window(E_Hwc_Window *hwc_window)
    target_hwc_window = _e_hwc_window_target_window_get(hwc_window);
    EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
 
+   target_window = (E_Hwc_Window *)target_hwc_window;
+   if (e_hwc_window_state_get(target_window) != E_HWC_WINDOW_STATE_DEVICE) return 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);
@@ -1813,7 +1803,7 @@ e_hwc_window_state_string_get(E_Hwc_Window_State hwc_window_state)
      case E_HWC_WINDOW_STATE_NONE:
        return "NO"; // None
      case E_HWC_WINDOW_STATE_CLIENT:
-       return "CL"; // Clien
+       return "CL"; // Client
      case E_HWC_WINDOW_STATE_DEVICE:
        return "DV"; // Deivce
      case E_HWC_WINDOW_STATE_VIDEO:
index 5fd00ba9b4ab0dfaee1f2701b94f8caa61391237..2ee3e3bfa85d0f84aa9c3d25b9424718ecd483e0 100644 (file)
@@ -10,7 +10,7 @@ static Eina_Bool _e_output_hwc_windows_pp_window_commit(E_Output_Hwc *output_hwc
 
 // if ec has invalid buffer or scaled( transformed ) or forced composite(never_hwc)
 static Eina_Bool
-_e_output_hwc_windows_ec_check(E_Client *ec)
+_e_output_hwc_windows_device_state_check(E_Client *ec)
 {
    E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
    E_Output *eout;
@@ -21,9 +21,6 @@ _e_output_hwc_windows_ec_check(E_Client *ec)
      {
         ELOGF("HWC-WINS", "   ehw:%p -- {%25s} is forced to set CL state.(null cdata or buffer)",
               ec->pixmap, ec, ec->hwc_window, ec->icccm.title);
-
-        /* This buffer is like unvisible window */
-        e_hwc_window_state_set(ec->hwc_window, E_HWC_WINDOW_STATE_NONE);
         return EINA_FALSE;
      }
 
@@ -61,6 +58,8 @@ _e_output_hwc_windows_ec_check(E_Client *ec)
          if (!e_util_strcmp("wl_pointer-cursor", ec->icccm.window_role))
            break;
       default:
+         ELOGF("HWC-WINS", "   ehw:%p -- {%25s} is forced to set CL state.(buffer_type)",
+               ec->pixmap, ec, ec->hwc_window, ec->icccm.title);
          return EINA_FALSE;
      }
 
@@ -821,7 +820,7 @@ _e_output_hwc_windows_pp_commit(E_Output_Hwc *output_hwc)
 }
 
 static void
-_e_output_hwc_windows_status_print(E_Output_Hwc *output_hwc)
+_e_output_hwc_windows_status_print(E_Output_Hwc *output_hwc, Eina_Bool with_target)
 {
     const Eina_List *l;
     Eina_List *sort_wnds;
@@ -835,15 +834,20 @@ _e_output_hwc_windows_status_print(E_Output_Hwc *output_hwc)
          if (hwc_window->state == E_HWC_WINDOW_STATE_NONE) continue;
 
          if (e_hwc_window_is_target(hwc_window))
-           ELOGF("HWC-WINS", "  ehw:%p -- {%25s}, state:%s, zpos:%d",
-                 NULL, NULL, hwc_window, "@TARGET WINDOW@",
-                 e_hwc_window_state_string_get(hwc_window->state), hwc_window->zpos);
-         else
-           ELOGF("HWC-WINS", "  ehw:%p -- {%25s}, state:%s, zpos:%d, deleted:%s",
-                 hwc_window->ec ? hwc_window->ec->pixmap : NULL, hwc_window->ec,
-                 hwc_window, hwc_window->ec ? hwc_window->ec->icccm.title : "UNKNOWN",
-                 e_hwc_window_state_string_get(hwc_window->state),
-                 hwc_window->zpos, hwc_window->is_deleted ? "yes" : "no");
+           {
+              if (!with_target) continue;
+
+              ELOGF("HWC-WINS", "  ehw:%p ts:%p -- {%25s}, state:%s, zpos:%d",
+                    NULL, NULL, hwc_window, hwc_window->tsurface, "@TARGET WINDOW@",
+                    e_hwc_window_state_string_get(hwc_window->state), hwc_window->zpos);
+              continue;
+           }
+
+         ELOGF("HWC-WINS", "  ehw:%p ts:%p -- {%25s}, state:%s, zpos:%d, deleted:%s",
+               hwc_window->ec ? hwc_window->ec->pixmap : NULL, hwc_window->ec,
+               hwc_window, hwc_window->tsurface, hwc_window->ec ? hwc_window->ec->icccm.title : "UNKNOWN",
+               e_hwc_window_state_string_get(hwc_window->state),
+               hwc_window->zpos, hwc_window->is_deleted ? "yes" : "no");
       }
 
     eina_list_free(sort_wnds);
@@ -891,7 +895,7 @@ _e_output_hwc_windows_update(E_Output_Hwc *output_hwc)
 
 #if DBG_EVALUATE
    ELOGF("HWC-WINS", " Request HWC Validation to TDM HWC:", NULL, NULL);
-   _e_output_hwc_windows_status_print(output_hwc);
+   _e_output_hwc_windows_status_print(output_hwc, EINA_FALSE);
 #endif
 
    return EINA_TRUE;
@@ -973,6 +977,8 @@ _e_output_hwc_windows_accept(E_Output_Hwc *output_hwc, uint32_t num_changes)
           {
              hwc_window->uncompleted_transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_CLIENT;
              accept_changes = EINA_FALSE;
+
+             ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_DEVICE_TO_CLIENT is set.(Accept_Changes)", NULL, NULL);
           }
 
         /* update the state with the changed compsition */
@@ -1000,7 +1006,7 @@ _e_output_hwc_windows_accept(E_Output_Hwc *output_hwc, uint32_t num_changes)
 
 #if DBG_EVALUATE
    ELOGF("HWC-WINS", " Modified after HWC Validation:", NULL, NULL);
-   _e_output_hwc_windows_status_print(output_hwc);
+   _e_output_hwc_windows_status_print(output_hwc, EINA_FALSE);
 #endif
 
    return EINA_TRUE;
@@ -1169,7 +1175,7 @@ _e_output_hwc_windows_full_gl_composite_check(E_Output_Hwc *output_hwc, Eina_Lis
    /* hwc_window manager required full GLES composition */
    if (e_comp->nocomp_override > 0)
      {
-        ELOGF("HWC-WINS", "  HWC_MODE_NONE due to nocomp_override > 0.", NULL, NULL);
+        ELOGF("HWC-WINS", "  HWC_MODE_HYBRID due to nocomp_override > 0.", NULL, NULL);
         goto full_gl_composite;
      }
 
@@ -1241,10 +1247,10 @@ _e_output_hwc_windows_hwc_acceptable_check(Eina_List *visible_windows_list)
         if (e_hwc_window_is_video(hwc_window)) continue;
 
         // check clients are able to use hwc
-        if (_e_output_hwc_windows_ec_check(hwc_window->ec))
-          e_hwc_window_state_set(hwc_window, E_HWC_WINDOW_STATE_CLIENT);
-        else
+        if (_e_output_hwc_windows_device_state_check(hwc_window->ec))
           e_hwc_window_state_set(hwc_window, E_HWC_WINDOW_STATE_DEVICE);
+        else
+          e_hwc_window_state_set(hwc_window, E_HWC_WINDOW_STATE_CLIENT);
      }
 }
 
@@ -1273,6 +1279,9 @@ e_output_hwc_windows_deinit(void)
 static Eina_Bool
 _e_output_hwc_windows_uncomplete_transition_check(E_Output_Hwc *output_hwc)
 {
+#if 1
+   return EINA_TRUE;
+#else
    const Eina_List *l;
    E_Hwc_Window *hwc_window;
    E_Hwc_Window_Target *target_hwc_window = output_hwc->target_hwc_window;
@@ -1296,6 +1305,9 @@ _e_output_hwc_windows_uncomplete_transition_check(E_Output_Hwc *output_hwc)
                      {
                         e_hwc_window_state_set(hwc_window, E_HWC_WINDOW_STATE_NONE);
                         ret = EINA_FALSE;
+#if DBG_EVALUATE
+                        ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_DEVICE_TO_NONE is set.(Transition_Check)", NULL, NULL);
+#endif
                      }
                 }
               else
@@ -1310,6 +1322,9 @@ _e_output_hwc_windows_uncomplete_transition_check(E_Output_Hwc *output_hwc)
                      {
                         e_hwc_window_state_set(hwc_window, E_HWC_WINDOW_STATE_CLIENT);
                         ret = EINA_FALSE;
+#if DBG_EVALUATE
+                        ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_DEVICE_TO_CLIENT is set.(Transition_Check)", NULL, NULL);
+#endif
                      }
                 }
               else
@@ -1324,6 +1339,9 @@ _e_output_hwc_windows_uncomplete_transition_check(E_Output_Hwc *output_hwc)
                      {
                         e_hwc_window_state_set(hwc_window, E_HWC_WINDOW_STATE_NONE);
                         ret = EINA_FALSE;
+#if DBG_EVALUATE
+                        ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_CLIENT_TO_DEVICE is set.(Transition_Check)", NULL, NULL);
+#endif
                      }
                 }
               else
@@ -1335,6 +1353,7 @@ _e_output_hwc_windows_uncomplete_transition_check(E_Output_Hwc *output_hwc)
      }
 
    return ret;
+#endif
 }
 
 static void
@@ -1374,23 +1393,40 @@ _e_output_hwc_windows_transition_update(E_Output_Hwc *output_hwc)
               if (e_hwc_window_state_get(hwc_window) == E_HWC_WINDOW_STATE_NONE)
                 {
                    hwc_window->transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_NONE;
-
+#if 0
                    /* need to complete_transition if target_window is enabled */
                    if (e_hwc_window_target_enabled(output_hwc->target_hwc_window))
-                     hwc_window->uncompleted_transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_NONE;
+                     {
+                        hwc_window->uncompleted_transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_NONE;
+#if DBG_EVALUATE
+                        ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_DEVICE_TO_NONE is set.(Transition_Update)", NULL, NULL);
+                     }
+#endif
+#endif
                 }
               if (e_hwc_window_state_get(hwc_window) == E_HWC_WINDOW_STATE_CLIENT)
                 {
                    hwc_window->transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_CLIENT;
-
+#if 0
                    /* need to complete_transition if target_window is enabled */
                    if (e_hwc_window_target_enabled(output_hwc->target_hwc_window))
-                     hwc_window->uncompleted_transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_CLIENT;
-
+                     {
+                        hwc_window->uncompleted_transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_CLIENT;
+#if DBG_EVALUATE
+                        ELOGF("HWC-WINS", " E_HWC_WINDOW_STATE_CLIENT is set.(Transition_Update)", NULL, NULL);
+#endif
+                     }
+#endif
                 }
               if (e_hwc_window_state_get(hwc_window) == E_HWC_WINDOW_STATE_DEVICE)
                 hwc_window->transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_DEVICE;
               break;
+           case E_HWC_WINDOW_STATE_CURSOR:
+              break;
+           case E_HWC_WINDOW_STATE_VIDEO:
+              break;
+           case E_HWC_WINDOW_STATE_DEVICE_CANDIDATE:
+              break;
            default:
               ERR("Unknown Prev_State: failed to update the states.");
               return;
@@ -1398,29 +1434,6 @@ _e_output_hwc_windows_transition_update(E_Output_Hwc *output_hwc)
      }
 }
 
-#if 0
-static void
-_e_output_hwc_windows_zpos_assign(E_Output_Hwc *output_hwc)
-{
-   E_Hwc_Window *hwc_window;
-   const Eina_List *l;
-   int zpos = 0;
-
-   EINA_LIST_FOREACH(e_output_hwc_windows_get(output_hwc), l, hwc_window)
-     {
-        if (e_hwc_window_is_target(hwc_window)) continue;
-
-        if (hwc_window->state == E_HWC_WINDOW_STATE_NONE)
-          {
-             if (hwc_window->zpos != -999) hwc_window->zpos = -999;
-             continue;
-          }
-
-        hwc_window->zpos = zpos++;
-     }
-}
-#endif
-
 static Eina_Bool
 _e_output_hwc_windows_commit_evaulate(E_Output_Hwc *output_hwc)
 {
@@ -1432,9 +1445,7 @@ _e_output_hwc_windows_commit_evaulate(E_Output_Hwc *output_hwc)
    can_validate = _e_output_hwc_windows_uncomplete_transition_check(output_hwc);
    if (can_validate)
      {
-        //_e_output_hwc_windows_zpos_assign(output_hwc);
-
-        if (! _e_output_hwc_windows_update(output_hwc))
+        if (!_e_output_hwc_windows_update(output_hwc))
           {
              ERR("HWC-WINS: _e_output_hwc_windows_update failed.");
              ret = EINA_FALSE;
@@ -1501,9 +1512,19 @@ e_output_hwc_windows_evaluate(E_Output_Hwc *output_hwc)
 
    /* evaulate the need_commit */
    if (_e_output_hwc_windows_commit_evaulate(output_hwc))
-     output_hwc->need_commit = EINA_TRUE;
+     {
+        output_hwc->need_commit = EINA_TRUE;
+#if DBG_EVALUATE
+        ELOGF("HWC-WINS", " Succeed the commit_evaulation.", NULL, NULL);
+#endif
+     }
    else
-     output_hwc->need_commit = EINA_FALSE;
+     {
+        output_hwc->need_commit = EINA_FALSE;
+#if DBG_EVALUATE
+        ELOGF("HWC-WINS", " Need to re-evaulation.", NULL, NULL);
+#endif
+     }
 
    /* update the activate/decativate state */
    _e_output_hwc_windows_activation_states_update(output_hwc);
@@ -1521,33 +1542,25 @@ e_output_hwc_windows_evaluate(E_Output_Hwc *output_hwc)
         if (hwc_mode == E_OUTPUT_HWC_MODE_HYBRID || hwc_mode == E_OUTPUT_HWC_MODE_NONE)
           ecore_event_add(E_EVENT_COMPOSITOR_ENABLE, NULL, NULL, NULL);
         else
-          {
-             ecore_event_add(E_EVENT_COMPOSITOR_DISABLE, NULL, NULL, NULL);
-             e_hwc_window_target_buffer_fetch(output_hwc->target_hwc_window); // release queue....
-          }
+          ecore_event_add(E_EVENT_COMPOSITOR_DISABLE, NULL, NULL, NULL);
 
         output_hwc->hwc_mode  = hwc_mode;
      }
 
+   ret = EINA_TRUE;
+
 #if DBG_EVALUATE
    if (hwc_mode == E_OUTPUT_HWC_MODE_NONE)
-     ELOGF("HWC-WINS", " HWC_MODE is NONE composition.", NULL, NULL);
+     ELOGF("HWC-WINS", " HWC_MODE is NONE composition. need_commit is %s.",
+           NULL, NULL, output_hwc->need_commit ? "TRUE" : "FALSE");
    else if (hwc_mode == E_OUTPUT_HWC_MODE_HYBRID)
-     ELOGF("HWC-WINS", " HWC_MODE is HYBRID composition.", NULL, NULL);
+     ELOGF("HWC-WINS", " HWC_MODE is HYBRID composition. need_commit is %s",
+           NULL, NULL, output_hwc->need_commit ? "TRUE" : "FALSE");
    else
-     ELOGF("HWC-WINS", " HWC_MODE is FULL HW composition.", NULL, NULL);
+     ELOGF("HWC-WINS", " HWC_MODE is FULL HW composition. need_commit is %s",
+           NULL, NULL, output_hwc->need_commit ? "TRUE" : "FALSE");
 #endif
 
-   if (e_hwc_window_target_enabled(output_hwc->target_hwc_window))
-     {
-        if (!e_hwc_window_target_buffer_fetch(output_hwc->target_hwc_window)) // try aquire
-          {
-             output_hwc->need_commit = EINA_FALSE;
-          }
-     }
-
-   ret = EINA_TRUE;
-
    return ret;
 }
 
@@ -1592,6 +1605,7 @@ EINTERN Eina_Bool
 e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
 {
    E_Hwc_Window *hwc_window = NULL;
+   E_Hwc_Window *target_window = NULL;
    Eina_List *l;
    E_Output *output = NULL;
    tdm_error error = TDM_ERROR_NONE;
@@ -1600,15 +1614,40 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
 
    output = output_hwc->output;
 
-   ELOGF("HWC-WINS", "###### Prepare Windows Commit(Fetch the buffers)", NULL, NULL);
-
    if (output_hwc->wait_commit)
      {
         ELOGF("HWC-WINS", "!!!!!!!! Didn't get Output Commit Handler Yet !!!!!!!!", NULL, NULL);
         return EINA_TRUE;
      }
 
-   if (output->dpms == E_OUTPUT_DPMS_OFF) return EINA_TRUE;
+   if (output->dpms == E_OUTPUT_DPMS_OFF)
+     {
+        EINA_LIST_FOREACH(output_hwc->hwc_windows, l, hwc_window)
+           _e_output_hwc_windows_offscreen_commit(output, hwc_window);
+
+        return EINA_TRUE;
+     }
+
+   target_window = (E_Hwc_Window *)output_hwc->target_hwc_window;
+   if (e_hwc_window_target_enabled(output_hwc->target_hwc_window))
+     {
+        if (!e_hwc_window_target_buffer_fetch(output_hwc->target_hwc_window)) // try aquire
+          {
+             output_hwc->need_commit = EINA_FALSE;
+             target_window->update_exist = EINA_FALSE;
+#if DBG_EVALUATE
+             ELOGF("HWC-WINS", " No available surface on target_window.", NULL, NULL);
+#endif
+          }
+        else
+          {
+             output_hwc->need_commit = EINA_TRUE;
+             target_window->update_exist = EINA_TRUE;
+#if DBG_EVALUATE
+             ELOGF("HWC-WINS", " Available surface on target_window.", NULL, NULL);
+#endif
+          }
+     }
 
    if (output_hwc->need_commit)
      {
@@ -1631,7 +1670,7 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
           {
              ELOGF("HWC-WINS", "!!!!!!!! Output Commit !!!!!!!!", NULL, NULL);
              ELOGF("HWC-WINS", " The number of visible clients:%d.", NULL, NULL, output_hwc->num_visible_windows);
-             _e_output_hwc_windows_status_print(output_hwc);
+             _e_output_hwc_windows_status_print(output_hwc, EINA_TRUE);
 
              error = tdm_output_commit(output->toutput, 0, _e_output_hwc_windows_commit_handler, output_hwc);
              if (error != TDM_ERROR_NONE)