e_hwc_windows: don't release buffer to queue if hwc_window is committing buffer 69/236769/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 19 Jun 2020 04:46:15 +0000 (13:46 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 19 Jun 2020 06:39:34 +0000 (15:39 +0900)
if committing buffer is released to queue, compositor can render on displaying buffer

Change-Id: Ia300a9a2c021ca9b0b9d886b2ae861ffc448aaf4

src/bin/e_hwc_window.c
src/bin/e_hwc_window.h
src/bin/e_hwc_windows.c

index e4ea884e2eacbdf0be2dd1c01d9e507916a174ac..a26a9bddefcc7d13d7b1479cdeecfbf5e7ea6021 100644 (file)
@@ -1235,6 +1235,20 @@ e_hwc_window_info_update(E_Hwc_Window *hwc_window)
    return EINA_FALSE;
 }
 
+EINTERN Eina_Bool
+e_hwc_window_display_or_commit_buffer_check(E_Hwc_Window *hwc_window, tbm_surface_h tsurface)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, EINA_FALSE);
+
+   if (hwc_window->display.buffer.tsurface == tsurface) return EINA_TRUE;
+
+   if (!hwc_window->commit_data) return EINA_FALSE;
+   if (hwc_window->commit_data->buffer.tsurface == tsurface) return EINA_TRUE;
+
+   return EINA_FALSE;
+}
+
 EINTERN Eina_Bool
 e_hwc_window_buffer_fetch(E_Hwc_Window *hwc_window)
 {
@@ -1284,8 +1298,8 @@ e_hwc_window_buffer_fetch(E_Hwc_Window *hwc_window)
         if (tsurface == hwc_window->buffer.tsurface) return EINA_FALSE;
      }
 
-   if (hwc_window->buffer.tsurface && hwc_window->buffer.queue &&
-       hwc_window->buffer.tsurface != hwc_window->display.buffer.tsurface)
+   if ((hwc_window->buffer.tsurface) && (hwc_window->buffer.queue) &&
+       (!e_hwc_window_display_or_commit_buffer_check(hwc_window, hwc_window->buffer.tsurface)))
      {
         queue_buffer = e_hwc_window_queue_buffer_find(hwc_window->buffer.queue, hwc_window->buffer.tsurface);
         if (queue_buffer)
index 724c5541e08e78473d27efcdb101a161769d3cdb..181bef23d38231d72a9948a8a465e62fc07caf99 100644 (file)
@@ -216,6 +216,7 @@ EINTERN void                    e_hwc_window_name_set(E_Hwc_Window *hwc_window);
 EINTERN Eina_Bool               e_hwc_window_set_property(E_Hwc_Window *hwc_window, unsigned int id, const char *name, tdm_value value, Eina_Bool force);
 EINTERN Eina_Bool               e_hwc_window_get_property(E_Hwc_Window *hwc_window, unsigned int id, tdm_value *value);
 EINTERN void                    e_hwc_window_client_type_override(E_Hwc_Window *hwc_window);
+EINTERN Eina_Bool               e_hwc_window_display_or_commit_buffer_check(E_Hwc_Window *hwc_window, tbm_surface_h tsurface);
 
 EINTERN E_Hwc_Window_Hook      *e_hwc_window_hook_add(E_Hwc_Window_Hook_Point hookpoint, E_Hwc_Window_Hook_Cb func, const void *data);
 EINTERN void                    e_hwc_window_hook_del(E_Hwc_Window_Hook *ch);
index d7cc9938ad51c11adc876a04a64fffda540e2b65..828c5e7f69f62ada328b438616f93730c34d758a 100644 (file)
@@ -455,8 +455,8 @@ _e_hwc_windows_target_buffer_fetch(E_Hwc *hwc, Eina_Bool tdm_set)
         tsurface = queue_buffer->tsurface;
         EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, EINA_FALSE);
 
-        if (hwc_window->buffer.tsurface &&
-            hwc_window->buffer.tsurface != hwc_window->display.buffer.tsurface)
+        if ((hwc_window->buffer.tsurface) &&
+            (!e_hwc_window_display_or_commit_buffer_check(hwc_window, hwc_window->buffer.tsurface)))
           {
              queue_buffer = e_hwc_window_queue_buffer_find(hwc_window->buffer.queue, hwc_window->buffer.tsurface);
              if (queue_buffer)
@@ -504,7 +504,7 @@ _e_hwc_windows_target_buffer_fetch(E_Hwc *hwc, Eina_Bool tdm_set)
 
         if (!hwc_window->buffer.tsurface) return EINA_FALSE;
 
-        if (hwc_window->buffer.tsurface != hwc_window->display.buffer.tsurface)
+        if (!e_hwc_window_display_or_commit_buffer_check(hwc_window, hwc_window->buffer.tsurface))
           {
              queue_buffer = e_hwc_window_queue_buffer_find(hwc_window->buffer.queue, hwc_window->buffer.tsurface);
              if (queue_buffer)