e_hwc_windows: don't release buffer to queue if hwc_window is committing buffer 51/236651/1 tizen_5.5_tv
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 05:00:31 +0000 (14:00 +0900)
if committing buffer is released to queue, compositor can render on displaying buffer

Change-Id: Icd8f276325ac643c2724ffdf5321cf6686691caf

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

index 1da5e825c8ed492d63abf9b5c5388d8bcd715b6d..418a77915763f6810df1382e1b001252591055ce 100644 (file)
@@ -1234,6 +1234,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)
 {
@@ -1283,8 +1297,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 8f0609d9cbcab230abd3c3291a3cc4afd0aaa1d6..6a486145a53b1092334fb03fb1e26d0eb50efeec 100644 (file)
@@ -215,6 +215,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 ba689c165936be85bfda3738fe7f0ffd46d024b1..e5d6d0c02717ab438f3fe549f4e182321e67554b 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)