From: Changyeon Lee Date: Thu, 13 Aug 2020 11:34:41 +0000 (+0900) Subject: e_hwc_windows: refactoring e_hwc_windows_zoom_set/unset X-Git-Tag: submit/tizen/20200825.082113~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d6e1ba0c265bb2b34f0afde367a8ab4cd729f3a;p=platform%2Fupstream%2Fenlightenment.git e_hwc_windows: refactoring e_hwc_windows_zoom_set/unset 1. use E_Hwc_Window_Queue and pp_queue of target_window 2. set pp_hwc_window or target_window buffer to pp_buffer of hwc after hwc_windows are updated 3. set pp_buffer of hwc to tdm_pp_commit and pp destination buffer is enqueued to pp_queue when pp_commit_handler is called 4. target_window set buffer of pp_queue to tdm client_target_buffer Change-Id: Ic85bfd3cf58c6371f9297c9fe1385edd3dcd2380 --- diff --git a/src/bin/e_hwc.c b/src/bin/e_hwc.c index 3726f9be61..2e25e178e2 100644 --- a/src/bin/e_hwc.c +++ b/src/bin/e_hwc.c @@ -447,6 +447,8 @@ e_hwc_del(E_Hwc *hwc) hwc->target_hwc_window = NULL; } + e_comp_wl_buffer_reference(&hwc->pp_buffer_ref, NULL); + _e_hwc_ee_deinit(hwc); if (hwc->commit_fence_fd >= 0) diff --git a/src/bin/e_hwc.h b/src/bin/e_hwc.h index 9b252c8ef9..974a85ebe2 100644 --- a/src/bin/e_hwc.h +++ b/src/bin/e_hwc.h @@ -58,6 +58,8 @@ typedef struct _E_Hwc_Intercept_Hook E_Hwc_Intercept_Hook; #ifndef E_HWC_H #define E_HWC_H +#include "e_hwc_window.h" + struct _E_Hwc_Intercept_Hook { EINA_INLIST; @@ -106,17 +108,19 @@ struct _E_Hwc /* variables for pp at hwc_windows policy */ tdm_pp *tpp; - Eina_List *pp_hwc_window_list; tbm_surface_queue_h pp_tqueue; + E_Hwc_Window_Queue *pp_queue; tbm_surface_h pp_tsurface; Eina_Bool pp_set_info; Eina_Bool pp_set; - Eina_Bool pp_unset; Eina_Bool pp_commit; E_Hwc_Window_Commit_Data *pp_output_commit_data; - Eina_Rectangle pp_rect; Eina_Rectangle pp_src_rect_prev; + Eina_Rectangle pp_src_rect, pp_dst_rect; + Eina_Rectangle pp_set_src_rect, pp_set_dst_rect; E_Hwc_Window *pp_hwc_window; + E_Hwc_Window_Buffer pp_buffer; + E_Comp_Wl_Buffer_Ref pp_buffer_ref; int pp_minw, pp_minh, pp_maxw, pp_maxh; int pp_align; int pp_align_vertical; diff --git a/src/bin/e_hwc_window.c b/src/bin/e_hwc_window.c index cdcb3dbe27..d64fe0fe7c 100644 --- a/src/bin/e_hwc_window.c +++ b/src/bin/e_hwc_window.c @@ -1260,6 +1260,10 @@ e_hwc_window_info_update(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) { + E_Hwc *hwc; + + hwc = hwc_window->hwc; + EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, EINA_FALSE); @@ -1268,6 +1272,9 @@ e_hwc_window_display_or_commit_buffer_check(E_Hwc_Window *hwc_window, tbm_surfac if (!hwc_window->commit_data) return EINA_FALSE; if (hwc_window->commit_data->buffer.tsurface == tsurface) return EINA_TRUE; + if (hwc->pp_buffer.tsurface == tsurface) + return EINA_TRUE; + return EINA_FALSE; } @@ -2521,90 +2528,3 @@ e_hwc_window_fps_get(E_Hwc_Window *hwc_window, double *fps) return EINA_FALSE; } - -EINTERN Eina_Bool -e_hwc_window_pp_rendered_window_update(E_Hwc_Window *hwc_window) -{ - E_Client *ec = NULL; - E_Pointer *pointer = NULL; - - EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE); - - if (hwc_window->is_deleted) return EINA_TRUE; - - ec = hwc_window->ec; - if (!ec) return EINA_TRUE; - - if (e_object_is_del(E_OBJECT(ec))) return EINA_TRUE; - - if (hwc_window->is_cursor) - pointer = e_pointer_get(hwc_window->ec); - - if (e_hwc_window_is_video(hwc_window)) - return EINA_TRUE; - - _e_hwc_window_rendered_window_set(hwc_window, EINA_FALSE); - if (pointer) - e_pointer_hwc_set(pointer, EINA_TRUE); - - return EINA_TRUE; -} - -EINTERN Eina_Bool -e_hwc_window_pp_commit_data_acquire(E_Hwc_Window *hwc_window, Eina_Bool pp_hwc_mode) -{ - E_Hwc_Window_Commit_Data *commit_data = NULL; - - /* if pp_hwc_mode, there is only 1 client state window */ - if (pp_hwc_mode) - { - if (!hwc_window->buffer.tsurface) return EINA_FALSE; - if ((hwc_window->buffer.tsurface == hwc_window->display.buffer.tsurface) && - (!memcmp(&hwc_window->info, &hwc_window->display.info, sizeof(tdm_hwc_window_info)))) - return EINA_FALSE; - if (hwc_window->state != E_HWC_WINDOW_STATE_CLIENT) - { - if (hwc_window->state != E_HWC_WINDOW_STATE_VIDEO) - return EINA_FALSE; - } - - commit_data = _e_hwc_window_commit_data_acquire_device(hwc_window); - EINA_SAFETY_ON_NULL_RETURN_VAL(commit_data, EINA_FALSE); - } - else - { - if (hwc_window->accepted_state == E_HWC_WINDOW_STATE_DEVICE ||/* composited buffer */ - hwc_window->accepted_state == E_HWC_WINDOW_STATE_VIDEO) - { - if (!hwc_window->buffer.tsurface) return EINA_FALSE; - if ((hwc_window->buffer.tsurface == hwc_window->display.buffer.tsurface) && - (!memcmp(&hwc_window->info, &hwc_window->display.info, sizeof(tdm_hwc_window_info)))) - return EINA_FALSE; - - commit_data = _e_hwc_window_commit_data_acquire_device(hwc_window); - EINA_SAFETY_ON_NULL_RETURN_VAL(commit_data, EINA_FALSE); - } - else - { - if (!hwc_window->display.buffer.tsurface) return EINA_FALSE; - - commit_data = E_NEW(E_Hwc_Window_Commit_Data, 1); - EINA_SAFETY_ON_NULL_RETURN_VAL(commit_data, EINA_FALSE); - - e_hwc_window_buffer_set(&commit_data->buffer, NULL, NULL); - } - } - - EHWTRACE("COM ts:%10p ------- {%25s}, state:%s, zpos:%d, deleted:%s", - hwc_window->ec, hwc_window->hwc, hwc_window, - commit_data->buffer.tsurface, - e_hwc_window_name_get(hwc_window), - e_hwc_window_state_string_get(hwc_window->state), - hwc_window->zpos, (hwc_window->is_deleted ? "yes" : "no")); - - e_object_ref(E_OBJECT(hwc_window)); - - hwc_window->commit_data = commit_data; - - return EINA_TRUE; -} diff --git a/src/bin/e_hwc_window.h b/src/bin/e_hwc_window.h index ceacee1ab0..a4fbdebb4e 100644 --- a/src/bin/e_hwc_window.h +++ b/src/bin/e_hwc_window.h @@ -164,8 +164,6 @@ struct _E_Hwc_Window_Target Eina_Bool is_rendering; int max_transition_failures; - Eina_Bool skip_surface_set; - E_Hwc_Window_Queue *pp_queue; struct wl_listener pp_queue_destroy_listener; @@ -232,9 +230,6 @@ EINTERN void e_hwc_window_trace_debug(Eina_Bool onoff); EINTERN void e_hwc_window_commit_data_buffer_dump(E_Hwc_Window *hwc_window); EINTERN Eina_Bool e_hwc_window_fps_get(E_Hwc_Window *hwc_window, double *fps); -EINTERN Eina_Bool e_hwc_window_pp_rendered_window_update(E_Hwc_Window *hwc_window); -EINTERN Eina_Bool e_hwc_window_pp_commit_data_acquire(E_Hwc_Window *hwc_window, Eina_Bool pp_hwc_mode); - EINTERN void e_hwc_window_presentation_time_feedback_present(E_Hwc_Window *hwc_window, uint64_t sequence, uint64_t tv_sec, uint64_t tv_usec); EINTERN void e_hwc_window_presentation_time_feedback_discard(E_Hwc_Window *hwc_window); EINTERN void e_hwc_window_presentation_time_feedback_take(E_Hwc_Window *hwc_window, E_Presentation_Time_Container *container); diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index fdb38cea71..e7e5822520 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -86,8 +86,6 @@ static uint64_t ehws_comp_buffer_info_key; #define EHWS_BUFFER_COMP_INFO_KEY (unsigned long)(&ehws_comp_buffer_info_key) static Eina_Bool _e_hwc_windows_target_window_queue_set(E_Hwc_Window_Target *target_hwc_window); -static Eina_Bool _e_hwc_windows_pp_output_data_commit(E_Hwc *hwc, E_Hwc_Window_Commit_Data *data); -static Eina_Bool _e_hwc_windows_pp_window_commit(E_Hwc *hwc, E_Hwc_Window *hwc_window); static void _e_hwc_windows_wait_commit_set(E_Hwc *hwc, Eina_Bool set); static E_Comp_Wl_Buffer * @@ -139,14 +137,6 @@ _e_hwc_windows_hwc_mode_update(E_Hwc *hwc, int num_client, int num_device, int n E_Hwc_Mode hwc_mode = E_HWC_MODE_NONE; int num_visible = hwc->num_visible_windows; - if (hwc->pp_set && hwc->pp_hwc_window) - { - hwc_mode = E_HWC_MODE_FULL; - ecore_event_add(E_EVENT_COMPOSITOR_DISABLE, NULL, NULL, NULL); - hwc->hwc_mode = hwc_mode; - return hwc_mode; - } - /* check ui windows */ if (!num_visible) hwc_mode = E_HWC_MODE_NONE; @@ -323,21 +313,11 @@ _e_hwc_windows_commit_data_acquire(E_Hwc *hwc) const Eina_List *l; E_Hwc_Window *hwc_window; Eina_Bool ret = EINA_FALSE; - Eina_Bool temp = EINA_FALSE; /* return TRUE when the number of the commit data is more than one */ EINA_LIST_FOREACH(hwc->hwc_windows, l, hwc_window) { - if (hwc->pp_set) - { - if (hwc->pp_hwc_window) - temp = e_hwc_window_pp_commit_data_acquire(hwc_window, EINA_TRUE); - else - temp = e_hwc_window_pp_commit_data_acquire(hwc_window, EINA_FALSE); - } - else - temp = e_hwc_window_commit_data_acquire(hwc_window); - if (!temp) continue; + if (!e_hwc_window_commit_data_acquire(hwc_window)) continue; _e_hwc_windows_presentation_feedback_take(hwc_window); @@ -390,16 +370,7 @@ _e_hwc_windows_offscreen_commit(E_Hwc *hwc) { e_hwc_window_presentation_time_feedback_discard(hwc_window_target); - if (hwc->pp_set) - { - if (hwc->pp_hwc_window) - ret = e_hwc_window_pp_commit_data_acquire(hwc_window_target, EINA_TRUE); - else - ret = e_hwc_window_pp_commit_data_acquire(hwc_window_target, EINA_FALSE); - } - else - ret = e_hwc_window_commit_data_acquire(hwc_window_target); - + ret = e_hwc_window_commit_data_acquire(hwc_window_target); if (ret) { /* it is possible that other hwc_window is freed in @@ -415,15 +386,7 @@ _e_hwc_windows_offscreen_commit(E_Hwc *hwc) { if (hwc_window->is_target) continue; - if (hwc->pp_set) - { - if (hwc->pp_hwc_window) - ret = e_hwc_window_pp_commit_data_acquire(hwc_window, EINA_TRUE); - else - ret = e_hwc_window_pp_commit_data_acquire(hwc_window, EINA_FALSE); - } - else - ret = e_hwc_window_commit_data_acquire(hwc_window); + ret = e_hwc_window_commit_data_acquire(hwc_window); if (!ret) continue; EHWSTRACE("!!!!!!!! HWC OffScreen Commit !!!!!!!!", NULL, hwc); @@ -1477,235 +1440,61 @@ fail: return NULL; } -static E_Hwc_Window * -_e_hwc_windows_pp_window_get(E_Hwc *hwc, tbm_surface_h tsurface) -{ - Eina_List *l; - E_Hwc_Window *hwc_window = NULL; - - EINA_LIST_FOREACH(hwc->pp_hwc_window_list, l, hwc_window) - { - if (!hwc_window) continue; - if (!hwc_window->commit_data) continue; - - if (hwc_window->commit_data->buffer.tsurface == tsurface) - return hwc_window; - } - - return NULL; -} - static void -_e_hwc_windows_pp_output_commit_handler(tdm_hwc *thwc, unsigned int sequence, - unsigned int tv_sec, unsigned int tv_usec, - void *user_data) -{ - E_Hwc *hwc; - E_Hwc_Window_Commit_Data *data = NULL; - E_Output *output = NULL; - - EINA_SAFETY_ON_NULL_RETURN(user_data); - - hwc = user_data; - - _e_hwc_windows_commit_data_release(hwc, sequence, tv_sec, tv_usec); - _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE); - - /* layer already resetted */ - if (hwc->pp_output_commit_data) - { - data = hwc->pp_output_commit_data; - hwc->pp_output_commit_data = NULL; - - /* if pp_set is false, do not deal with pending list */ - if (!hwc->pp_set) - { - if (hwc->pp_tsurface) - tbm_surface_internal_unref(hwc->pp_tsurface); - - hwc->pp_tsurface = data->buffer.tsurface; - _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE); - - E_FREE(data); - - return; - } - - if (hwc->pp_tqueue && hwc->pp_tsurface) - { - /* release and unref the current pp surface on the hwc */ - tbm_surface_queue_release(hwc->pp_tqueue, hwc->pp_tsurface); - tbm_surface_internal_unref(hwc->pp_tsurface); - } - - /* set the new pp surface to the hwc */ - hwc->pp_tsurface = data->buffer.tsurface; - - E_FREE(data); - } - - EHWSTRACE("!!!!!!!! HWC PP Output Commit Handler !!!!!!!!", NULL, hwc); - EHWSTRACE(" pp_tsurface(%p)", NULL, hwc, hwc->pp_tsurface); - - output = hwc->output; - if (e_output_dpms_get(output)) - return; -} - -static Eina_Bool -_e_hwc_windows_pp_output_data_commit(E_Hwc *hwc, E_Hwc_Window_Commit_Data *data) +_e_hwc_windows_pp_commit_handler(tdm_pp *pp, tbm_surface_h tsurface_src, tbm_surface_h tsurface_dst, void *user_data) { - tdm_error terror; - tdm_region fb_damage; - E_Output *output; - - /* the damage isn't supported by hwc extension yet */ - memset(&fb_damage, 0, sizeof(fb_damage)); - - EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE); - - output = hwc->output; - - if (e_output_dpms_get(output)) - goto fail; - - EHWSTRACE("!!!!!!!! HWC PP Output Commit !!!!!!!!", NULL, hwc); - EHWSTRACE(" tsurface(%p)", NULL, hwc, data->buffer.tsurface); - - /* no need to pass composited_wnds list because smooth transition isn't - * used in this case */ - terror = tdm_hwc_set_client_target_buffer(hwc->thwc, data->buffer.tsurface, fb_damage); - if (terror != TDM_ERROR_NONE) - { - EHWSERR("fail to tdm_hwc_set_client_target_buffer", hwc); - goto fail; - } - - terror = tdm_hwc_accept_validation(hwc->thwc); - if (terror != TDM_ERROR_NONE) - { - EHWSERR("fail to tdm_hwc_accept_validation", hwc); - goto fail; - } - - terror = tdm_hwc_commit(hwc->thwc, 0, _e_hwc_windows_pp_output_commit_handler, hwc); - if (terror != TDM_ERROR_NONE) - { - EHWSERR("fail to tdm_hwc_commit", hwc); - /* send tizen_hwc_commit feedback discarded */ - e_comp_wl_tizen_hwc_discarded(); - goto fail; - } - - /* send tizen_hwc_commit feedback committed */ - e_comp_wl_tizen_hwc_committed(); - - hwc->pp_output_commit_data = data; - - return EINA_TRUE; - -fail: - tbm_surface_internal_unref(data->buffer.tsurface); - tbm_surface_queue_release(hwc->pp_tqueue, data->buffer.tsurface); - E_FREE(data); + E_Hwc *hwc = NULL; + E_Hwc_Window *hwc_window = NULL; + E_Hwc_Window_Queue_Buffer *queue_buffer; - _e_hwc_windows_commit_data_release(hwc, 0, 0, 0); - _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE); + hwc = (E_Hwc *)user_data; + EINA_SAFETY_ON_NULL_RETURN(hwc); - return EINA_FALSE; -} + EHWSTRACE("!!!!!!!! HWC PP Commit Handler !!!!!!!!", NULL, hwc); + EHWSTRACE("PP DON tsurface src:%p dst:%p", NULL, hwc, tsurface_src, tsurface_dst); -static Eina_Bool -_e_hwc_windows_pp_output_commit(E_Hwc *hwc, tbm_surface_h tsurface) -{ - tbm_surface_h pp_tsurface = NULL; - tbm_error_e tbm_err; - E_Hwc_Window_Commit_Data *data = NULL; + hwc->pp_commit = EINA_FALSE; - tbm_err = tbm_surface_queue_enqueue(hwc->pp_tqueue, tsurface); - if (tbm_err != TBM_ERROR_NONE) - { - EHWSERR("fail tbm_surface_queue_enqueue", hwc); - goto fail; - } + hwc_window = (E_Hwc_Window *)hwc->target_hwc_window; + EINA_SAFETY_ON_FALSE_RETURN(hwc_window); - tbm_err = tbm_surface_queue_acquire(hwc->pp_tqueue, &pp_tsurface); - if (tbm_err != TBM_ERROR_NONE) + queue_buffer = e_hwc_window_queue_buffer_find(hwc->pp_queue, tsurface_dst); + if (!queue_buffer) { - EHWSERR("fail tbm_surface_queue_acquire", hwc); - goto fail; + ERR("fail to e_hwc_window_queue_buffer_find"); + goto done; } - data = E_NEW(E_Hwc_Window_Commit_Data, 1); - if (!data) goto fail; - data->buffer.tsurface = pp_tsurface; - tbm_surface_internal_ref(data->buffer.tsurface); + if (!e_hwc_window_queue_buffer_enqueue(hwc->pp_queue, queue_buffer)) + ERR("fail to e_hwc_window_queue_buffer_enqueue"); - if (!_e_hwc_windows_pp_output_data_commit(hwc, data)) + /* source tsurface buffer queue */ + if (hwc->pp_buffer.queue) { - EHWSERR("fail to _e_hwc_windows_pp_output_data_commit", hwc); - return EINA_FALSE; + queue_buffer = e_hwc_window_queue_buffer_find(hwc->pp_buffer.queue, + hwc->pp_buffer.tsurface); + if (queue_buffer) + e_hwc_window_queue_buffer_release(hwc->pp_buffer.queue, queue_buffer); } - return EINA_TRUE; - -fail: - tbm_surface_queue_release(hwc->pp_tqueue, tsurface); - if (pp_tsurface && pp_tsurface != tsurface) - tbm_surface_queue_release(hwc->pp_tqueue, pp_tsurface); + e_comp_wl_buffer_reference(&hwc->pp_buffer_ref, NULL); - return EINA_FALSE; -} - -static void -_e_hwc_windows_pp_commit_handler(tdm_pp *pp, tbm_surface_h tsurface_src, tbm_surface_h tsurface_dst, void *user_data) -{ - E_Output *output = NULL; - E_Hwc *hwc = NULL; - E_Hwc_Window *hwc_window = NULL; - - hwc = (E_Hwc *)user_data; - EINA_SAFETY_ON_NULL_RETURN(hwc); - hwc_window = _e_hwc_windows_pp_window_get(hwc, tsurface_src); - EINA_SAFETY_ON_NULL_RETURN(hwc_window); - - hwc->pp_hwc_window_list = eina_list_remove(hwc->pp_hwc_window_list, hwc_window); - - EHWSTRACE("!!!!!!!! HWC PP Commit Handler !!!!!!!!", NULL, hwc); - EHWSTRACE(" tsurface src(%p) dst(%p)", NULL, hwc, tsurface_src, tsurface_dst); - - hwc->pp_commit = EINA_FALSE; +done: + tbm_surface_internal_unref(tsurface_src); + tbm_surface_internal_unref(tsurface_dst); - /* if pp_set is false, skip the commit */ if (!hwc->pp_set) { if (hwc->tpp) { + EHWSINF("PP Destroy tdm_pp:%p", NULL, hwc, hwc->tpp); + tdm_pp_destroy(hwc->tpp); hwc->tpp = NULL; } - _e_hwc_windows_commit_data_release(hwc, 0, 0, 0); - _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE); - goto done; + e_hwc_window_buffer_set(&hwc->pp_buffer, NULL, NULL); } - - output = hwc->output; - if (e_output_dpms_get(output)) - { - tbm_surface_queue_release(hwc->pp_tqueue, tsurface_dst); - _e_hwc_windows_commit_data_release(hwc, 0, 0, 0); - _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE); - - goto done; - } - - if (!_e_hwc_windows_pp_output_commit(hwc, tsurface_dst)) - EHWSERR("fail to _e_hwc_windows_pp_output_commit", hwc); - -done: - tbm_surface_internal_unref(tsurface_src); - tbm_surface_internal_unref(tsurface_dst); } static Eina_Bool @@ -1716,6 +1505,10 @@ _e_hwc_windows_pp_info_set(E_Hwc *hwc, tbm_surface_h src, tbm_surface_h dst, tdm_error ret = TDM_ERROR_NONE; unsigned int aligned_width_src = 0, aligned_width_dst = 0; + if ((!memcmp(&hwc->pp_set_src_rect, src_rect, sizeof(Eina_Rectangle))) && + (!memcmp(&hwc->pp_set_dst_rect, dst_rect, sizeof(Eina_Rectangle)))) + return EINA_TRUE; + aligned_width_src = _e_hwc_windows_aligned_width_get(src); EINA_SAFETY_ON_FALSE_RETURN_VAL(aligned_width_src != 0, EINA_FALSE); @@ -1755,186 +1548,6 @@ _e_hwc_windows_pp_info_set(E_Hwc *hwc, tbm_surface_h src, tbm_surface_h dst, return EINA_TRUE; } -static Eina_Bool -_e_hwc_pp_windows_info_set(E_Hwc *hwc, E_Hwc_Window *hwc_window, tbm_surface_h dst_tsurface) -{ - tbm_surface_h src_tsurface = hwc_window->commit_data->buffer.tsurface; - Eina_Rectangle dst_rect; - - EINA_SAFETY_ON_FALSE_RETURN_VAL(hwc->pp_set_info == EINA_TRUE, EINA_TRUE); - - dst_rect.x = 0; - dst_rect.y = 0; - dst_rect.w = tbm_surface_get_width(dst_tsurface); - dst_rect.h = tbm_surface_get_height(dst_tsurface); - - if (_e_hwc_windows_pp_info_set(hwc, src_tsurface, dst_tsurface, &hwc->pp_rect, &dst_rect) != EINA_TRUE) - { - EHWSERR("fail pp info set", hwc); - return EINA_FALSE; - } - hwc->pp_set_info = EINA_FALSE; - - return EINA_TRUE; -} - -static Eina_Bool -_e_hwc_windows_pp_window_commit(E_Hwc *hwc, E_Hwc_Window *hwc_window) -{ - E_Output *output = NULL; - tbm_surface_h pp_tsurface = NULL; - tbm_error_e tbm_err = TBM_ERROR_NONE; - tdm_error terror = TDM_ERROR_NONE; - E_Hwc_Window_Commit_Data *commit_data = hwc_window->commit_data; - EINA_SAFETY_ON_NULL_RETURN_VAL(commit_data, EINA_FALSE); - - tbm_surface_h tsurface = commit_data->buffer.tsurface; - - EHWSTRACE("!!!!!!!! HWC PP Commit !!!!!!!!", NULL, hwc); - EHWSTRACE(" tsurface(%p) tqueue(%p) wl_buffer(%p) data(%p)", - NULL, hwc, commit_data->buffer.tsurface, hwc->pp_tqueue, - commit_data->buffer_ref.buffer ? commit_data->buffer_ref.buffer->resource : NULL, commit_data); - - output = hwc->output; - if (e_output_dpms_get(output)) - return EINA_FALSE; - - tbm_err = tbm_surface_queue_dequeue(hwc->pp_tqueue, &pp_tsurface); - if (tbm_err != TBM_ERROR_NONE) - { - EHWSERR("fail tbm_surface_queue_dequeue", hwc); - return EINA_FALSE; - } - - if (!_e_hwc_pp_windows_info_set(hwc, hwc_window, pp_tsurface)) - { - EHWSERR("fail _e_hwc_windows_info_set", hwc); - goto pp_fail; - } - - tbm_surface_internal_ref(pp_tsurface); - tbm_surface_internal_ref(commit_data->buffer.tsurface); - terror = tdm_pp_attach(hwc->tpp, commit_data->buffer.tsurface, pp_tsurface); - EINA_SAFETY_ON_FALSE_GOTO(terror == TDM_ERROR_NONE, attach_fail); - - hwc->pp_hwc_window_list = eina_list_append(hwc->pp_hwc_window_list, hwc_window); - - terror = tdm_pp_commit(hwc->tpp); - EINA_SAFETY_ON_FALSE_GOTO(terror == TDM_ERROR_NONE, commit_fail); - - _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE); - hwc->pp_commit = EINA_TRUE; - - return EINA_TRUE; - -commit_fail: - hwc->pp_hwc_window_list = eina_list_remove(hwc->pp_hwc_window_list, hwc_window); -attach_fail: - tbm_surface_internal_unref(pp_tsurface); - tbm_surface_internal_unref(tsurface); -pp_fail: - tbm_surface_queue_release(hwc->pp_tqueue, pp_tsurface); - - EHWSERR("failed _e_hwc_windows_pp_data_commit", hwc); - - return EINA_FALSE; -} - -static E_Hwc_Window * -_e_hwc_windows_pp_get_hwc_window_for_zoom(E_Hwc *hwc) -{ - E_Hwc_Window_Target *target_hwc_window = NULL; - E_Hwc_Window *hwc_window_for_zoom = NULL; - int w, h; - - e_output_size_get(hwc->output, &w, &h); - - if (hwc->pp_hwc_window) - { - if (tbm_surface_get_width(hwc->pp_hwc_window->buffer.tsurface) != w || - tbm_surface_get_height(hwc->pp_hwc_window->buffer.tsurface) != h) - return NULL; - - hwc_window_for_zoom = hwc->pp_hwc_window; - } - else - { - target_hwc_window = hwc->target_hwc_window; - EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, NULL); - - hwc_window_for_zoom = (E_Hwc_Window *)target_hwc_window; - if (!hwc_window_for_zoom->buffer.tsurface) return NULL; - } - - return hwc_window_for_zoom; -} - -static Eina_Bool -_e_hwc_windows_pp_commit(E_Hwc *hwc) -{ - E_Hwc_Window_Commit_Data *commit_data = NULL; - E_Hwc_Window *hwc_window = NULL; - tdm_error terror = TDM_ERROR_NONE; - - EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(hwc->pp_tqueue, EINA_FALSE); - - hwc_window = _e_hwc_windows_pp_get_hwc_window_for_zoom(hwc); - EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE); - - commit_data = hwc_window->commit_data; - if (!commit_data || !commit_data->buffer.tsurface) - { - EHWSINF("no commit_data for pp. execute commit", NULL, hwc); - EHWSTRACE("======= HWC Accept Validation no pp commit data =======", NULL, hwc); - terror = tdm_hwc_accept_validation(hwc->thwc); - if (terror != TDM_ERROR_NONE) - { - EHWSERR("fail to tdm_hwc_accept_validation", hwc); - return EINA_FALSE; - } - - _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE); - - terror = tdm_hwc_commit(hwc->thwc, 0, _e_hwc_windows_commit_handler, hwc); - if (terror != TDM_ERROR_NONE) - { - _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE); - EHWSERR("fail to tdm_hwc_commit", hwc); - /* send tizen_hwc_commit feedback discarded */ - e_comp_wl_tizen_hwc_discarded(); - return EINA_FALSE; - } - - /* send tizen_hwc_commit feedback committed */ - e_comp_wl_tizen_hwc_committed(); - - hwc->wait_commit = EINA_TRUE; - - return EINA_TRUE; - } - - if (!tbm_surface_queue_can_dequeue(hwc->pp_tqueue, 0)) - { - EHWSTRACE("PP Commit Can Dequeue failed tsurface(%p) tqueue(%p) wl_buffer(%p) data(%p)", - NULL, hwc, commit_data->buffer.tsurface, hwc->pp_tqueue, - commit_data->buffer_ref.buffer ? commit_data->buffer_ref.buffer->resource : NULL, commit_data); - - _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE); - - return EINA_TRUE; - } - - if (!_e_hwc_windows_pp_window_commit(hwc, hwc_window)) - { - EHWSERR("fail _e_hwc_windows_pp_data_commit", hwc); - e_hwc_window_commit_data_release(hwc_window); - return EINA_FALSE; - } - - return EINA_TRUE; -} - static Eina_Bool _e_hwc_windows_commit_handler_timeout(void *data) { @@ -1944,10 +1557,7 @@ _e_hwc_windows_commit_handler_timeout(void *data) EHWSERR("Timeout wait commit", hwc); - if (hwc->pp_output_commit_data) - _e_hwc_windows_pp_output_commit_handler(hwc->thwc, 0, 0, 0, hwc); - else - _e_hwc_windows_commit_handler(hwc->thwc, 0, 0, 0, hwc); + _e_hwc_windows_commit_handler(hwc->thwc, 0, 0, 0, hwc); hwc->wait_commit = EINA_FALSE; hwc->commit_handler_timer = NULL; @@ -2497,50 +2107,11 @@ static Eina_Bool _e_hwc_windows_device_state_available_update(E_Hwc *hwc) { Eina_Bool available = EINA_TRUE; - E_Hwc_Window *hwc_window = NULL; - Eina_List *visible_windows = NULL; - int w, h; - - e_output_size_get(hwc->output, &w, &h); /* make the full_gl_composite when the zoom is enabled */ if (hwc->pp_set) { available = EINA_FALSE; - - if (hwc->num_visible_windows > 1 || hwc->pp_set_info || e_comp->nocomp_override) - { - hwc->pp_hwc_window = NULL; - } - else - { - /* if there is only 1 visible window, set to pp_hwc_window*/ - visible_windows = hwc->visible_windows; - - if (eina_list_count(visible_windows) == 1) - hwc_window = eina_list_nth(visible_windows, 0); - - if (hwc_window == NULL) - hwc->pp_hwc_window = NULL; - else - { - if (tbm_surface_get_width(hwc_window->buffer.tsurface) != w || - tbm_surface_get_height(hwc_window->buffer.tsurface) != h) - hwc->pp_hwc_window = NULL; - else - hwc->pp_hwc_window = hwc_window; - } - } - - goto finish; - } - - /* make the full_gl_composite when the zoom is disabled */ - if (hwc->pp_unset) - { - available = EINA_FALSE; - hwc->pp_hwc_window = NULL; - goto finish; } @@ -2566,6 +2137,45 @@ finish: return EINA_TRUE; } +static void +_e_hwc_windows_pp_hwc_window_update(E_Hwc *hwc) +{ + E_Hwc_Window *hwc_window; + int w, h; + + e_output_size_get(hwc->output, &w, &h); + + if (hwc->num_visible_windows != 1) + goto clear; + + if (e_hwc_deactive_get(hwc)) + goto clear; + + hwc_window = eina_list_nth(hwc->visible_windows, 0); + if (!hwc_window) + goto clear; + + if ((tbm_surface_get_width(hwc_window->buffer.tsurface)) != w || + (tbm_surface_get_height(hwc_window->buffer.tsurface)) != h) + goto clear; + + if (!hwc_window->device_state_available) + goto clear; + + if (hwc->pp_hwc_window != hwc_window) + EHWSTRACE("Set pp_hwc_window:%p", NULL, hwc, hwc_window); + + hwc->pp_hwc_window = hwc_window; + + return; + +clear: + if (hwc->pp_hwc_window) + EHWSTRACE("Unset pp_hwc_window", NULL, hwc); + + hwc->pp_hwc_window = NULL; +} + /* check if there is a need to update the output */ static Eina_Bool _e_hwc_windows_changes_update(E_Hwc *hwc) @@ -2625,6 +2235,9 @@ _e_hwc_windows_changes_update(E_Hwc *hwc) update_changes = EINA_TRUE; } + if (hwc->pp_set) + _e_hwc_windows_pp_hwc_window_update(hwc); + /* update the states of the visible windows when there is something to update */ if (update_changes) { @@ -2677,10 +2290,7 @@ _e_hwc_windows_evaluate(E_Hwc *hwc) if (e_hwc_window_is_target(hwc_window)) continue; e_hwc_window_constraints_update(hwc_window); - if (hwc->pp_hwc_window == hwc_window) - e_hwc_window_pp_rendered_window_update(hwc_window); - else - e_hwc_window_rendered_window_update(hwc_window); + e_hwc_window_rendered_window_update(hwc_window); if (hwc_window->state == E_HWC_WINDOW_STATE_CLIENT) num_client++; if (hwc_window->state == E_HWC_WINDOW_STATE_DEVICE) num_device++; @@ -2709,9 +2319,8 @@ _e_hwc_windows_evaluate(E_Hwc *hwc) } /* skip the target_buffer when the window is on trainsition of the composition */ - if (hwc_mode != E_HWC_MODE_FULL && _e_hwc_windows_transition_check(hwc)) + if ((hwc_mode != E_HWC_MODE_FULL) && (_e_hwc_windows_transition_check(hwc)) && (!hwc->pp_set)) { - /* if pp set enabled, buffer set to tdm after pp done */ _e_hwc_windows_target_window_buffer_skip(hwc); if (!hwc->transition) @@ -2987,6 +2596,52 @@ _e_hwc_windows_sw_copy(E_Hwc *hwc, tbm_surface_h src_tsurface, tbm_surface_h dst dst_pos.x, dst_pos.y, dst_pos.w, dst_pos.h); } +static void +_e_hwc_windows_pp_rect_set(E_Hwc *hwc, Eina_Rectangle *src_rect, Eina_Rectangle *dst_rect) +{ + memcpy(&hwc->pp_src_rect, src_rect, sizeof(Eina_Rectangle)); + memcpy(&hwc->pp_dst_rect, dst_rect, sizeof(Eina_Rectangle)); +} + +static Eina_Bool +_e_hwc_windows_pp_buffer_update(E_Hwc *hwc) +{ + E_Hwc_Window_Queue_Buffer *queue_buffer; + E_Hwc_Window *hwc_window; + + EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE); + + if (hwc->pp_hwc_window) + { + hwc_window = hwc->pp_hwc_window; + + e_hwc_window_queue_clear(((E_Hwc_Window *)hwc->target_hwc_window)->queue); + } + else + hwc_window = (E_Hwc_Window *)hwc->target_hwc_window; + + if ((hwc_window->is_target) && ((E_Hwc_Window *)hwc->target_hwc_window == hwc_window)) + { + queue_buffer = e_hwc_window_queue_buffer_acquire(hwc_window->queue); + if (!queue_buffer) return EINA_FALSE; + + e_hwc_window_buffer_set(&hwc->pp_buffer, queue_buffer->tsurface, hwc_window->queue); + } + else + { + if (hwc_window->buffer.tsurface == hwc->pp_buffer.tsurface) + return EINA_FALSE; + + e_hwc_window_buffer_set(&hwc->pp_buffer, + hwc_window->buffer.tsurface, hwc_window->buffer.queue); + + if (!e_hwc_window_is_target(hwc_window)) + e_comp_wl_buffer_reference(&hwc->pp_buffer_ref, _e_hwc_windows_comp_wl_buffer_get(hwc_window)); + } + + return EINA_TRUE; +} + static Eina_Bool _e_hwc_windows_mirror_changes_update(E_Hwc *hwc) { @@ -3416,7 +3071,8 @@ e_hwc_windows_render(E_Hwc *hwc) target_window = (E_Hwc_Window *)target_hwc_window; EINA_SAFETY_ON_NULL_RETURN_VAL(target_window->queue, EINA_FALSE); - if (e_hwc_window_state_get(target_window) == E_HWC_WINDOW_STATE_NONE) + if ((e_hwc_window_state_get(target_window) == E_HWC_WINDOW_STATE_NONE) || + ((hwc->pp_set) && (hwc->pp_hwc_window))) { /* evas_norender is needed for preventing memory leak because evas_object is freed in manual render @@ -3524,6 +3180,77 @@ clean: if (release_fences) free(release_fences); } +static Eina_Bool +_e_hwc_windows_pp_commit(E_Hwc *hwc) +{ + E_Output *output = NULL; + E_Hwc_Window_Queue_Buffer *queue_buffer = NULL; + tdm_error terror = TDM_ERROR_NONE; + + EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE); + + if (hwc->pp_commit) return EINA_TRUE; + + output = hwc->output; + if (e_output_dpms_get(output)) + return EINA_TRUE; + + if (!e_hwc_window_queue_buffer_can_dequeue(hwc->pp_queue)) return EINA_TRUE; + + if (!_e_hwc_windows_pp_buffer_update(hwc)) return EINA_TRUE; + + queue_buffer = e_hwc_window_queue_buffer_dequeue(hwc->pp_queue); + if (!queue_buffer) + { + EHWSERR("fail e_hwc_window_queue_buffer_dequeue", hwc); + return EINA_FALSE; + } + + if (!_e_hwc_windows_pp_info_set(hwc, hwc->pp_buffer.tsurface, + queue_buffer->tsurface, &hwc->pp_src_rect, &hwc->pp_dst_rect)) + { + EHWSERR("fail _e_hwc_windows_pp_info_set", hwc); + goto pp_fail; + } + + tbm_surface_internal_ref(queue_buffer->tsurface); + tbm_surface_internal_ref(hwc->pp_buffer.tsurface); + terror = tdm_pp_attach(hwc->tpp, hwc->pp_buffer.tsurface, queue_buffer->tsurface); + EINA_SAFETY_ON_FALSE_GOTO(terror == TDM_ERROR_NONE, attach_fail); + + EHWSTRACE("!!!!!!!! HWC PP Commit !!!!!!!!", NULL, hwc); + EHWSTRACE("PP COM tsurface:%p tqueue:%p pp_hwc_window:%p", NULL, hwc, + hwc->pp_buffer.tsurface, hwc->pp_tqueue, hwc->pp_hwc_window); + + terror = tdm_pp_commit(hwc->tpp); + EINA_SAFETY_ON_FALSE_GOTO(terror == TDM_ERROR_NONE, commit_fail); + + hwc->pp_commit = EINA_TRUE; + + return EINA_TRUE; + +commit_fail: +attach_fail: + tbm_surface_internal_unref(queue_buffer->tsurface); + tbm_surface_internal_unref(hwc->pp_buffer.tsurface); +pp_fail: + if (queue_buffer) + e_hwc_window_queue_buffer_release(hwc->pp_queue, queue_buffer); + + if ((hwc->pp_buffer.tsurface) && (hwc->pp_buffer.queue)) + { + queue_buffer = e_hwc_window_queue_buffer_find(hwc->pp_buffer.queue, hwc->pp_buffer.tsurface); + if (queue_buffer) + e_hwc_window_queue_buffer_release(hwc->pp_buffer.queue, queue_buffer); + } + + EHWSERR("failed _e_hwc_windows_pp_data_commit", hwc); + + hwc->pp_commit = EINA_FALSE; + + return EINA_FALSE; +} + EINTERN Eina_Bool e_hwc_windows_commit(E_Hwc *hwc, E_Output_Display_Mode display_mode) { @@ -3572,10 +3299,17 @@ e_hwc_windows_commit(E_Hwc *hwc, E_Output_Display_Mode display_mode) } } - if (hwc->hwc_mode != E_HWC_MODE_FULL) { - if (!_e_hwc_windows_target_buffer_prepared(hwc)) - return EINA_TRUE; - } + if (hwc->pp_set) + { + e_output_zoom_rotating_check(output); + _e_hwc_windows_pp_commit(hwc); + } + + if (hwc->hwc_mode != E_HWC_MODE_FULL) + { + if (!_e_hwc_windows_target_buffer_prepared(hwc)) + return EINA_TRUE; + } if (output->dpms == E_OUTPUT_DPMS_OFF) { @@ -3586,59 +3320,42 @@ e_hwc_windows_commit(E_Hwc *hwc, E_Output_Display_Mode display_mode) if (!_e_hwc_windows_commit_data_acquire(hwc)) return EINA_TRUE; - if (hwc->pp_unset) - hwc->pp_unset = EINA_FALSE; + EHWSTRACE("!!!!!!!! HWC Commit !!!!!!!!", NULL, hwc); + _e_hwc_windows_update_fps(hwc); - if (hwc->pp_set) + _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE); + + error = tdm_hwc_commit(hwc->thwc, 0, _e_hwc_windows_commit_handler, hwc); + if (error != TDM_ERROR_NONE) { - e_output_zoom_rotating_check(output); - _e_hwc_windows_update_fps(hwc); - if (!_e_hwc_windows_pp_commit(hwc)) - { - EHWSERR("_e_hwc_windows_pp_commit failed.", hwc); - goto fail; - } + EHWSERR("tdm_hwc_commit failed.", hwc); + _e_hwc_windows_commit_handler(hwc->thwc, 0, 0, 0, hwc); + goto fail; } - else - { - EHWSTRACE("!!!!!!!! HWC Commit !!!!!!!!", NULL, hwc); - _e_hwc_windows_update_fps(hwc); - - _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE); - - error = tdm_hwc_commit(hwc->thwc, 0, _e_hwc_windows_commit_handler, hwc); - if (error != TDM_ERROR_NONE) - { - EHWSERR("tdm_hwc_commit failed.", hwc); - /* send tizen_hwc_commit feedback discarded */ - e_comp_wl_tizen_hwc_discarded(); - _e_hwc_windows_commit_handler(hwc->thwc, 0, 0, 0, hwc); - goto fail; - } - if (e_hwc_windows_fence_enabled_get(hwc)) + if (e_hwc_windows_fence_enabled_get(hwc)) + { + error = tdm_hwc_get_commit_fence(hwc->thwc, &commit_fence_fd); + if (error == TDM_ERROR_NONE) { - error = tdm_hwc_get_commit_fence(hwc->thwc, &commit_fence_fd); - if (error == TDM_ERROR_NONE) - { - if (hwc->commit_fence_fd >= 0) - close(hwc->commit_fence_fd); - - hwc->commit_fence_fd = commit_fence_fd; + if (hwc->commit_fence_fd >= 0) + close(hwc->commit_fence_fd); - _e_hwc_windows_release_fence_fd_update(hwc); - } - else - EHWSERR("tdm_hwc_get_commit_sync_fence_fd failed.", hwc); + hwc->commit_fence_fd = commit_fence_fd; + _e_hwc_windows_release_fence_fd_update(hwc); } - - /* send tizen_hwc_commit feedback committed */ - e_comp_wl_tizen_hwc_committed(); + else + EHWSERR("tdm_hwc_get_commit_sync_fence_fd failed.", hwc); } + /* send tizen_hwc_commit feedback committed */ + e_comp_wl_tizen_hwc_committed(); + return EINA_TRUE; fail: + /* send tizen_hwc_commit feedback discarded */ + e_comp_wl_tizen_hwc_discarded(); _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE); return EINA_FALSE; @@ -3730,11 +3447,12 @@ e_hwc_windows_zoom_set(E_Hwc *hwc, Eina_Rectangle *rect) E_Comp_Screen *e_comp_screen = NULL; tdm_error ret = TDM_ERROR_NONE; int w, h; + Eina_Rectangle dst_rect; EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE); - if ((hwc->pp_rect.x == rect->x) && (hwc->pp_rect.y == rect->y) && - (hwc->pp_rect.w == rect->w) && (hwc->pp_rect.h == rect->h)) + if ((hwc->pp_src_rect.x == rect->x) && (hwc->pp_src_rect.y == rect->y) && + (hwc->pp_src_rect.w == rect->w) && (hwc->pp_src_rect.h == rect->h)) return EINA_TRUE; e_comp_screen = e_comp->e_comp_screen; @@ -3759,6 +3477,8 @@ e_hwc_windows_zoom_set(E_Hwc *hwc, Eina_Rectangle *rect) &hwc->pp_maxw, &hwc->pp_maxh, &hwc->pp_align); tdm_display_get_pp_preferred_align_vertical(e_comp_screen->tdisplay, &hwc->pp_align_vertical); + + EHWSINF("PP Create tdm_pp:%p", NULL, hwc, hwc->tpp); } if (!hwc->pp_tqueue) @@ -3771,24 +3491,28 @@ e_hwc_windows_zoom_set(E_Hwc *hwc, Eina_Rectangle *rect) EHWSERR("fail tbm_surface_queue_create", hwc); goto fail; } + + hwc->pp_queue = e_hwc_window_queue_get(hwc->pp_tqueue); + if (!hwc->pp_queue) + { + EHWSERR("fail e_hwc_window_queue_get", hwc); + goto fail; + } + + EHWSINF("PP Create pp_tqueue:%p", NULL, hwc, hwc->pp_tqueue); } + _e_hwc_windows_target_window_pp_queue_set(hwc->target_hwc_window, hwc->pp_queue); + _e_hwc_windows_target_window_force_render(hwc->target_hwc_window); hwc->pp_set = EINA_TRUE; - hwc->pp_set_info = EINA_TRUE; - hwc->pp_unset = EINA_FALSE; - hwc->pp_hwc_window = NULL; - hwc->target_hwc_window->skip_surface_set = EINA_TRUE; } - hwc->pp_rect.x = rect->x; - hwc->pp_rect.y = rect->y; - hwc->pp_rect.w = rect->w; - hwc->pp_rect.h = rect->h; + dst_rect.x = 0; + dst_rect.y = 0; + dst_rect.w = w; + dst_rect.h = h; - /* to wake up main loop */ - uint64_t value = 1; - if (write(hwc->target_hwc_window->event_fd, &value, sizeof(value)) < 0) - EHWSERR("failed to wake up main loop:%m", hwc); + _e_hwc_windows_pp_rect_set(hwc, rect, &dst_rect); return EINA_TRUE; @@ -3799,6 +3523,12 @@ fail: hwc->tpp = NULL; } + if (hwc->pp_tqueue) + { + tbm_surface_queue_destroy(hwc->pp_tqueue); + hwc->pp_tqueue = NULL; + } + return EINA_FALSE; } @@ -3807,24 +3537,21 @@ e_hwc_windows_zoom_unset(E_Hwc *hwc) { EINA_SAFETY_ON_NULL_RETURN(hwc); - hwc->pp_rect.x = 0; - hwc->pp_rect.y = 0; - hwc->pp_rect.w = 0; - hwc->pp_rect.h = 0; + CLEAR(hwc->pp_src_rect); + CLEAR(hwc->pp_dst_rect); + CLEAR(hwc->pp_set_src_rect); + CLEAR(hwc->pp_set_dst_rect); if (e_comp_screen_pp_support()) { - hwc->target_hwc_window->skip_surface_set = EINA_FALSE; - hwc->pp_set_info = EINA_FALSE; hwc->pp_set = EINA_FALSE; hwc->pp_hwc_window = NULL; - hwc->pp_unset = EINA_TRUE; - - if (hwc->pp_tsurface) - tbm_surface_queue_release(hwc->pp_tqueue, hwc->pp_tsurface); if (hwc->pp_tqueue) { + EHWSINF("PP Destroy pp_tqueue:%p", NULL, hwc, hwc->pp_tqueue); + + hwc->pp_queue = NULL; tbm_surface_queue_destroy(hwc->pp_tqueue); hwc->pp_tqueue = NULL; } @@ -3833,24 +3560,17 @@ e_hwc_windows_zoom_unset(E_Hwc *hwc) { if (hwc->tpp) { + EHWSINF("PP Destroy tdm_pp:%p", NULL, hwc, hwc->tpp); tdm_pp_destroy(hwc->tpp); hwc->tpp = NULL; } - } - if (hwc->pp_output_commit_data) - _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE); + e_hwc_window_buffer_set(&hwc->pp_buffer, NULL, NULL); + } - hwc->pp_src_rect_prev.x = 0; - hwc->pp_src_rect_prev.y = 0; - hwc->pp_src_rect_prev.w = 0; - hwc->pp_src_rect_prev.h = 0; + _e_hwc_windows_target_window_pp_queue_set(hwc->target_hwc_window, NULL); + _e_hwc_windows_target_window_force_render(hwc->target_hwc_window); } - - /* to wake up main loop */ - uint64_t value = 1; - if (write(hwc->target_hwc_window->event_fd, &value, sizeof(value)) < 0) - EHWSERR("failed to wake up main loop:%m", hwc); } // add hwc_window to the render_list