From: Changyeon Lee Date: Fri, 19 Jun 2020 04:46:15 +0000 (+0900) Subject: e_hwc_windows: don't release buffer to queue if hwc_window is committing buffer X-Git-Tag: submit/tizen/20200623.022629^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd99944a2c36b9f18d4a549090a7e49d551c3a29;p=platform%2Fupstream%2Fenlightenment.git e_hwc_windows: don't release buffer to queue if hwc_window is committing buffer if committing buffer is released to queue, compositor can render on displaying buffer Change-Id: Ia300a9a2c021ca9b0b9d886b2ae861ffc448aaf4 --- diff --git a/src/bin/e_hwc_window.c b/src/bin/e_hwc_window.c index bf18d12ba5..0925f8ade8 100644 --- a/src/bin/e_hwc_window.c +++ b/src/bin/e_hwc_window.c @@ -1254,6 +1254,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) { @@ -1303,8 +1317,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) diff --git a/src/bin/e_hwc_window.h b/src/bin/e_hwc_window.h index d53f04f0a2..31388395c6 100644 --- a/src/bin/e_hwc_window.h +++ b/src/bin/e_hwc_window.h @@ -218,6 +218,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); diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index a8062eb322..bb955b142b 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -565,8 +565,8 @@ _e_hwc_windows_target_buffer_fetch(E_Hwc *hwc, Eina_Bool tdm_set) return 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) @@ -614,7 +614,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)