From: Junkyeong Kim Date: Wed, 19 Feb 2020 11:32:41 +0000 (+0900) Subject: tdm_display: add tdm_display_get_pp_preferred_align_vertical api X-Git-Tag: accepted/tizen/unified/20200221.093436~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F92%2F225392%2F1;p=platform%2Fcore%2Fuifw%2Flibtdm.git tdm_display: add tdm_display_get_pp_preferred_align_vertical api Change-Id: Ibb83649d8f5811846995f572a922d1c6cd0ae2da Signed-off-by: Junkyeong Kim --- diff --git a/include/tdm.h b/include/tdm.h index c334b20..685c4ec 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -150,6 +150,17 @@ tdm_display_get_pp_available_size(tdm_display *dpy, int *min_w, int *min_h, int *max_w, int *max_h, int *preferred_align); /** + * @brief Get the pp vertical preferred align of a display object. + * @details -1 means that a TDM backend module doesn't define the value. + * @param[in] dpy A display object + * @param[out] preferred_align_vertical The preferred align height which TDM can handle + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ +tdm_error +tdm_display_get_pp_preferred_align_vertical(tdm_display *dpy, int *preferred_align_vertical); + + +/** * @brief Get the capture capabilities of a display object. * @param[in] dpy A display object * @param[out] capabilities The capture capabilities diff --git a/src/tdm_display.c b/src/tdm_display.c index 814e60c..4deea99 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -587,6 +587,33 @@ tdm_display_get_pp_available_size(tdm_display *dpy, int *min_w, int *min_h, } EXTERN tdm_error +tdm_display_get_pp_preferred_align_vertical(tdm_display *dpy, int *preferred_align_vertical) +{ + tdm_private_module *pp_module; + + DISPLAY_FUNC_ENTRY(); + + _pthread_mutex_lock(&private_display->lock); + + if (!private_display->pp_module) { + /* LCOV_EXCL_START */ + TDM_ERR("no pp capability"); + _pthread_mutex_unlock(&private_display->lock); + return TDM_ERROR_NO_CAPABILITY; + /* LCOV_EXCL_STOP */ + } + + pp_module = private_display->pp_module; + + if (preferred_align_vertical) + *preferred_align_vertical = TDM_FRONT_VALUE(pp_module->caps_pp.preferred_align_vertical); + + _pthread_mutex_unlock(&private_display->lock); + + return ret; +} + +EXTERN tdm_error tdm_display_get_capture_capabilities(tdm_display *dpy, tdm_capture_capability *capabilities) {