check.. transition
authorSooChan Lim <sc1.lim@samsung.com>
Sun, 28 Jan 2018 09:01:53 +0000 (18:01 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Sun, 28 Jan 2018 09:01:53 +0000 (18:01 +0900)
Change-Id: Ia1d0b6d8c741f9fe9c7646600c8551ce3203e4bb

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

index cd92f5be5c8d4413d1da304244ebaea67e139120..3e34f93a0d64774bdabef03d616b5e5f24c953a0 100644 (file)
@@ -1292,7 +1292,18 @@ e_hwc_window_buffer_fetch(E_Hwc_Window *hwc_window)
    tbm_surface_h tsurface = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
+#if 1
+   if (hwc_window->uncompleted_transition != E_HWC_WINDOW_TRANSITION_NONE_TO_NONE)
+     {
+        ELOGF("HWC-WINS", " !!! ehw:%p ts:%10p is under TRANSITION. ------- {%25s}, state:%s, zpos:%d, deleted:%s.",
+              hwc_window->ec ? hwc_window->ec->pixmap : NULL, hwc_window->ec,
+              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_FALSE;
+     }
+#endif
    /* set the buffer to be null  */
    if (hwc_window->state == E_HWC_WINDOW_STATE_NONE)
      {
@@ -1567,12 +1578,12 @@ e_hwc_window_target_buffer_fetch(E_Hwc_Window_Target *target_hwc_window)
         tsurface = _e_hwc_window_target_window_surface_acquire((E_Hwc_Window_Target *)hwc_window);
         if (!tsurface)
           {
-             ELOGF("HWC-WINS", " the surface of target is null.", NULL, NULL);
+             ELOGF("HWC-WINS", " the surface of target is null.(E_HWC_WINDOW_STATE_DEVICE)", NULL, NULL);
              return EINA_FALSE;
           }
         if (tsurface == hwc_window->tsurface)
           {
-             ELOGF("HWC-WINS", " aquired buffer is same.(ts:%p)", NULL, NULL, hwc_window->tsurface);
+             ELOGF("HWC-WINS", " aquired buffer is same.(ts:%p)(E_HWC_WINDOW_STATE_DEVICE)", NULL, NULL, hwc_window->tsurface);
              return EINA_FALSE;
           }
 
@@ -1595,6 +1606,12 @@ e_hwc_window_target_buffer_fetch(E_Hwc_Window_Target *target_hwc_window)
      }
    else
      {
+        if (hwc_window->tsurface == NULL)
+          {
+             ELOGF("HWC-WINS", " the surface of target is null.(E_HWC_WINDOW_STATE_NONE)", NULL, NULL);
+             return EINA_FALSE;
+          }
+
         if (hwc_window->tsurface)
           _e_hwc_window_target_window_surface_release((E_Hwc_Window_Target *)hwc_window, hwc_window->tsurface);
 
index 2b163abe56d046799ba40179430697b52811df42..1344e5cd889669c726ef5300937ff3a10c3f37d9 100644 (file)
@@ -998,7 +998,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);
+             ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_DEVICE_TO_CLIENT is set.(Accept_Changes)",
+                   hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec);
           }
 
         /* update the state with the changed compsition */
@@ -1342,9 +1343,8 @@ _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
+                        ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_DEVICE_TO_NONE is set.(Transition_Check)",
+                              hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec);
                      }
                 }
               else
@@ -1359,9 +1359,8 @@ _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
+                        ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_DEVICE_TO_CLIENT is set.(Transition_Check)",
+                              hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec);
                      }
                 }
               else
@@ -1376,9 +1375,8 @@ _e_output_hwc_windows_uncomplete_transition_check(E_Output_Hwc *output_hwc)
                      {
                         e_hwc_window_state_set(hwc_window, E_HWC_WINDOW_STATE_DEVICE);
                         ret = EINA_FALSE;
-#if DBG_EVALUATE
-                        ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_CLIENT_TO_DEVICE is set.(Transition_Check)", NULL, NULL);
-#endif
+                        ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_CLIENT_TO_DEVICE is set.(Transition_Check)",
+                              hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec);
                      }
                 }
               else
@@ -1414,6 +1412,8 @@ _e_output_hwc_windows_transition_update(E_Output_Hwc *output_hwc)
                 hwc_window->transition = E_HWC_WINDOW_TRANSITION_NONE_TO_DEVICE;
               if (e_hwc_window_state_get(hwc_window) == E_HWC_WINDOW_STATE_CURSOR)
                 hwc_window->transition = E_HWC_WINDOW_TRANSITION_NONE_TO_CURSOR;
+
+              hwc_window->uncompleted_transition =E_HWC_WINDOW_TRANSITION_NONE_TO_NONE;
               break;
            case E_HWC_WINDOW_STATE_CLIENT:
               if (e_hwc_window_state_get(hwc_window) == E_HWC_WINDOW_STATE_NONE)
@@ -1424,6 +1424,8 @@ _e_output_hwc_windows_transition_update(E_Output_Hwc *output_hwc)
                 hwc_window->transition = E_HWC_WINDOW_TRANSITION_CLIENT_TO_DEVICE;
              if (e_hwc_window_state_get(hwc_window) == E_HWC_WINDOW_STATE_CURSOR)
                 hwc_window->transition = E_HWC_WINDOW_TRANSITION_CLIENT_TO_CURSOR;
+
+              hwc_window->uncompleted_transition =E_HWC_WINDOW_TRANSITION_NONE_TO_NONE;
               break;
            case E_HWC_WINDOW_STATE_DEVICE:
               if (e_hwc_window_state_get(hwc_window) == E_HWC_WINDOW_STATE_NONE)
@@ -1435,7 +1437,8 @@ _e_output_hwc_windows_transition_update(E_Output_Hwc *output_hwc)
                      {
                         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);
+                        ELOGF("HWC-WINS", " E_HWC_WINDOW_TRANSITION_DEVICE_TO_NONE is set.(Transition_Update)",
+                              hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec);
 #endif
                      }
 #endif
@@ -1447,21 +1450,35 @@ _e_output_hwc_windows_transition_update(E_Output_Hwc *output_hwc)
                    if (e_hwc_window_target_enabled(output_hwc->target_hwc_window))
                      {
                         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
+
+                        ELOGF("HWC-WINS", " E_HWC_WINDOW_STATE_CLIENT is set.(Transition_Update)",
+                              hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec);
+                        continue;
                      }
+
+                    hwc_window->uncompleted_transition =E_HWC_WINDOW_TRANSITION_NONE_TO_NONE;
                 }
               if (e_hwc_window_state_get(hwc_window) == E_HWC_WINDOW_STATE_DEVICE)
                 hwc_window->transition = E_HWC_WINDOW_TRANSITION_DEVICE_TO_DEVICE;
+
+              hwc_window->uncompleted_transition =E_HWC_WINDOW_TRANSITION_NONE_TO_NONE;
               break;
            case E_HWC_WINDOW_STATE_CURSOR:
+
+              hwc_window->uncompleted_transition =E_HWC_WINDOW_TRANSITION_NONE_TO_NONE;
               break;
            case E_HWC_WINDOW_STATE_VIDEO:
+
+              hwc_window->uncompleted_transition =E_HWC_WINDOW_TRANSITION_NONE_TO_NONE;
               break;
            case E_HWC_WINDOW_STATE_DEVICE_CANDIDATE:
+
+              hwc_window->uncompleted_transition =E_HWC_WINDOW_TRANSITION_NONE_TO_NONE;
               break;
            default:
+
+              hwc_window->uncompleted_transition =E_HWC_WINDOW_TRANSITION_NONE_TO_NONE;
+
               ERR("Unknown Prev_State: failed to update the states.");
               return;
           }
@@ -1475,9 +1492,6 @@ _e_output_hwc_windows_commit_evaulate(E_Output_Hwc *output_hwc)
    Eina_Bool can_validate;
    uint32_t num_changes;
 
-   /* update the buffers and the infos */
-   _e_output_hwc_windows_buffers_update(output_hwc);
-
    /* evaluate the transition */
    can_validate = _e_output_hwc_windows_uncomplete_transition_check(output_hwc);
    if (can_validate)
@@ -1542,6 +1556,12 @@ e_output_hwc_windows_evaluate(E_Output_Hwc *output_hwc)
 
    ELOGF("HWC-WINS", "====================== Output HWC Apply (evaluate) ======================", NULL, NULL);
 
+   if (output_hwc->wait_commit)
+     {
+        ELOGF("HWC-WINS", "!!!!!!!! Didn't get Output Commit Handler Yet !!!!!!!!", NULL, NULL);
+        return EINA_TRUE;
+     }
+
    if (e_comp_canvas_norender_get() > 0)
      {
         ELOGF("HWC-WINS", " Block Display... NoRender get.", NULL, NULL);
@@ -1581,7 +1601,7 @@ e_output_hwc_windows_evaluate(E_Output_Hwc *output_hwc)
    else
      {
         e_hwc_window_state_set(target_window, E_HWC_WINDOW_STATE_NONE);
-        e_hwc_window_target_buffer_fetch(output_hwc->target_hwc_window);
+//        e_hwc_window_target_buffer_fetch(output_hwc->target_hwc_window);
      }
 
    if (output_hwc->hwc_mode != hwc_mode)
@@ -1678,7 +1698,7 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
      }
 
    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_enabled(output_hwc->target_hwc_window))
      {
         if (!e_hwc_window_target_buffer_fetch(output_hwc->target_hwc_window)) // try aquire
           {
@@ -1700,6 +1720,9 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
           }
      }
 
+   /* update the buffers and the infos */
+   _e_output_hwc_windows_buffers_update(output_hwc);
+
    if (output_hwc->update_changes)
    //if (output_hwc->need_commit || output_hwc->update_changes)
      {