From: Changyeon Lee Date: Thu, 13 Aug 2020 10:26:35 +0000 (+0900) Subject: e_hwc_windows: add pp_queue to E_Hwc_Window_Target X-Git-Tag: submit/tizen/20200825.082113~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f84f7308521aec95697131844ad3e48722a1a15;p=platform%2Fupstream%2Fenlightenment.git e_hwc_windows: add pp_queue to E_Hwc_Window_Target if queue of pp is set to E_Hwc_Widnow_Target, E_Hwc_Window_Target set buffer of pp_queue to tdm Change-Id: I4c46bd1ee9e5bebb29ba5157a5223cdcfd8b9556 --- diff --git a/src/bin/e_hwc_window.h b/src/bin/e_hwc_window.h index 30448d5156..ceacee1ab0 100644 --- a/src/bin/e_hwc_window.h +++ b/src/bin/e_hwc_window.h @@ -166,6 +166,9 @@ struct _E_Hwc_Window_Target Eina_Bool skip_surface_set; + E_Hwc_Window_Queue *pp_queue; + struct wl_listener pp_queue_destroy_listener; + E_Egl_Sync *end_render_sync; }; diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index ec7ccbd9aa..c57b31efc4 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -525,6 +525,7 @@ _e_hwc_windows_target_buffer_fetch(E_Hwc *hwc, Eina_Bool tdm_set) Eina_List *rendered_windows = NULL; E_Hwc_Window_Queue_Buffer *queue_buffer = NULL; E_Hwc_Windows_Buffer_Comp_Info *buffer_comp_info; + E_Hwc_Window_Queue *queue; uint32_t n_thw = 0; const Eina_List *l; int i; @@ -548,11 +549,15 @@ _e_hwc_windows_target_buffer_fetch(E_Hwc *hwc, Eina_Bool tdm_set) EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window->queue , EINA_FALSE); - if ((hwc_window->state == E_HWC_WINDOW_STATE_DEVICE) || - (hwc->pp_set && hwc->pp_hwc_window)) + if ((hwc->pp_set) && (target_hwc_window->pp_queue)) + queue = target_hwc_window->pp_queue; + else + queue = hwc_window->queue; + + if (hwc_window->state == E_HWC_WINDOW_STATE_DEVICE) { /* acquire the surface */ - queue_buffer = e_hwc_window_queue_buffer_acquire(hwc_window->queue); + queue_buffer = e_hwc_window_queue_buffer_acquire(queue); if (!queue_buffer) return EINA_FALSE; tsurface = queue_buffer->tsurface; @@ -563,7 +568,7 @@ _e_hwc_windows_target_buffer_fetch(E_Hwc *hwc, Eina_Bool tdm_set) { e_hwc_window_presentation_time_feedback_take(hwc_window, &buffer_comp_info->presentation_container); - e_hwc_window_queue_buffer_release(hwc_window->queue, queue_buffer); + e_hwc_window_queue_buffer_release(queue, queue_buffer); return EINA_FALSE; } @@ -575,7 +580,7 @@ _e_hwc_windows_target_buffer_fetch(E_Hwc *hwc, Eina_Bool tdm_set) e_hwc_window_queue_buffer_release(hwc_window->buffer.queue, queue_buffer); } - e_hwc_window_buffer_set(&hwc_window->buffer, tsurface, hwc_window->queue); + e_hwc_window_buffer_set(&hwc_window->buffer, tsurface, queue); e_hwc_window_info_update(hwc_window); /* the damage isn't supported by hwc extension yet */ @@ -622,7 +627,7 @@ _e_hwc_windows_target_buffer_fetch(E_Hwc *hwc, Eina_Bool tdm_set) } else { - e_hwc_window_queue_clear(hwc_window->queue); + e_hwc_window_queue_clear(queue); if (!hwc_window->buffer.tsurface) return EINA_FALSE; @@ -1027,6 +1032,47 @@ _e_hwc_windows_target_window_render_finished_cb(void *data, Ecore_Fd_Handler *fd return ECORE_CALLBACK_RENEW; } +static void +_e_hwc_windows_target_cb_pp_queue_destroy(struct wl_listener *listener, void *data) +{ + E_Hwc_Window_Target *target_hwc_window = NULL; + + target_hwc_window = container_of(listener, E_Hwc_Window_Target, pp_queue_destroy_listener); + EINA_SAFETY_ON_NULL_RETURN(target_hwc_window); + + if ((E_Hwc_Window_Queue *)data != target_hwc_window->pp_queue) return; + + if (target_hwc_window->pp_queue_destroy_listener.notify) + { + wl_list_remove(&target_hwc_window->pp_queue_destroy_listener.link); + target_hwc_window->pp_queue_destroy_listener.notify = NULL; + } + + target_hwc_window->pp_queue = NULL; +} + +static Eina_Bool +_e_hwc_windows_target_window_pp_queue_set(E_Hwc_Window_Target *target_hwc_window, E_Hwc_Window_Queue *queue) +{ + if (target_hwc_window->pp_queue == queue) + return EINA_TRUE; + + if (target_hwc_window->pp_queue) + { + wl_list_remove(&target_hwc_window->pp_queue_destroy_listener.link); + target_hwc_window->pp_queue_destroy_listener.notify = NULL; + } + + if (queue) + { + wl_signal_add(&queue->destroy_signal, &target_hwc_window->pp_queue_destroy_listener); + target_hwc_window->pp_queue_destroy_listener.notify = _e_hwc_windows_target_cb_pp_queue_destroy; + target_hwc_window->pp_queue = queue; + } + + return EINA_TRUE; +} + static void _e_hwc_windows_target_cb_queue_destroy(struct wl_listener *listener, void *data) {