From 189e36e48cb23005aac962500813fbbf7a0e3a1a Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Wed, 27 Jun 2018 11:18:16 +0900 Subject: [PATCH 01/16] log: check tdm environment value only init Change-Id: I46425da547cc57edc7163d4838e49f92b7ad607a Signed-off-by: Junkyeong Kim --- common/tdm_log.c | 9 --------- include/tdm_log.h | 1 - src/tdm_config.c | 27 ++++++++++++++++++++++++--- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/common/tdm_log.c b/common/tdm_log.c index ac7666d..975eb19 100644 --- a/common/tdm_log.c +++ b/common/tdm_log.c @@ -81,9 +81,6 @@ tdm_log_enable_color(unsigned int enable) EXTERN void tdm_log_enable_dlog(unsigned int enable) { - const char *str = getenv("TDM_DLOG"); - if (str) - enable = (str[0] == '1') ? 1 : 0; dlog_enable = enable; TDM_INFO("dlog_enable: %d", dlog_enable); } @@ -91,9 +88,6 @@ tdm_log_enable_dlog(unsigned int enable) EXTERN void tdm_log_set_debug_level(int level) { - const char *str = getenv("TDM_DEBUG_LEVEL"); - if (str) - level = str[0] - '0'; tdm_log_debug_level = level; TDM_INFO("debug_level: %d", tdm_log_debug_level); } @@ -101,9 +95,6 @@ tdm_log_set_debug_level(int level) EXTERN void tdm_log_set_assert_level(int level) { - const char *str = getenv("TDM_ASSERT_LEVEL"); - if (str) - level = str[0] - '0'; assert_level = level; TDM_INFO("assert_level: %d", assert_level); } diff --git a/include/tdm_log.h b/include/tdm_log.h index f1b3cdc..de56386 100644 --- a/include/tdm_log.h +++ b/include/tdm_log.h @@ -71,7 +71,6 @@ void tdm_log_set_assert_level(int level); void tdm_log_set_path(const char *path); void tdm_log_printf(int level, const char *fmt, ...); void tdm_log_print(int level, const char *fmt, ...); - void tdm_log_reset(void); extern unsigned int tdm_log_debug_level; diff --git a/src/tdm_config.c b/src/tdm_config.c index 9918fa4..95f5119 100644 --- a/src/tdm_config.c +++ b/src/tdm_config.c @@ -104,10 +104,24 @@ _tdm_config_check_logs(void) pthread_mutex_unlock(&g_dic_lock); - level = tdm_config_get_int(TDM_CONFIG_KEY_DEBUG_LOG_LEVEL, 3); + level = tdm_config_get_int(TDM_CONFIG_KEY_DEBUG_LOG_LEVEL, -1); + if (level == -1) { + const char *str = getenv("TDM_DEBUG_LEVEL"); + if (str) + level = str[0] - '0'; + else + level = 3; + } tdm_log_set_debug_level(level); - level = tdm_config_get_int(TDM_CONFIG_KEY_DEBUG_ASSERT_LEVEL, 0); + level = tdm_config_get_int(TDM_CONFIG_KEY_DEBUG_ASSERT_LEVEL, -1); + if (level == -1) { + const char *str = getenv("TDM_ASSERT_LEVEL"); + if (str) + level = str[0] - '0'; + else + level = 0; + } tdm_log_set_assert_level(level); /* if TDM_CONFIG_KEY_DEBUG_LOG_PATH is setted, TDM_CONFIG_KEY_DEBUG_DLOG will be ignored. */ @@ -116,7 +130,14 @@ _tdm_config_check_logs(void) tdm_log_enable_dlog(0); tdm_log_set_path(path); } else { - int dlog = tdm_config_get_int(TDM_CONFIG_KEY_DEBUG_DLOG, 1); + int dlog = tdm_config_get_int(TDM_CONFIG_KEY_DEBUG_DLOG, -1); + if (dlog == -1) { + const char *str = getenv("TDM_DLOG"); + if (str) + dlog = (str[0] == '1') ? 1 : 0; + else + dlog = 1; + } tdm_log_enable_dlog(dlog); } -- 2.7.4 From 096b0daf780ac2cf91e64aab37f640241eb4f632 Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Wed, 27 Jun 2018 11:45:31 +0900 Subject: [PATCH 02/16] package version up to 2.0.1 Change-Id: I20d6523c147ccb75f67e6149e7619e1a64baddc7 Signed-off-by: Junkyeong Kim --- packaging/libtdm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index 5bcae43..d6ac6e3 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define HALTESTS_GCOV 0 Name: libtdm -Version: 2.0.0 +Version: 2.0.1 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries -- 2.7.4 From b587c76b5319d00f0c1305ce91053c1fe97c42ca Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Wed, 18 Jul 2018 19:36:20 +0900 Subject: [PATCH 03/16] fixed wrong checking abi version of module if minor version of module less than minimum minor version, func return false even if major version greater than minimum major version. so patch fixed it Change-Id: I6bb6a9dc7d46d4b6e949577f01d5bb443bc99b49 --- src/tdm_display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tdm_display.c b/src/tdm_display.c index 45ccdf2..297dd70 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -850,6 +850,9 @@ tdm_module_check_abi(tdm_private_module *private_module, int abimaj, int abimin) { tdm_backend_module *module = private_module->module_data; + if (TDM_BACKEND_GET_ABI_MAJOR(module->abi_version) > abimaj) + return 1; + if (TDM_BACKEND_GET_ABI_MAJOR(module->abi_version) < abimaj) return 0; -- 2.7.4 From ea1b2719641483fb39742f3bbe298cf6fd1328ee Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Thu, 19 Jul 2018 20:19:05 +0900 Subject: [PATCH 04/16] remove unused tdm_hwc_window_composition Change-Id: I4eb2aa45ee7d06ffd6c851cdb8bd7c3701e5e2df --- include/tdm_types.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/tdm_types.h b/include/tdm_types.h index 32f544d..1a494f6 100644 --- a/include/tdm_types.h +++ b/include/tdm_types.h @@ -177,12 +177,6 @@ typedef enum { */ TDM_COMPOSITION_CLIENT = 1, - /** Set by the client before tdm_hwc_validate(). - * - * Upon tdm_hwc_validate(), the device may request a change from this type to - * TDM_COMPOSITION_DEVICE or TDM_COMPOSITION_CLIENT. */ - TDM_COMPOSITION_DEVICE_CANDIDATE = 2, - /** Set by the HWC after tdm_hwc_validate(). * * The device will handle the composition of this window through a hardware -- 2.7.4 From c2c11e87d1af1106ab783ed7b4b984dd0667d58e Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Thu, 19 Jul 2018 20:18:20 +0900 Subject: [PATCH 05/16] rename tdm_hwc_get_video_supported_formats Change-Id: I9034c4f898c7753e81790c02d7e71511651ad527 --- haltests/src/tc_tdm_hwc.cpp | 6 +++--- include/tdm.h | 7 ++++--- include/tdm_backend.h | 4 ++-- src/tdm_hwc.c | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/haltests/src/tc_tdm_hwc.cpp b/haltests/src/tc_tdm_hwc.cpp index 545c6a0..4df9e54 100644 --- a/haltests/src/tc_tdm_hwc.cpp +++ b/haltests/src/tc_tdm_hwc.cpp @@ -106,7 +106,7 @@ TEST_P(TDMHwc, GetSupportedFormatsFailNull) tdm_error error; - error = tdm_hwc_get_supported_formats(NULL, NULL, NULL); + error = tdm_hwc_get_video_supported_formats(NULL, NULL, NULL); ASSERT_NE(TDM_ERROR_NONE, error); } @@ -122,14 +122,14 @@ TEST_P(TDMHwc, GetSupportedFormatsSuccessful) for (int o = 0; o < output_count; o++) { hwc = tdm_output_get_hwc(outputs[o], &error); if (hwc) { - error = tdm_hwc_get_supported_formats(hwc, &formats, &count); + error = tdm_hwc_get_video_supported_formats(hwc, &formats, &count); if (error != TDM_ERROR_NOT_IMPLEMENTED) { ASSERT_EQ(TDM_ERROR_NONE, error); if (count > 0) ASSERT_NE(NULL, formats); } } else { - error = tdm_hwc_get_supported_formats(hwc, &formats, &count); + error = tdm_hwc_get_video_supported_formats(hwc, &formats, &count); ASSERT_NE(TDM_ERROR_NONE, error); } } diff --git a/include/tdm.h b/include/tdm.h index 7beccd0..1568ea1 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -825,14 +825,15 @@ tdm_hwc_window * tdm_hwc_create_window(tdm_hwc *hwc, tdm_error *error); /** - * @brief Get the supported format array for hwc windows of a hwc object. - * @param[in] hwc A output hwc + * @brief Get the video supported format array for hwc windows of a output object. + * @param[in] hwc A hwc object * @param[out] formats The available format array * @param[out] count The count of formats * @return #TDM_ERROR_NONE if success. Otherwise, error value. */ tdm_error -tdm_hwc_get_supported_formats(tdm_hwc *hwc, const tbm_format **formats, int *count); +tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats, + int *count); /** * @brief Get the available property array of a hwc object. diff --git a/include/tdm_backend.h b/include/tdm_backend.h index e9fc70d..4949d1e 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -694,13 +694,13 @@ typedef struct _tdm_func_hwc { tdm_hwc_window *(*hwc_create_window)(tdm_hwc *hwc, tdm_error *error); /** - * @brief Get the supported format array for the hwc windows of a hwc object. + * @brief Get video the supported format array for the hwc windows of a hwc object. * @param[in] hwc A hwc object * @param[out] formats The available format array * @param[out] count The count of formats * @return #TDM_ERROR_NONE if success. Otherwise, error value. */ - tdm_error (*hwc_get_supported_formats)(tdm_hwc *hwc, const tbm_format **formats, + tdm_error (*hwc_get_video_supported_formats)(tdm_hwc *hwc, const tbm_format **formats, int *count); diff --git a/src/tdm_hwc.c b/src/tdm_hwc.c index f7ed46f..b4df1c0 100644 --- a/src/tdm_hwc.c +++ b/src/tdm_hwc.c @@ -178,7 +178,7 @@ tdm_hwc_create_window(tdm_hwc *hwc, tdm_error *error) } EXTERN tdm_error -tdm_hwc_get_supported_formats(tdm_hwc *hwc, const tbm_format **formats, int *count) +tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats, int *count) { tdm_private_module *private_module; tdm_func_hwc *func_hwc; @@ -193,7 +193,7 @@ tdm_hwc_get_supported_formats(tdm_hwc *hwc, const tbm_format **formats, int *cou private_module = private_output->private_module; func_hwc = &private_module->func_hwc; - if (!func_hwc->hwc_get_supported_formats) { + if (!func_hwc->hwc_get_video_supported_formats) { /* LCOV_EXCL_START */ _pthread_mutex_unlock(&private_display->lock); TDM_WRN("not implemented!!"); @@ -201,7 +201,7 @@ tdm_hwc_get_supported_formats(tdm_hwc *hwc, const tbm_format **formats, int *cou /* LCOV_EXCL_STOP */ } - ret = func_hwc->hwc_get_supported_formats(private_hwc->hwc_backend, formats, count); + ret = func_hwc->hwc_get_video_supported_formats(private_hwc->hwc_backend, formats, count); _pthread_mutex_unlock(&private_display->lock); -- 2.7.4 From d83a8cb9702ec0084ffcaaefe561a7c20f030d15 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Thu, 19 Jul 2018 20:35:05 +0900 Subject: [PATCH 06/16] added tdm_hwc_get_video_capability Change-Id: I0bfff03716453a5e1b2b903bb55628e831c865dc --- include/tdm.h | 9 +++++++++ include/tdm_backend.h | 9 ++++++++- include/tdm_common.h | 10 ++++++++++ src/tdm_hwc.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) diff --git a/include/tdm.h b/include/tdm.h index 1568ea1..acd3a45 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -836,6 +836,15 @@ tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats, int *count); /** + * @brief Get the hwc video capability + * @param[in] hwc A hwc object + * @param[out] video_capability A hwc video capability + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ +tdm_error +tdm_hwc_get_video_capability(tdm_hwc *hwc, tdm_hwc_video_capability *video_capability); + +/** * @brief Get the available property array of a hwc object. * @param[in] hwc A hwc * @param[out] props The available property array diff --git a/include/tdm_backend.h b/include/tdm_backend.h index 4949d1e..d614fff 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -702,7 +702,14 @@ typedef struct _tdm_func_hwc { */ tdm_error (*hwc_get_video_supported_formats)(tdm_hwc *hwc, const tbm_format **formats, int *count); - + /** + * @brief Get the hwc video capability + * @param[in] hwc A hwc object + * @param[out] video_capability A hwc hwc video capability + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ + tdm_error (*hwc_get_video_capability)(tdm_hwc *hwc, + tdm_hwc_video_capability *video_capability); /** * @brief Get the available property array of a hwc object. diff --git a/include/tdm_common.h b/include/tdm_common.h index 328f837..9492394 100644 --- a/include/tdm_common.h +++ b/include/tdm_common.h @@ -258,6 +258,16 @@ typedef enum { TDM_OUTPUT_MODE_FLAG_CLKDIV2 = (1 << 13), } tdm_output_mode_flag; +/* + * @brief The hwc video capability enumeration + * @since 2.0.0 + */ +typedef enum { + TDM_HWC_VIDEO_CAPABILITY_SCALE = (1 << 1), /**< if a hwc video has scale capability */ + TDM_HWC_VIDEO_CAPABILITY_TRANSFORM = (1 << 2), /**< if a hwc video has transform capability */ + TDM_HWC_VIDEO_CAPABILITY_SCANOUT = (1 << 3), /**< if a video allows a scanout buffer only */ +} tdm_hwc_video_capability; + /** * @brief The size structure */ diff --git a/src/tdm_hwc.c b/src/tdm_hwc.c index b4df1c0..49d4ca9 100644 --- a/src/tdm_hwc.c +++ b/src/tdm_hwc.c @@ -209,6 +209,34 @@ tdm_hwc_get_video_supported_formats(tdm_hwc *hwc, const tbm_format **formats, in } EXTERN tdm_error +tdm_hwc_get_video_capability(tdm_hwc *hwc, + tdm_hwc_video_capability *video_capability) +{ + tdm_private_module *private_module; + tdm_func_hwc *func_hwc; + + HWC_FUNC_ENTRY(); + + _pthread_mutex_lock(&private_display->lock); + + private_module = private_output->private_module; + func_hwc = &private_module->func_hwc; + + if (!func_hwc->hwc_get_video_capability) { + _pthread_mutex_unlock(&private_display->lock); + TDM_WRN("not implemented!!"); + return TDM_ERROR_NOT_IMPLEMENTED; + } + + ret = func_hwc->hwc_get_video_capability(private_hwc->hwc_backend, + video_capability); + + _pthread_mutex_unlock(&private_display->lock); + + return ret; +} + +EXTERN tdm_error tdm_hwc_get_available_properties(tdm_hwc *hwc, const tdm_prop **props, int *count) { tdm_private_module *private_module; -- 2.7.4 From d47abbabf3332fcc8c410810f12216e79a25c459 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Tue, 24 Jul 2018 20:19:08 +0900 Subject: [PATCH 07/16] hwc_window: tdm_hwc_window_get_preparation_types Change-Id: I977b322aaedf140ea0aa58342867ab58a0f73dad --- include/tdm.h | 10 ++++++++++ include/tdm_backend.h | 9 +++++++++ include/tdm_types.h | 10 ++++++++++ src/tdm_hwc_window.c | 27 +++++++++++++++++++++++++++ 4 files changed, 56 insertions(+) diff --git a/include/tdm.h b/include/tdm.h index acd3a45..fae9308 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -1089,6 +1089,16 @@ tdm_error tdm_hwc_window_set_property(tdm_hwc_window *hwc_window, uint32_t id, tdm_value value); /** + * @brief Get the preperation type of hwc_window + * @param[in] hwc window A hwc window object + * @param[out] preperation_types The tdm_hwc_window_preparation types + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ +tdm_error +tdm_hwc_window_get_preparation_types(tdm_hwc_window *hwc_window, + int *preparation_types); + +/** * @brief Destroy a pp object * @param[in] pp A pp object * @see tdm_display_create_pp diff --git a/include/tdm_backend.h b/include/tdm_backend.h index d614fff..0b5829c 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -960,6 +960,15 @@ typedef struct _tdm_func_hwc_window { */ tdm_error (*hwc_window_get_property)(tdm_hwc_window *hwc_window, uint32_t id, tdm_value *value); + + /** + * @brief Get the preperation type of hwc_window + * @param[in] hwc window A hwc window object + * @param[out] preperation_types The tdm_hwc_window_preparation types + * @return #TDM_ERROR_NONE if success. Otherwise, error value. + */ + tdm_error (*hwc_window_get_preparation_types)(tdm_hwc_window *hwc_window, + int *preperation_types); } tdm_func_hwc_window; /** diff --git a/include/tdm_types.h b/include/tdm_types.h index 1a494f6..c596ac6 100644 --- a/include/tdm_types.h +++ b/include/tdm_types.h @@ -205,6 +205,16 @@ typedef enum { TDM_COMPOSITION_VIDEO = 5, } tdm_hwc_window_composition; +typedef enum { + TDM_PREPARATION_NONE = 0, + /** If the client needs to render to a specific buffer for compositing + * with TDM_COMPOSITION_DEVICE, Set TDM_PREPARATION_BUFFER_QUEUE type to hwc_window. + * The client will render next frame on buffers of queue which got by + * tdm_hwc_window_get_buffer_queue. + */ + TDM_PREPARATION_BUFFER_QUEUE = (1 << 0), +} tdm_hwc_window_preparation; + /** * @brief The hwc window flag enumeration * @since 2.0.0 diff --git a/src/tdm_hwc_window.c b/src/tdm_hwc_window.c index 78df88d..31e62ad 100644 --- a/src/tdm_hwc_window.c +++ b/src/tdm_hwc_window.c @@ -403,4 +403,31 @@ tdm_hwc_window_set_property(tdm_hwc_window *hwc_window, unsigned int id, tdm_val return ret; } + +EXTERN tdm_error +tdm_hwc_window_get_preparation_types(tdm_hwc_window *hwc_window, + int *preparation_types) +{ + tdm_private_module *private_module; + tdm_func_hwc_window *func_hwc_window = NULL; + + HWC_WINDOW_FUNC_ENTRY(); + + _pthread_mutex_lock(&private_display->lock); + + private_module = private_output->private_module; + func_hwc_window = &private_module->func_hwc_window; + + if (!func_hwc_window->hwc_window_get_preparation_types) { + _pthread_mutex_unlock(&private_display->lock); + TDM_WRN("not implemented!!"); + return TDM_ERROR_NOT_IMPLEMENTED; + } + + ret = func_hwc_window->hwc_window_get_preparation_types(private_hwc_window->hwc_window_backend, preparation_types); + + _pthread_mutex_unlock(&private_display->lock); + + return ret; +} /* LCOV_EXCL_STOP */ \ No newline at end of file -- 2.7.4 From dc0f94dbd2d214c19b3811ed424647906be77f75 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Tue, 24 Jul 2018 19:32:24 +0900 Subject: [PATCH 08/16] hwc_window: added tdm_hwc_window_free_buffer_queue Change-Id: I99775be1df445fe64039ba9f5c098b7e50fd005f --- include/tdm.h | 10 ++++++++++ include/tdm_backend.h | 9 +++++++++ src/tdm_hwc_window.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/include/tdm.h b/include/tdm.h index fae9308..0ec6055 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -1004,6 +1004,16 @@ tbm_surface_queue_h tdm_hwc_window_get_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error); /** + * @brief Free a buffer queue for the window object + * @details Free buffer queue when the client no longer uses buferrs of queue. + * @param[in] hwc_window A window object + * @param[in] A tbm buffer queue + * @since 2.0.0 + */ +void +tdm_hwc_window_free_buffer_queue(tdm_hwc_window *hwc_window, tbm_surface_queue_h queue); + +/** * @brief Sets the desired composition type of the given window. * @details During tdm_hwc_validate(), the device may request changes to * the composition types of any of the layers as described in the definition diff --git a/include/tdm_backend.h b/include/tdm_backend.h index 0b5829c..52d9056 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -872,6 +872,15 @@ typedef struct _tdm_func_hwc_window { tdm_error *error); /** + * @brief Free a buffer queue for the window object + * @details Free buffer queue when the client no longer uses buferrs of queue. + * @param[in] hwc_window A window object + * @param[in] A tbm buffer queue + */ + void (*hwc_window_free_buffer_queue)(tdm_hwc_window *hwc_window, + tbm_surface_queue_h queue); + + /** * @brief Sets the desired composition type of the given window. * @details During hwc_validate(), the device may request changes to * the composition types of any of the layers as described in the definition diff --git a/src/tdm_hwc_window.c b/src/tdm_hwc_window.c index 31e62ad..44e87bc 100644 --- a/src/tdm_hwc_window.c +++ b/src/tdm_hwc_window.c @@ -214,6 +214,44 @@ tdm_hwc_window_get_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error) return queue; } +EXTERN void +tdm_hwc_window_free_buffer_queue(tdm_hwc_window *hwc_window, tbm_surface_queue_h queue) +{ + tdm_private_module *private_module; + tdm_func_hwc_window *func_hwc_window = NULL; + tdm_private_display *private_display; + tdm_private_output *private_output; + tdm_private_hwc *private_hwc; + tdm_private_hwc_window *private_hwc_window; + + if (!hwc_window) + return; + + private_hwc_window = (tdm_private_hwc_window *)hwc_window; + private_hwc = private_hwc_window->private_hwc; + private_output = private_hwc->private_output; + private_display = private_output->private_display; + + TDM_RETURN_IF_FAIL(queue != NULL); + + _pthread_mutex_lock(&private_display->lock); + + private_module = private_output->private_module; + func_hwc_window = &private_module->func_hwc_window; + + if (!func_hwc_window->hwc_window_free_buffer_queue) { + _pthread_mutex_unlock(&private_display->lock); + TDM_WRN("not implemented!!"); + return; + } + + func_hwc_window->hwc_window_free_buffer_queue(private_hwc_window->hwc_window_backend, queue); + + _pthread_mutex_unlock(&private_display->lock); + + return; +} + EXTERN tdm_error tdm_hwc_window_set_composition_type(tdm_hwc_window *hwc_window, tdm_hwc_window_composition composition_type) -- 2.7.4 From 888f12665ac7edbf794007d1b0cd365392e64363 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Fri, 10 Aug 2018 13:00:07 +0900 Subject: [PATCH 09/16] Package version up to 2.1.0 Change-Id: I6a3379fd34b5ea40c973a58f046f21867a4462d7 --- packaging/libtdm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index d6ac6e3..f6b5c25 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define HALTESTS_GCOV 0 Name: libtdm -Version: 2.0.1 +Version: 2.1.0 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries -- 2.7.4 From fd6c98ff8587ddfd814f8b70ce7fabd4555da28e Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Fri, 10 Aug 2018 13:53:57 +0900 Subject: [PATCH 10/16] hwc_window: rename free_buffer_queue to release_buffer_queue Change-Id: I5ef4cb1a3f9be9d9cd943fb107b027f5a167df30 --- include/tdm.h | 6 +++--- include/tdm_backend.h | 8 ++++---- src/tdm_hwc_window.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/tdm.h b/include/tdm.h index 0ec6055..7a5893d 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -1004,14 +1004,14 @@ tbm_surface_queue_h tdm_hwc_window_get_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error); /** - * @brief Free a buffer queue for the window object - * @details Free buffer queue when the client no longer uses buferrs of queue. + * @brief Release a buffer queue for the window object + * @details Release buffer queue when the client no longer uses buferrs of queue. * @param[in] hwc_window A window object * @param[in] A tbm buffer queue * @since 2.0.0 */ void -tdm_hwc_window_free_buffer_queue(tdm_hwc_window *hwc_window, tbm_surface_queue_h queue); +tdm_hwc_window_release_buffer_queue(tdm_hwc_window *hwc_window, tbm_surface_queue_h queue); /** * @brief Sets the desired composition type of the given window. diff --git a/include/tdm_backend.h b/include/tdm_backend.h index 52d9056..12b088c 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -872,13 +872,13 @@ typedef struct _tdm_func_hwc_window { tdm_error *error); /** - * @brief Free a buffer queue for the window object - * @details Free buffer queue when the client no longer uses buferrs of queue. + * @brief Release a buffer queue for the window object + * @details Release buffer queue when the client no longer uses buferrs of queue. * @param[in] hwc_window A window object * @param[in] A tbm buffer queue */ - void (*hwc_window_free_buffer_queue)(tdm_hwc_window *hwc_window, - tbm_surface_queue_h queue); + void (*hwc_window_release_buffer_queue)(tdm_hwc_window *hwc_window, + tbm_surface_queue_h queue); /** * @brief Sets the desired composition type of the given window. diff --git a/src/tdm_hwc_window.c b/src/tdm_hwc_window.c index 44e87bc..72b80af 100644 --- a/src/tdm_hwc_window.c +++ b/src/tdm_hwc_window.c @@ -215,7 +215,7 @@ tdm_hwc_window_get_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error) } EXTERN void -tdm_hwc_window_free_buffer_queue(tdm_hwc_window *hwc_window, tbm_surface_queue_h queue) +tdm_hwc_window_release_buffer_queue(tdm_hwc_window *hwc_window, tbm_surface_queue_h queue) { tdm_private_module *private_module; tdm_func_hwc_window *func_hwc_window = NULL; @@ -239,13 +239,13 @@ tdm_hwc_window_free_buffer_queue(tdm_hwc_window *hwc_window, tbm_surface_queue_h private_module = private_output->private_module; func_hwc_window = &private_module->func_hwc_window; - if (!func_hwc_window->hwc_window_free_buffer_queue) { + if (!func_hwc_window->hwc_window_release_buffer_queue) { _pthread_mutex_unlock(&private_display->lock); TDM_WRN("not implemented!!"); return; } - func_hwc_window->hwc_window_free_buffer_queue(private_hwc_window->hwc_window_backend, queue); + func_hwc_window->hwc_window_release_buffer_queue(private_hwc_window->hwc_window_backend, queue); _pthread_mutex_unlock(&private_display->lock); -- 2.7.4 From 7e63bb30b767ec285f69e7152e4efdd9399d7721 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Fri, 10 Aug 2018 13:57:37 +0900 Subject: [PATCH 11/16] hwc_window: rename get_buffer_queue to acquire_buffer_queue Change-Id: Ie5e45480833bee69978192bdd2a98b875456a404 --- haltests/src/tc_tdm_hwc_window.cpp | 14 +++++++------- include/tdm.h | 4 ++-- include/tdm_backend.h | 4 ++-- include/tdm_types.h | 2 +- src/tdm_hwc_window.c | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/haltests/src/tc_tdm_hwc_window.cpp b/haltests/src/tc_tdm_hwc_window.cpp index b330e85..1e704a7 100644 --- a/haltests/src/tc_tdm_hwc_window.cpp +++ b/haltests/src/tc_tdm_hwc_window.cpp @@ -81,7 +81,7 @@ TEST_P(TDMHwcWindow, DestroyWindowSuccessful) } } -/* tbm_surface_queue_h tdm_hwc_window_get_buffer_queue() */ +/* tbm_surface_queue_h tdm_hwc_window_acquire_buffer_queue() */ TEST_P(TDMHwcWindow, GetBufferQueueFailNull) { TDM_UT_SKIP_FLAG(has_outputs); @@ -89,11 +89,11 @@ TEST_P(TDMHwcWindow, GetBufferQueueFailNull) tdm_error error = TDM_ERROR_NONE; tbm_surface_queue_h queue = NULL; - queue = tdm_hwc_window_get_buffer_queue(NULL, &error); + queue = tdm_hwc_window_acquire_buffer_queue(NULL, &error); ASSERT_NE(TDM_ERROR_NONE, error); ASSERT_EQ(NULL, queue); - queue = tdm_hwc_window_get_buffer_queue(NULL, NULL); + queue = tdm_hwc_window_acquire_buffer_queue(NULL, NULL); ASSERT_EQ(NULL, queue); } @@ -126,13 +126,13 @@ TEST_P(TDMHwcWindow, GetBufferQueueSuccessful) error = tdm_hwc_window_set_info(hwc_wins[w], &info); ASSERT_EQ(TDM_ERROR_NONE, error); - queue = tdm_hwc_window_get_buffer_queue(hwc_wins[w], &error); - tbm_surface_queue_destroy(queue); + queue = tdm_hwc_window_acquire_buffer_queue(hwc_wins[w], &error); + tdm_hwc_window_release_buffer_queue(hwc_wins[w], queue); ASSERT_EQ(TDM_ERROR_NONE, error); ASSERT_NE(NULL, queue); - queue = tdm_hwc_window_get_buffer_queue(hwc_wins[w], NULL); - tbm_surface_queue_destroy(queue); + queue = tdm_hwc_window_acquire_buffer_queue(hwc_wins[w], NULL); + tdm_hwc_window_release_buffer_queue(hwc_wins[w], queue); ASSERT_NE(NULL, queue); } diff --git a/include/tdm.h b/include/tdm.h index 7a5893d..0b40cd5 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -992,7 +992,7 @@ void tdm_hwc_window_destroy(tdm_hwc_window *hwc_window); /** - * @brief Get a buffer queue for the window object + * @brief Acquire a buffer queue for the window object * @details These buffers are used to composite by hardware a client content in * the nocomp mode. * @param[in] hwc_window A window object @@ -1001,7 +1001,7 @@ tdm_hwc_window_destroy(tdm_hwc_window *hwc_window); * @since 2.0.0 */ tbm_surface_queue_h -tdm_hwc_window_get_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error); +tdm_hwc_window_acquire_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error); /** * @brief Release a buffer queue for the window object diff --git a/include/tdm_backend.h b/include/tdm_backend.h index 12b088c..f695562 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -868,8 +868,8 @@ typedef struct _tdm_func_hwc_window { * @param[out] error #TDM_ERROR_NONE if success. Otherwise, error value. * @return A buffer queue */ - tbm_surface_queue_h (*hwc_window_get_buffer_queue)(tdm_hwc_window *hwc_window, - tdm_error *error); + tbm_surface_queue_h (*hwc_window_acquire_buffer_queue)(tdm_hwc_window *hwc_window, + tdm_error *error); /** * @brief Release a buffer queue for the window object diff --git a/include/tdm_types.h b/include/tdm_types.h index c596ac6..225325f 100644 --- a/include/tdm_types.h +++ b/include/tdm_types.h @@ -210,7 +210,7 @@ typedef enum { /** If the client needs to render to a specific buffer for compositing * with TDM_COMPOSITION_DEVICE, Set TDM_PREPARATION_BUFFER_QUEUE type to hwc_window. * The client will render next frame on buffers of queue which got by - * tdm_hwc_window_get_buffer_queue. + * tdm_hwc_window_acquire_buffer_queue. */ TDM_PREPARATION_BUFFER_QUEUE = (1 << 0), } tdm_hwc_window_preparation; diff --git a/src/tdm_hwc_window.c b/src/tdm_hwc_window.c index 72b80af..0066ef3 100644 --- a/src/tdm_hwc_window.c +++ b/src/tdm_hwc_window.c @@ -185,7 +185,7 @@ tdm_hwc_window_destroy(tdm_hwc_window *hwc_window) } EXTERN tbm_surface_queue_h -tdm_hwc_window_get_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error) +tdm_hwc_window_acquire_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error) { tdm_private_module *private_module; tdm_func_hwc_window *func_hwc_window = NULL; @@ -198,7 +198,7 @@ tdm_hwc_window_get_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error) private_module = private_output->private_module; func_hwc_window = &private_module->func_hwc_window; - if (!func_hwc_window->hwc_window_get_buffer_queue) { + if (!func_hwc_window->hwc_window_acquire_buffer_queue) { /* LCOV_EXCL_START */ _pthread_mutex_unlock(&private_display->lock); TDM_WRN("not implemented!!"); @@ -207,7 +207,7 @@ tdm_hwc_window_get_buffer_queue(tdm_hwc_window *hwc_window, tdm_error *error) return NULL; } - queue = func_hwc_window->hwc_window_get_buffer_queue(private_hwc_window->hwc_window_backend, error); + queue = func_hwc_window->hwc_window_acquire_buffer_queue(private_hwc_window->hwc_window_backend, error); _pthread_mutex_unlock(&private_display->lock); -- 2.7.4 From 5c5ef51cd9bad051072eeb9ce49fc37577302695 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Fri, 10 Aug 2018 13:59:55 +0900 Subject: [PATCH 12/16] Package version up to 2.2.0 Change-Id: I3dc25c4ee4d55b5b16a324cf07a5ac19ac0d7e36 --- packaging/libtdm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index f6b5c25..f25bd23 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define HALTESTS_GCOV 0 Name: libtdm -Version: 2.1.0 +Version: 2.2.0 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries -- 2.7.4 From 211eb281cbf5d191ccec9e726770b1ccc8cf1823 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Thu, 13 Sep 2018 16:22:28 +0900 Subject: [PATCH 13/16] tdm_helper: show the width of the tbm_surface When tdm-monitor shows the information, the result shows the width of the tbm_surface instead of showing the real size of the buffer(stride/4). Change-Id: Ib25a118d05798a96dcf4e99a31fd3c7f1462e399 --- src/tdm_helper.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tdm_helper.c b/src/tdm_helper.c index 0c8b336..3607f13 100644 --- a/src/tdm_helper.c +++ b/src/tdm_helper.c @@ -872,10 +872,7 @@ _tdm_helper_get_backend_information(tdm_private_module *private_module, char *re format = tbm_surface_get_format(private_layer->showing_buffer->buffer); tbm_surface_get_info(private_layer->showing_buffer->buffer, &buf_info); - if (IS_RGB(format)) - size.h = buf_info.planes[0].stride >> 2; - else - size.h = buf_info.planes[0].stride; + size.h = tbm_surface_get_width(private_layer->showing_buffer->buffer); size.v = tbm_surface_get_height(private_layer->showing_buffer->buffer); if (info.src_config.format) -- 2.7.4 From e8d7b6bc5a897a04cfadfc121e1251787632d1f0 Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Thu, 13 Sep 2018 19:22:44 +0900 Subject: [PATCH 14/16] haltest: change ClientVblankWaitSetFps test error condition tw2 cannot success before condition. reduce error checking condition. Change-Id: I291207363b42ea0dc2e51fca60c4dae4b609a63e Signed-off-by: Junkyeong Kim --- haltests/src/tc_tdm_client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haltests/src/tc_tdm_client.cpp b/haltests/src/tc_tdm_client.cpp index 10e122d..eb537ca 100644 --- a/haltests/src/tc_tdm_client.cpp +++ b/haltests/src/tc_tdm_client.cpp @@ -1150,7 +1150,7 @@ TEST_P(TDMClient, ClientVblankWaitSetFps) end = tdm_helper_get_time(); /* "+ vrefresh_interval" consider the delay of socket communication between kernel and platform */ - ASSERT_GT((end - start), (interval - vrefresh_interval)); + ASSERT_GT((end - start), (interval - vrefresh_interval * 2)); ASSERT_LT((end - start), (interval + vrefresh_interval)); } @@ -1368,4 +1368,4 @@ INSTANTIATE_TEST_CASE_P(TDMClientParams, Values(TDM_DEFAULT_MODULE)); #endif -/* LCOV_EXCL_END */ \ No newline at end of file +/* LCOV_EXCL_END */ -- 2.7.4 From c5d9687d6b76a50d13ea7229a182d193489bb802 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Fri, 14 Sep 2018 16:46:50 +0900 Subject: [PATCH 15/16] Package version up to 2.2.1 Change-Id: If8e3ace70b17d8a76763ef4e1d1d63f6a89d4cab --- packaging/libtdm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index f25bd23..f956e55 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define HALTESTS_GCOV 0 Name: libtdm -Version: 2.2.0 +Version: 2.2.1 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries -- 2.7.4 From feeaa2e26e9fc8c3e3672b58f0e3c0d9c2f83709 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 19 Sep 2018 19:21:02 +0900 Subject: [PATCH 16/16] tdm_hwc: change the symbol names of preperation types into constraints Change-Id: Ia02711a6d927edf6785048db171929e446398020 --- include/tdm.h | 7 +++---- include/tdm_backend.h | 8 ++++---- include/tdm_types.h | 14 ++++++++------ src/tdm_hwc_window.c | 7 +++---- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/tdm.h b/include/tdm.h index 0b40cd5..42837ab 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -1099,14 +1099,13 @@ tdm_error tdm_hwc_window_set_property(tdm_hwc_window *hwc_window, uint32_t id, tdm_value value); /** - * @brief Get the preperation type of hwc_window + * @brief Get the constraints of hwc_window * @param[in] hwc window A hwc window object - * @param[out] preperation_types The tdm_hwc_window_preparation types + * @param[out] constraints The tdm_hwc_window_constraint types * @return #TDM_ERROR_NONE if success. Otherwise, error value. */ tdm_error -tdm_hwc_window_get_preparation_types(tdm_hwc_window *hwc_window, - int *preparation_types); +tdm_hwc_window_get_constraints(tdm_hwc_window *hwc_window, int *constraints); /** * @brief Destroy a pp object diff --git a/include/tdm_backend.h b/include/tdm_backend.h index f695562..e7d08ee 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -971,13 +971,13 @@ typedef struct _tdm_func_hwc_window { uint32_t id, tdm_value *value); /** - * @brief Get the preperation type of hwc_window + * @brief Get the constraints of hwc_window * @param[in] hwc window A hwc window object - * @param[out] preperation_types The tdm_hwc_window_preparation types + * @param[out] constraints The tdm_hwc_window_constraint types * @return #TDM_ERROR_NONE if success. Otherwise, error value. */ - tdm_error (*hwc_window_get_preparation_types)(tdm_hwc_window *hwc_window, - int *preperation_types); + tdm_error (*hwc_window_get_constraints)(tdm_hwc_window *hwc_window, + int *constraints); } tdm_func_hwc_window; /** diff --git a/include/tdm_types.h b/include/tdm_types.h index 225325f..072f466 100644 --- a/include/tdm_types.h +++ b/include/tdm_types.h @@ -206,14 +206,16 @@ typedef enum { } tdm_hwc_window_composition; typedef enum { - TDM_PREPARATION_NONE = 0, + TDM_CONSTRAINT_NONE = 0, /** If the client needs to render to a specific buffer for compositing - * with TDM_COMPOSITION_DEVICE, Set TDM_PREPARATION_BUFFER_QUEUE type to hwc_window. - * The client will render next frame on buffers of queue which got by - * tdm_hwc_window_acquire_buffer_queue. + * with TDM_COMPOSITION_DEVICE, the backend needs to set + * TDM_CONSTRAINT_BUFFER_QUEUE to hwc_window until the hwc_window is not + * TDM_COMPOSITION_DEVICE. The client gets the tbm_surface_queue_h through + * the tdm_hwc_window_aquire_buffer_queue. It will render the frames on + * the buffers which gets from the tbm_surface_queue_h. */ - TDM_PREPARATION_BUFFER_QUEUE = (1 << 0), -} tdm_hwc_window_preparation; + TDM_CONSTRAINT_BUFFER_QUEUE = (1 << 0), +} tdm_hwc_window_constraint; /** * @brief The hwc window flag enumeration diff --git a/src/tdm_hwc_window.c b/src/tdm_hwc_window.c index 0066ef3..ce04c51 100644 --- a/src/tdm_hwc_window.c +++ b/src/tdm_hwc_window.c @@ -443,8 +443,7 @@ tdm_hwc_window_set_property(tdm_hwc_window *hwc_window, unsigned int id, tdm_val } EXTERN tdm_error -tdm_hwc_window_get_preparation_types(tdm_hwc_window *hwc_window, - int *preparation_types) +tdm_hwc_window_get_constraints(tdm_hwc_window *hwc_window, int *constraints) { tdm_private_module *private_module; tdm_func_hwc_window *func_hwc_window = NULL; @@ -456,13 +455,13 @@ tdm_hwc_window_get_preparation_types(tdm_hwc_window *hwc_window, private_module = private_output->private_module; func_hwc_window = &private_module->func_hwc_window; - if (!func_hwc_window->hwc_window_get_preparation_types) { + if (!func_hwc_window->hwc_window_get_constraints) { _pthread_mutex_unlock(&private_display->lock); TDM_WRN("not implemented!!"); return TDM_ERROR_NOT_IMPLEMENTED; } - ret = func_hwc_window->hwc_window_get_preparation_types(private_hwc_window->hwc_window_backend, preparation_types); + ret = func_hwc_window->hwc_window_get_constraints(private_hwc_window->hwc_window_backend, constraints); _pthread_mutex_unlock(&private_display->lock); -- 2.7.4