some fix
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 26 Jan 2018 01:21:05 +0000 (10:21 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 26 Jan 2018 01:21:05 +0000 (10:21 +0900)
Change-Id: I9356d3c8e2399053155ccc03f45ba4e297b6e062

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

index e93337a7142d13c092565150bff6e8e8fd206169..0ea6bb08222c3974b09fb1616639f5334bccca40 100644 (file)
@@ -557,7 +557,7 @@ _e_hwc_window_client_surface_acquire(E_Hwc_Window *hwc_window)
         return NULL;
      }
 
-   e_comp_object_hwc_update_set(ec->frame, EINA_FALSE);
+   //e_comp_object_hwc_update_set(ec->frame, EINA_FALSE);
 
    return tsurface;
 }
@@ -788,6 +788,7 @@ _e_hwc_window_cursor_surface_refresh(E_Hwc_Window *hwc_window, E_Pointer *pointe
 
    hwc_window->cursor_tsurface = tsurface;
 
+   /* to set the hwc_window_cursor_tsurface to the hwc_window->tsurface */
    e_comp_object_hwc_update_set(ec->frame, EINA_TRUE);
 
    return EINA_TRUE;
@@ -826,7 +827,7 @@ _e_hwc_window_cursor_surface_acquire(E_Hwc_Window *hwc_window)
      return hwc_window->tsurface;
 #endif
 
-   e_comp_object_hwc_update_set(ec->frame, EINA_FALSE);
+   //e_comp_object_hwc_update_set(ec->frame, EINA_FALSE);
 
    if (!_e_hwc_window_cursor_surface_refresh(hwc_window, pointer))
      {
@@ -1248,13 +1249,6 @@ 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);
 
-   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;
 }
 
@@ -1298,6 +1292,8 @@ e_hwc_window_buffer_fetch(E_Hwc_Window *hwc_window)
              hwc_window->cursor_tsurface = NULL;
           }
 
+        if (hwc_window->tsurface == NULL) return EINA_TRUE;
+
         hwc_window->tsurface = NULL;
      }
    else
@@ -1308,13 +1304,14 @@ e_hwc_window_buffer_fetch(E_Hwc_Window *hwc_window)
              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",
+                   ELOGF("HWC-WINS", " ehw:%p no video buffer yet -- {%25s}, state:%s, zpos:%d, deleted:%s (Video)",
                          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;
                 }
+             hwc_window->update_exist = EINA_TRUE;
           }
         else if (e_hwc_window_is_cursor(hwc_window))
           {
@@ -1325,6 +1322,18 @@ e_hwc_window_buffer_fetch(E_Hwc_Window *hwc_window)
                         hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec, hwc_window);
                   return EINA_FALSE;
                }
+            if (!e_comp_object_hwc_update_exists(hwc_window->ec->frame)) return EINA_TRUE;
+
+              {
+                 e_comp_object_hwc_update_set(hwc_window->ec->frame, EINA_FALSE);
+                 hwc_window->update_exist = EINA_TRUE;
+
+                 ELOGF("HWC-WINS", " ehw:%p sets ts:%10p ------- {%25s}, state:%s, zpos:%d, deleted:%s (Cusor)",
+                       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");
+              }
           }
         else
           {
@@ -1336,22 +1345,22 @@ e_hwc_window_buffer_fetch(E_Hwc_Window *hwc_window)
                         hwc_window->ec ? ec->pixmap : NULL, hwc_window->ec, hwc_window);
                   return EINA_FALSE;
                }
-          }
+             if (tsurface == hwc_window->tsurface) return EINA_TRUE;
 
-        /* exist tsurface for update hwc_window */
-        hwc_window->tsurface = tsurface;
-     }
+             hwc_window->update_exist = EINA_TRUE;
 
-   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");
+             ELOGF("HWC-WINS", " ehw:%p sets ts:%10p ------- {%25s}, state:%s, zpos:%d, deleted:%s (Window)",
+                   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");
+          }
      }
 
-   hwc_window->update_exist = EINA_TRUE;
+   hwc_window->output_hwc->update_changes = EINA_TRUE;
+
+   /* exist tsurface for update hwc_window */
+   hwc_window->tsurface = tsurface;
 
    return EINA_TRUE;
 }
index a7cf7b574695f5b0c06827ae0be80962f4218754..5c1574aa0781059941392544caca506f02b993b4 100644 (file)
@@ -37,6 +37,7 @@ struct _E_Output_Hwc
    E_Hwc_Window_Target *target_hwc_window;
    Eina_Bool            wait_commit;
    Eina_Bool            need_commit;
+   Eina_Bool            update_changes;
    int                  num_visible_windows;
 
    /* variables for pp at hwc_windows policy */
index 2ee3e3bfa85d0f84aa9c3d25b9424718ecd483e0..1a7e30726fb11fe53dba444739e0a5623778a5c5 100644 (file)
@@ -1547,6 +1547,8 @@ e_output_hwc_windows_evaluate(E_Output_Hwc *output_hwc)
         output_hwc->hwc_mode  = hwc_mode;
      }
 
+   if (hwc_mode == E_OUTPUT_HWC_MODE_NONE) output_hwc->update_changes = EINA_TRUE;
+
    ret = EINA_TRUE;
 
 #if DBG_EVALUATE
@@ -1635,6 +1637,7 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
           {
              output_hwc->need_commit = EINA_FALSE;
              target_window->update_exist = EINA_FALSE;
+             output_hwc->update_changes = EINA_FALSE;
 #if DBG_EVALUATE
              ELOGF("HWC-WINS", " No available surface on target_window.", NULL, NULL);
 #endif
@@ -1643,14 +1646,18 @@ e_output_hwc_windows_commit(E_Output_Hwc *output_hwc)
           {
              output_hwc->need_commit = EINA_TRUE;
              target_window->update_exist = EINA_TRUE;
+             output_hwc->update_changes = EINA_TRUE;
 #if DBG_EVALUATE
              ELOGF("HWC-WINS", " Available surface on target_window.", NULL, NULL);
 #endif
           }
      }
 
-   if (output_hwc->need_commit)
+   if (output_hwc->update_changes)
+   //if (output_hwc->need_commit || output_hwc->update_changes)
      {
+        output_hwc->update_changes = EINA_FALSE;
+
         EINA_LIST_FOREACH(output_hwc->hwc_windows, l, hwc_window)
           {
              _e_output_hwc_windows_prepare_commit(output, hwc_window);