From 0571449a2c317cee82c3913e6a44930a08b78fe8 Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Fri, 6 Mar 2020 14:12:50 +0900 Subject: [PATCH] e_hwc_windows: check pp restriction before making pp queue Change-Id: I1fb504599a930d6a445a01a299f4288a0ce0320c Signed-off-by: Junkyeong Kim --- src/bin/e_hwc.h | 3 +++ src/bin/e_hwc_windows.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/bin/e_hwc.h b/src/bin/e_hwc.h index 7f326de828..a7b6383b36 100644 --- a/src/bin/e_hwc.h +++ b/src/bin/e_hwc.h @@ -117,6 +117,9 @@ struct _E_Hwc Eina_Rectangle pp_rect; Eina_Rectangle pp_src_rect_prev; E_Hwc_Window *pp_hwc_window; + int pp_minw, pp_minh, pp_maxw, pp_maxh; + int pp_align; + int pp_align_vertical; /* external output */ Eina_Rectangle mirror_rect; diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index 468929a96e..5c3060bdf6 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -54,6 +54,8 @@ } \ while (0) +#define ROUNDUP(s,c) (((s) + (c-1)) & ~(c-1)) + typedef struct _E_Hwc_Windows_Pp_Data E_Hwc_Windows_Pp_Data; typedef struct _E_Hwc_Windows_Buffer_Comp_Info E_Hwc_Windows_Buffer_Comp_Info; @@ -3358,6 +3360,28 @@ e_hwc_windows_pp_commit_possible_check(E_Hwc *hwc) return EINA_TRUE; } +static void +_e_hwc_windows_zoom_pp_aligned_value_get(E_Hwc *hwc, int *aligned_width, int *aligned_height) +{ + if (hwc->pp_minw != -1) + { + if (hwc->pp_minw > *aligned_width) + *aligned_width = hwc->pp_minw; + } + + if (hwc->pp_minh != -1) + { + if (hwc->pp_minh > *aligned_height) + *aligned_height = hwc->pp_minh; + } + + if (hwc->pp_align != -1) + *aligned_width = ROUNDUP(*aligned_width, hwc->pp_align); + + if (hwc->pp_align_vertical != -1) + *aligned_height = ROUNDUP(*aligned_height, hwc->pp_align_vertical); +} + EINTERN Eina_Bool e_hwc_windows_zoom_set(E_Hwc *hwc, Eina_Rectangle *rect) { @@ -3387,10 +3411,17 @@ e_hwc_windows_zoom_set(E_Hwc *hwc, Eina_Rectangle *rect) ret = tdm_pp_set_done_handler(hwc->tpp, _e_hwc_windows_pp_commit_handler, hwc); EINA_SAFETY_ON_FALSE_GOTO(ret == TDM_ERROR_NONE, fail); + + tdm_display_get_pp_available_size(e_comp_screen->tdisplay, + &hwc->pp_minw, &hwc->pp_minh, + &hwc->pp_maxw, &hwc->pp_maxh, + &hwc->pp_align); + tdm_display_get_pp_preferred_align_vertical(e_comp_screen->tdisplay, &hwc->pp_align_vertical); } if (!hwc->pp_tqueue) { + _e_hwc_windows_zoom_pp_aligned_value_get(hwc, &w, &h); //TODO: Does e20 get the buffer flags from the tdm backend? hwc->pp_tqueue = tbm_surface_queue_create(3, w, h, TBM_FORMAT_ARGB8888, TBM_BO_SCANOUT); if (!hwc->pp_tqueue) -- 2.34.1