From 8dd61deb2ff53bfd5e01c1b37f38cc65fab5553a Mon Sep 17 00:00:00 2001 From: Boram Park Date: Thu, 22 Mar 2018 13:44:29 +0900 Subject: [PATCH 01/16] config: fix infinite loop Change-Id: I8e74042c6cc711e64bc7f932dc2cb66be731872d --- src/tdm_config.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/tdm_config.c b/src/tdm_config.c index 703ae0a..fb361d2 100644 --- a/src/tdm_config.c +++ b/src/tdm_config.c @@ -51,6 +51,7 @@ static pthread_mutex_t g_dic_lock = PTHREAD_MUTEX_INITIALIZER; static dictionary *g_dic = NULL; +static int init_dic = 0; static int _tdm_config_check_file_owner(const char *filepath) @@ -122,19 +123,19 @@ _tdm_config_check_logs(void) pthread_mutex_lock(&g_dic_lock); } -static unsigned int +static void _tdm_config_check_init(void) { - if (g_dic) - return 1; + if (init_dic) + return; + + init_dic = 1; g_dic = _tdm_config_load_file(TDM_DATA_PATH, TDM_CONFIG_FILENAME); _tdm_config_check_logs(); TDM_INFO("tdm config init %s (%p)", (g_dic) ? "successed" : "failed", g_dic); - - return (g_dic) ? 1 : 0; } INTERN void @@ -149,6 +150,7 @@ tdm_config_deinit(void) iniparser_freedict(g_dic); g_dic = NULL; + init_dic = 0; TDM_INFO("tdm config deinit done"); @@ -190,7 +192,8 @@ tdm_config_get_int(const char *key, int default_value) pthread_mutex_lock(&g_dic_lock); - if (!_tdm_config_check_init()) { + _tdm_config_check_init(); + if (!g_dic) { TDM_INFO("%s = %d: default", key, default_value); pthread_mutex_unlock(&g_dic_lock); return default_value; @@ -220,7 +223,8 @@ tdm_config_get_string(const char *key, const char *default_value) pthread_mutex_lock(&g_dic_lock); - if (!_tdm_config_check_init()) { + _tdm_config_check_init(); + if (!g_dic) { TDM_INFO("%s = %s: default", key, default_value); pthread_mutex_unlock(&g_dic_lock); return default_value; @@ -246,7 +250,8 @@ tdm_config_set_int(const char *key, int value) pthread_mutex_lock(&g_dic_lock); - if (!_tdm_config_check_init()) { + _tdm_config_check_init(); + if (!g_dic) { TDM_INFO("%s = %d set failed", key, value); pthread_mutex_unlock(&g_dic_lock); return TDM_ERROR_BAD_REQUEST; @@ -272,7 +277,8 @@ tdm_config_set_string(const char *key, const char *value) pthread_mutex_lock(&g_dic_lock); - if (!_tdm_config_check_init()) { + _tdm_config_check_init(); + if (!g_dic) { TDM_INFO("%s = %s set failed", key, value); pthread_mutex_unlock(&g_dic_lock); return TDM_ERROR_BAD_REQUEST; -- 2.7.4 From ebb1cbd983e6251a7d4869538c75916a996ef3d9 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Thu, 22 Mar 2018 17:39:45 +0900 Subject: [PATCH 02/16] output: set output connection status if needed Change-Id: I8352ba1d63193ecf97ab64d568e8673451f9f766 --- src/tdm_output.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tdm_output.c b/src/tdm_output.c index bb2710c..0669b08 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -1160,6 +1160,16 @@ tdm_output_commit_internal(tdm_output *output, int sync, tdm_output_commit_handl output_commit_handler); TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, commit_failed); + if (ret == TDM_ERROR_NONE) { + if (private_output->current_mode && + private_output->caps.status != TDM_OUTPUT_CONN_STATUS_MODE_SETTED) { + TDM_WRN("backend doesn't change the output connection status"); + tdm_output_cb_status(private_output->output_backend, + TDM_OUTPUT_CONN_STATUS_MODE_SETTED, + private_output); + } + } + if (tdm_debug_module & TDM_DEBUG_COMMIT) TDM_INFO("output(%d) backend commit: handle(%p) func(%p) user_data(%p)", private_output->pipe, output_commit_handler, func, user_data); -- 2.7.4 From 6136728f2a97a488cf379356217d63e93825ec97 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Thu, 22 Mar 2018 18:09:10 +0900 Subject: [PATCH 03/16] dummy: consider vblank interval Change-Id: Ifcee3acc89ec9938e1174a8a17bffb2f59aea68f --- backends/dummy/tdm_dummy_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/dummy/tdm_dummy_display.c b/backends/dummy/tdm_dummy_display.c index 5e64fb3..a43c8c9 100644 --- a/backends/dummy/tdm_dummy_display.c +++ b/backends/dummy/tdm_dummy_display.c @@ -110,7 +110,7 @@ _tdm_dummy_display_cb_timeout(void *user_data) } static tdm_error -_tdm_dummy_display_wait_vblank(tdm_dummy_output_data *output_data, tdm_dummy_event_data *event_data) +_tdm_dummy_display_wait_vblank(tdm_dummy_output_data *output_data, int interval, tdm_dummy_event_data *event_data) { tdm_error ret; unsigned int ms; @@ -123,7 +123,7 @@ _tdm_dummy_display_wait_vblank(tdm_dummy_output_data *output_data, tdm_dummy_eve return TDM_ERROR_NONE; } - ms = 1000 / output_data->output_mode->vrefresh; + ms = ((double)1000.0 / output_data->output_mode->vrefresh) * interval; ret = tdm_event_loop_source_timer_update(output_data->timer, ms); if (ret != TDM_ERROR_NONE) @@ -461,7 +461,7 @@ dummy_output_wait_vblank(tdm_output *output, int interval, int sync, void *user_ event_data->output_data = output_data; event_data->user_data = user_data; - ret = _tdm_dummy_display_wait_vblank(output_data, event_data); + ret = _tdm_dummy_display_wait_vblank(output_data, interval, event_data); if (ret != TDM_ERROR_NONE) { free(event_data); return ret; @@ -502,7 +502,7 @@ dummy_output_commit(tdm_output *output, int sync, void *user_data) event_data->output_data = output_data; event_data->user_data = user_data; - ret = _tdm_dummy_display_wait_vblank(output_data, event_data); + ret = _tdm_dummy_display_wait_vblank(output_data, 1, event_data); if (ret != TDM_ERROR_NONE) { free(event_data); return ret; -- 2.7.4 From a68d42ae873b6e9cdda2d8d57f8da7a50a8a755a Mon Sep 17 00:00:00 2001 From: Boram Park Date: Thu, 22 Mar 2018 18:20:44 +0900 Subject: [PATCH 04/16] common: remove redundant logs Change-Id: I6843477d9227ec3db27200a1c82646acff3798f5 --- src/tdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tdm.c b/src/tdm.c index 42387fd..bb630d5 100644 --- a/src/tdm.c +++ b/src/tdm.c @@ -813,7 +813,7 @@ _tdm_display_load_module_with_file(tdm_private_display *private_display, TDM_TRACE_BEGIN("TDM_Load_Backend"); module = dlopen(path, RTLD_LAZY); if (!module) { - TDM_ERR("failed to load module: %s(%s)", dlerror(), file); + TDM_ERR("%s", dlerror()); TDM_TRACE_END(); ret = TDM_ERROR_BAD_MODULE; goto failed_load; -- 2.7.4 From b4518431806b7c5e86f3d2f707b261938bd276ee Mon Sep 17 00:00:00 2001 From: Boram Park Date: Thu, 22 Mar 2018 18:31:41 +0900 Subject: [PATCH 05/16] utests: change log level Change-Id: Icfb0e00e9edf45fa8dfccc881274802d0e583da0 --- utests/src/ut_tdm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utests/src/ut_tdm.h b/utests/src/ut_tdm.h index 9e4accd..d4d1f34 100644 --- a/utests/src/ut_tdm.h +++ b/utests/src/ut_tdm.h @@ -39,6 +39,7 @@ extern bool enable_porting_debug; #define TDM_ERR(fmt, args...) tdm_log_print(TDM_LOG_LEVEL_ERR, fmt, ##args) #define TDM_UT_INFO(fmt, args...) tdm_log_print_stdout(TDM_LOG_LEVEL_INFO, fmt, ##args) +#define TDM_UT_WRN(fmt, args...) tdm_log_print_stdout(TDM_LOG_LEVEL_WRN, fmt, ##args) #define TDM_UT_ERR(fmt, args...) tdm_log_print_stdout(TDM_LOG_LEVEL_ERR, fmt, ##args) #define TDM_UT_ENTRY() \ @@ -47,13 +48,13 @@ extern bool enable_porting_debug; #define TDM_UT_CHECK_FLAG(FLAG) \ do {\ if(!(FLAG)) \ - TDM_UT_INFO("[ ] not supported");\ + TDM_UT_WRN("[ ] not supported");\ } while(0) #define TDM_UT_SKIP_FLAG(FLAG) \ do {\ if(!(FLAG)) {\ - TDM_UT_INFO("[ SKIPPED ] not supported");\ + TDM_UT_WRN("[ SKIPPED ] not supported");\ return;\ }\ } while(0) -- 2.7.4 From 987acbdee4e9ee7d355f2f9f5ac1e08c72ac67c1 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Thu, 22 Mar 2018 18:35:13 +0900 Subject: [PATCH 06/16] package version up to 1.16.8 Change-Id: I1dfa7c51b5e5912899ff079c9be1c939a108a138 --- packaging/libtdm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index 4009b18..7d1e8d3 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define UTEST_GCOV 0 Name: libtdm -Version: 1.16.7 +Version: 1.16.8 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries -- 2.7.4 From fa5e2c3cca42898bdf5f1e0753e95870a437763d Mon Sep 17 00:00:00 2001 From: Boram Park Date: Fri, 23 Mar 2018 13:39:32 +0900 Subject: [PATCH 07/16] log: enhance debugging logs Change-Id: I6fcf7705e60652ecd6987737aed4686de9569d65 --- common/tdm_log.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/tdm_log.c b/common/tdm_log.c index 4d4d500..94aebc3 100644 --- a/common/tdm_log.c +++ b/common/tdm_log.c @@ -75,6 +75,7 @@ EXTERN void tdm_log_enable_color(unsigned int enable) { color_enable = enable; + TDM_INFO("color_enable: %d", color_enable); } EXTERN void @@ -84,6 +85,7 @@ tdm_log_enable_dlog(unsigned int enable) if (str) enable = (str[0] == '1') ? 1 : 0; dlog_enable = enable; + TDM_INFO("dlog_enable: %d", dlog_enable); } EXTERN void @@ -93,6 +95,7 @@ tdm_log_set_debug_level(int level) if (str) level = str[0] - '0'; tdm_log_debug_level = level; + TDM_INFO("debug_level: %d", tdm_log_debug_level); } EXTERN void @@ -102,11 +105,14 @@ tdm_log_set_assert_level(int level) if (str) level = str[0] - '0'; assert_level = level; + TDM_INFO("assert_level: %d", assert_level); } EXTERN void tdm_log_set_path(const char *path) { + TDM_INFO("log_path: %s", path); + if (!path) { if (stdout_fd != -1) { fflush(stdout); @@ -144,6 +150,7 @@ tdm_log_set_path(const char *path) close(STDOUT_FILENO); dup2(log_fd, STDOUT_FILENO); fclose(log_fl); + TDM_INFO("log_path: %s done", path); } } -- 2.7.4 From 82b4ff6cb6b74199ac424d7b12e92d6d914ca49b Mon Sep 17 00:00:00 2001 From: Boram Park Date: Fri, 23 Mar 2018 13:43:31 +0900 Subject: [PATCH 08/16] output: print out the missed log Change-Id: I862e3710709fbdad2a56902c263746e35589fc3d --- src/tdm_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tdm_output.c b/src/tdm_output.c index 0669b08..e37f9c5 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -1362,8 +1362,8 @@ done: if (private_output->current_dpms_value != dpms_value) { private_output->current_dpms_value = dpms_value; _tdm_output_call_thread_cb_dpms(private_output, dpms_value); - TDM_INFO("output(%d) dpms '%s' done", private_output->pipe, tdm_dpms_str(dpms_value)); } + TDM_INFO("output(%d) dpms '%s' done", private_output->pipe, tdm_dpms_str(dpms_value)); } else { tdm_output_dpms temp = TDM_OUTPUT_DPMS_OFF; -- 2.7.4 From 23ee1596262f465156893904abd900747112b326 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Fri, 23 Mar 2018 13:52:30 +0900 Subject: [PATCH 09/16] rename to tdm_log_printf Change-Id: I3e44a3e79c1e788d4a0c0d0c1f626f45c0a041a8 --- common/tdm_log.c | 2 +- include/tdm_log.h | 2 +- utests/src/ut_tdm.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/tdm_log.c b/common/tdm_log.c index 94aebc3..40a846a 100644 --- a/common/tdm_log.c +++ b/common/tdm_log.c @@ -182,7 +182,7 @@ _tdm_log_vprint_stdout(int level, const char *fmt, va_list ap) EXTERN void -tdm_log_print_stdout(int level, const char *fmt, ...) +tdm_log_printf(int level, const char *fmt, ...) { va_list arg; va_start(arg, fmt); diff --git a/include/tdm_log.h b/include/tdm_log.h index e25f685..3d0ea62 100644 --- a/include/tdm_log.h +++ b/include/tdm_log.h @@ -69,7 +69,7 @@ void tdm_log_enable_dlog(unsigned int enable); void tdm_log_set_debug_level(int level); void tdm_log_set_assert_level(int level); void tdm_log_set_path(const char *path); -void tdm_log_print_stdout(int level, const char *fmt, ...); +void tdm_log_printf(int level, const char *fmt, ...); void tdm_log_print(int level, const char *fmt, ...); void tdm_log_reset(void); diff --git a/utests/src/ut_tdm.h b/utests/src/ut_tdm.h index d4d1f34..4f899e1 100644 --- a/utests/src/ut_tdm.h +++ b/utests/src/ut_tdm.h @@ -38,9 +38,9 @@ extern bool enable_porting_debug; #define TDM_WRN(fmt, args...) tdm_log_print(TDM_LOG_LEVEL_WRN, fmt, ##args) #define TDM_ERR(fmt, args...) tdm_log_print(TDM_LOG_LEVEL_ERR, fmt, ##args) -#define TDM_UT_INFO(fmt, args...) tdm_log_print_stdout(TDM_LOG_LEVEL_INFO, fmt, ##args) -#define TDM_UT_WRN(fmt, args...) tdm_log_print_stdout(TDM_LOG_LEVEL_WRN, fmt, ##args) -#define TDM_UT_ERR(fmt, args...) tdm_log_print_stdout(TDM_LOG_LEVEL_ERR, fmt, ##args) +#define TDM_UT_INFO(fmt, args...) tdm_log_printf(TDM_LOG_LEVEL_INFO, fmt, ##args) +#define TDM_UT_WRN(fmt, args...) tdm_log_printf(TDM_LOG_LEVEL_WRN, fmt, ##args) +#define TDM_UT_ERR(fmt, args...) tdm_log_printf(TDM_LOG_LEVEL_ERR, fmt, ##args) #define TDM_UT_ENTRY() \ TDM_ERR("--------------------------------------------- %s", typeid(*this).name()) -- 2.7.4 From 2cb6415e16317a940a843c26151095993d8ef0ac Mon Sep 17 00:00:00 2001 From: Boram Park Date: Fri, 23 Mar 2018 14:11:07 +0900 Subject: [PATCH 10/16] package version up to 1.16.9 Change-Id: Icab648436c08d43e6d7bdf9592329b8a4aa84087 --- packaging/libtdm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index 7d1e8d3..15233e2 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define UTEST_GCOV 0 Name: libtdm -Version: 1.16.8 +Version: 1.16.9 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries -- 2.7.4 From 5097c66df44e1e41331707672c2409a3a5cc7e46 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 10:16:34 +0900 Subject: [PATCH 11/16] event_loop: ensure freeing sources when deinit Change-Id: I1eca94d1e572e7b6ce4d799c18f5d3d61a48e252 --- src/tdm_event_loop.c | 37 ++++++++++++++++++++++++++++--------- src/tdm_private_types.h | 2 ++ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/tdm_event_loop.c b/src/tdm_event_loop.c index 32b7674..e5e4ba2 100644 --- a/src/tdm_event_loop.c +++ b/src/tdm_event_loop.c @@ -40,23 +40,25 @@ #include "tdm_private.h" typedef struct _tdm_event_loop_source_base { + struct list_head link; + tdm_private_display *private_display; struct wl_event_source *wl_source; } tdm_event_loop_source_base; typedef struct _tdm_event_loop_source_fd { tdm_event_loop_source_base base; - tdm_private_display *private_display; tdm_event_loop_fd_handler func; void *user_data; } tdm_event_loop_source_fd; typedef struct _tdm_event_loop_source_timer { tdm_event_loop_source_base base; - tdm_private_display *private_display; tdm_event_loop_timer_handler func; void *user_data; } tdm_event_loop_source_timer; +static tdm_private_loop *keep_private_loop; + static tdm_error _tdm_event_loop_main_fd_handler(int fd, tdm_event_loop_mask mask, void *user_data) { @@ -112,6 +114,8 @@ tdm_event_loop_init(tdm_private_display *private_display) return TDM_ERROR_OPERATION_FAILED; } + LIST_INITHEAD(&private_loop->source_list); + private_loop->dpy = private_display; private_display->private_loop = private_loop; @@ -124,6 +128,8 @@ tdm_event_loop_init(tdm_private_display *private_display) return TDM_ERROR_OPERATION_FAILED; } + keep_private_loop = private_loop; + TDM_INFO("event loop fd(%d)", wl_event_loop_get_fd(private_loop->wl_loop)); return TDM_ERROR_NONE; @@ -133,6 +139,7 @@ INTERN void tdm_event_loop_deinit(tdm_private_display *private_display) { tdm_private_module *private_module = NULL; + tdm_event_loop_source_base *source = NULL, *ss = NULL; TDM_RETURN_IF_FAIL(TDM_MUTEX_IS_LOCKED()); @@ -151,11 +158,17 @@ tdm_event_loop_deinit(tdm_private_display *private_display) private_module->fd = -1; } - if (private_display->private_loop->wl_display) - wl_display_destroy(private_display->private_loop->wl_display); + LIST_FOR_EACH_ENTRY_SAFE(source, ss, &private_display->private_loop->source_list, link) { + tdm_event_loop_source_remove(source); + } + + wl_display_destroy(private_display->private_loop->wl_display); free(private_display->private_loop); private_display->private_loop = NULL; + keep_private_loop = NULL; + + TDM_INFO("event loop deinit done"); } INTERN void @@ -282,7 +295,7 @@ _tdm_event_loop_fd_func(int fd, uint32_t wl_mask, void *data) TDM_RETURN_VAL_IF_FAIL(fd_source, 1); TDM_RETURN_VAL_IF_FAIL(fd_source->func, 1); - private_display = fd_source->private_display; + private_display = fd_source->base.private_display; if (wl_mask & WL_EVENT_READABLE) mask |= TDM_EVENT_LOOP_READABLE; @@ -329,10 +342,10 @@ tdm_event_loop_add_fd_handler(tdm_display *dpy, int fd, tdm_event_loop_mask mask if (mask & TDM_EVENT_LOOP_WRITABLE) wl_mask |= WL_EVENT_WRITABLE; - fd_source->private_display = private_display; fd_source->func = func; fd_source->user_data = user_data; + fd_source->base.private_display = private_display; fd_source->base.wl_source = wl_event_loop_add_fd(private_loop->wl_loop, fd, wl_mask, _tdm_event_loop_fd_func, fd_source); @@ -343,6 +356,8 @@ tdm_event_loop_add_fd_handler(tdm_display *dpy, int fd, tdm_event_loop_mask mask return NULL; } + LIST_ADDTAIL(&fd_source->base.link, &private_loop->source_list); + if (error) *error = TDM_ERROR_NONE; @@ -382,7 +397,7 @@ _tdm_event_loop_timer_func(void *data) TDM_RETURN_VAL_IF_FAIL(timer_source, 1); TDM_RETURN_VAL_IF_FAIL(timer_source->func, 1); - private_display = timer_source->private_display; + private_display = timer_source->base.private_display; /* TDM event_loop function is actually for TDM backend module. When we call the * backend's functions, we have to lock the mutex. TDM backend shouldn't consider @@ -416,10 +431,10 @@ tdm_event_loop_add_timer_handler(tdm_display *dpy, tdm_event_loop_timer_handler timer_source = calloc(1, sizeof(tdm_event_loop_source_timer)); TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(timer_source, TDM_ERROR_OUT_OF_MEMORY, NULL); - timer_source->private_display = private_display; timer_source->func = func; timer_source->user_data = user_data; + timer_source->base.private_display = private_display; timer_source->base.wl_source = wl_event_loop_add_timer(private_loop->wl_loop, _tdm_event_loop_timer_func, timer_source); @@ -430,6 +445,8 @@ tdm_event_loop_add_timer_handler(tdm_display *dpy, tdm_event_loop_timer_handler return NULL; } + LIST_ADDTAIL(&timer_source->base.link, &private_loop->source_list); + if (error) *error = TDM_ERROR_NONE; @@ -459,9 +476,11 @@ tdm_event_loop_source_remove(tdm_event_loop_source *source) TDM_RETURN_IF_FAIL(TDM_MUTEX_IS_LOCKED()); - if (!base) + if (!base || !keep_private_loop) return; + LIST_DEL(&base->link); + wl_event_source_remove(base->wl_source); free(source); diff --git a/src/tdm_private_types.h b/src/tdm_private_types.h index d71664a..24045f1 100644 --- a/src/tdm_private_types.h +++ b/src/tdm_private_types.h @@ -356,6 +356,8 @@ struct _tdm_private_loop { * private_thread is NULL. */ tdm_private_thread *private_thread; + + struct list_head source_list; }; struct _tdm_private_output_vblank_handler { -- 2.7.4 From ee943142766fa6c3af53e44700c416e8cbbdf665 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 12:00:27 +0900 Subject: [PATCH 12/16] utests: fix getchar issue Change-Id: I1e217b2594be0b46564626d8fe103a49fb3f6349 --- utests/src/ut_tdm.h | 57 +++++++++++------------------------ utests/src/ut_tdm_backend_display.cpp | 17 +++++++++++ 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/utests/src/ut_tdm.h b/utests/src/ut_tdm.h index 4f899e1..63662e1 100644 --- a/utests/src/ut_tdm.h +++ b/utests/src/ut_tdm.h @@ -105,46 +105,6 @@ extern bool enable_porting_debug; } \ } while(0) -#define TDM_UT_ASK_YNR(fmt, ...) \ - do { \ - if (enable_porting_debug) { \ - char ch; \ - printf(fmt" [Y]es, [n]o, [r]etry: ", ##__VA_ARGS__); \ - do { \ - ch = getchar(); \ - if (ch == '\n') \ - ch = 'y'; \ - else { \ - char tch; \ - while ((tch = getchar()) != '\n' && tch != EOF); \ - } \ - } while (ch != 'y' && ch != 'Y' && ch != 'n' && ch != 'N' && ch != 'r' && ch != 'R'); \ - if (ch == 'n' || ch == 'N') \ - GTEST_FATAL_FAILURE_("tc failed"); \ - if (ch == 'r' || ch == 'R') \ - goto retry; \ - } \ - } while (0) - -#define TDM_UT_ASK_YN(fmt, ...) \ - do { \ - if (enable_porting_debug) { \ - char ch; \ - printf(fmt" [Y]es, [n]o: ", ##__VA_ARGS__); \ - do { \ - ch = getchar(); \ - if (ch == '\n') \ - ch = 'y'; \ - else { \ - char tch; \ - while ((tch = getchar()) != '\n' && tch != EOF); \ - } \ - } while (ch != 'y' && ch != 'Y' && ch != 'n' && ch != 'N'); \ - if (ch == 'n' || ch == 'N') \ - GTEST_FATAL_FAILURE_("tc failed"); \ - } \ - } while (0) - #define TDM_UT_SIZE_ALIGN(value, base) (((value) + ((base) - 1)) & ~((base) - 1)) #define TDM_UT_DUMP_DIR "/tmp/tdm_dump" @@ -278,4 +238,21 @@ public: void TearDown(void) { TDMBackendBasic::TearDown(); } }; +char ut_tdm_backend_getchar(void); + +#define TDM_UT_ASK_YNR(fmt, ...) \ + do { \ + if (enable_porting_debug) { \ + char ch; \ + do { \ + printf(fmt" [Y]es, [n]o, [r]etry): ", ##__VA_ARGS__); \ + ch = ut_tdm_backend_getchar(); \ + } while(ch != 'y' && ch != 'n' && ch != 'r'); \ + if (ch == 'n') \ + GTEST_FATAL_FAILURE_("tc failed"); \ + if (ch == 'r') \ + goto retry; \ + } \ + } while (0) + #endif // _UT_TDM_H_ diff --git a/utests/src/ut_tdm_backend_display.cpp b/utests/src/ut_tdm_backend_display.cpp index 69d7022..58127a8 100644 --- a/utests/src/ut_tdm_backend_display.cpp +++ b/utests/src/ut_tdm_backend_display.cpp @@ -122,6 +122,23 @@ void TDMBackendBasic::DestroyBuffers(void) } } +char +ut_tdm_backend_getchar(void) +{ + int c = getchar(); + int ch = c; + + if (ch == '\n' || ch == '\r') + ch = 'y'; + else if (ch < 'a') + ch += ('a' - 'A'); + + while (c != '\n' && c != EOF) + c = getchar(); + + return ch; +} + TEST_P(TDMBackendBasic, VerifyOutputObject) { tdm_error ret; -- 2.7.4 From 128c190a9a880f7af3b472b2e53546b56b8a1df2 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 14:11:32 +0900 Subject: [PATCH 13/16] utests: fix warning message Change-Id: Ied96807659fdc9189064edf1a6e2c1eaad20df36 --- utests/src/ut_tdm_backend_display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utests/src/ut_tdm_backend_display.cpp b/utests/src/ut_tdm_backend_display.cpp index 58127a8..e836407 100644 --- a/utests/src/ut_tdm_backend_display.cpp +++ b/utests/src/ut_tdm_backend_display.cpp @@ -81,7 +81,7 @@ void TDMBackendBasic::SetUp(void) ASSERT_GT(count, 0); layer_count += count; - layers = (tdm_layer**)realloc((void*)layers, sizeof(tdm_layer*) * layer_count); + layers = realloc(layers, layer_count * sizeof(tdm_layer*)); ASSERT_NE(layers, NULL); for (int l = 0; l < count; l++) { -- 2.7.4 From baa55bfdbc3876a956816e46ef996fdffd7b8248 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 14:16:46 +0900 Subject: [PATCH 14/16] package version up to 1.16.10 Change-Id: I1029cb73e838a998f046f5987b97c9c6c2486139 --- packaging/libtdm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index 15233e2..bc608fb 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define UTEST_GCOV 0 Name: libtdm -Version: 1.16.9 +Version: 1.16.10 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries -- 2.7.4 From f288cdff9b430931cfbbbcee0b9578286f44baa2 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 14:29:53 +0900 Subject: [PATCH 15/16] utests: fix build-error Change-Id: Id0f1188f4ebbf46af4549151a33dfef63c043c54 --- utests/src/ut_tdm_backend_display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utests/src/ut_tdm_backend_display.cpp b/utests/src/ut_tdm_backend_display.cpp index e836407..b0afa59 100644 --- a/utests/src/ut_tdm_backend_display.cpp +++ b/utests/src/ut_tdm_backend_display.cpp @@ -81,7 +81,7 @@ void TDMBackendBasic::SetUp(void) ASSERT_GT(count, 0); layer_count += count; - layers = realloc(layers, layer_count * sizeof(tdm_layer*)); + layers = (tdm_layer**)realloc(layers, layer_count * sizeof(tdm_layer*)); ASSERT_NE(layers, NULL); for (int l = 0; l < count; l++) { -- 2.7.4 From 2adc0c96b4af5f88b3560e8ebd0b595a3f483578 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 15:23:30 +0900 Subject: [PATCH 16/16] correct email address Change-Id: I75c8d8e7b4937d5812021890d7f47e34bb219fec --- client/tdm_client.c | 2 +- client/tdm_client.h | 2 +- client/tdm_client_types.h | 2 +- client/tdm_monitor.c | 2 +- common/tdm_log.c | 2 +- doc/tdm_doc.h | 2 +- include/tdm.h | 2 +- include/tdm_backend.h | 2 +- include/tdm_common.h | 2 +- include/tdm_config.h | 2 +- include/tdm_deprecated.h | 2 +- include/tdm_helper.h | 2 +- include/tdm_log.h | 2 +- include/tdm_types.h | 2 +- src/tdm.c | 2 +- src/tdm_backend.c | 2 +- src/tdm_buffer.c | 2 +- src/tdm_capture.c | 2 +- src/tdm_config.c | 2 +- src/tdm_display.c | 2 +- src/tdm_event_loop.c | 2 +- src/tdm_helper.c | 4 ++-- src/tdm_hwc_window.c | 2 +- src/tdm_layer.c | 2 +- src/tdm_macro.h | 2 +- src/tdm_monitor_server.c | 2 +- src/tdm_output.c | 2 +- src/tdm_pp.c | 2 +- src/tdm_private.h | 2 +- src/tdm_private_types.h | 2 +- src/tdm_server.c | 2 +- src/tdm_thread.c | 2 +- src/tdm_thread.h | 2 +- src/tdm_vblank.c | 2 +- tools/tdm_test_client.c | 2 +- tools/tdm_test_server.c | 2 +- 36 files changed, 37 insertions(+), 37 deletions(-) diff --git a/client/tdm_client.c b/client/tdm_client.c index 1d78e39..4023208 100644 --- a/client/tdm_client.c +++ b/client/tdm_client.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/client/tdm_client.h b/client/tdm_client.h index 2b9dc1e..a13bf2a 100644 --- a/client/tdm_client.h +++ b/client/tdm_client.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/client/tdm_client_types.h b/client/tdm_client_types.h index f799c0b..bd7e8a5 100644 --- a/client/tdm_client_types.h +++ b/client/tdm_client_types.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/client/tdm_monitor.c b/client/tdm_monitor.c index 30a1a12..b4ab390 100644 --- a/client/tdm_monitor.c +++ b/client/tdm_monitor.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/common/tdm_log.c b/common/tdm_log.c index 40a846a..ac7666d 100644 --- a/common/tdm_log.c +++ b/common/tdm_log.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/doc/tdm_doc.h b/doc/tdm_doc.h index b7e3529..1d83a7d 100644 --- a/doc/tdm_doc.h +++ b/doc/tdm_doc.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/include/tdm.h b/include/tdm.h index 0340142..0f9bf5d 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/include/tdm_backend.h b/include/tdm_backend.h index 4e8aee3..970cbc4 100644 --- a/include/tdm_backend.h +++ b/include/tdm_backend.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/include/tdm_common.h b/include/tdm_common.h index 35d5c91..ef5ee15 100644 --- a/include/tdm_common.h +++ b/include/tdm_common.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/include/tdm_config.h b/include/tdm_config.h index 0428b56..1b1e36a 100644 --- a/include/tdm_config.h +++ b/include/tdm_config.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/include/tdm_deprecated.h b/include/tdm_deprecated.h index b52eaf3..e6af2ca 100644 --- a/include/tdm_deprecated.h +++ b/include/tdm_deprecated.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/include/tdm_helper.h b/include/tdm_helper.h index f1f305b..62f3cb3 100644 --- a/include/tdm_helper.h +++ b/include/tdm_helper.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/include/tdm_log.h b/include/tdm_log.h index 3d0ea62..f1b3cdc 100644 --- a/include/tdm_log.h +++ b/include/tdm_log.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/include/tdm_types.h b/include/tdm_types.h index a718f9a..68f3096 100644 --- a/include/tdm_types.h +++ b/include/tdm_types.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm.c b/src/tdm.c index bb630d5..5d9e04d 100644 --- a/src/tdm.c +++ b/src/tdm.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_backend.c b/src/tdm_backend.c index d2488d3..238d085 100644 --- a/src/tdm_backend.c +++ b/src/tdm_backend.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_buffer.c b/src/tdm_buffer.c index 72d9d17..81716b5 100644 --- a/src/tdm_buffer.c +++ b/src/tdm_buffer.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_capture.c b/src/tdm_capture.c index c3da6b7..4b58fbd 100644 --- a/src/tdm_capture.c +++ b/src/tdm_capture.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_config.c b/src/tdm_config.c index fb361d2..9918fa4 100644 --- a/src/tdm_config.c +++ b/src/tdm_config.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_display.c b/src/tdm_display.c index ff605e2..57e5a11 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_event_loop.c b/src/tdm_event_loop.c index e5e4ba2..2e7fbbd 100644 --- a/src/tdm_event_loop.c +++ b/src/tdm_event_loop.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_helper.c b/src/tdm_helper.c index 2e00648..61971e5 100644 --- a/src/tdm_helper.c +++ b/src/tdm_helper.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -1077,4 +1077,4 @@ tdm_helper_output_vblank_timer_expired(tdm_output *output) TDM_RETURN_VAL_IF_FAIL(private_output != NULL, -1); return private_output->vblank_timeout_timer_expired; -} \ No newline at end of file +} diff --git a/src/tdm_hwc_window.c b/src/tdm_hwc_window.c index 97169e1..c3619ed 100644 --- a/src/tdm_hwc_window.c +++ b/src/tdm_hwc_window.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_layer.c b/src/tdm_layer.c index daefb98..d8503a5 100644 --- a/src/tdm_layer.c +++ b/src/tdm_layer.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_macro.h b/src/tdm_macro.h index 14c0f7a..00af3ef 100644 --- a/src/tdm_macro.h +++ b/src/tdm_macro.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_monitor_server.c b/src/tdm_monitor_server.c index e566681..a68ce21 100644 --- a/src/tdm_monitor_server.c +++ b/src/tdm_monitor_server.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_output.c b/src/tdm_output.c index e37f9c5..a8b5065 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_pp.c b/src/tdm_pp.c index bca4cd8..1a0e91e 100644 --- a/src/tdm_pp.c +++ b/src/tdm_pp.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_private.h b/src/tdm_private.h index 43c639c..2d60eb7 100644 --- a/src/tdm_private.h +++ b/src/tdm_private.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_private_types.h b/src/tdm_private_types.h index 24045f1..980ebfe 100644 --- a/src/tdm_private_types.h +++ b/src/tdm_private_types.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_server.c b/src/tdm_server.c index 13a7867..30bb475 100644 --- a/src/tdm_server.c +++ b/src/tdm_server.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_thread.c b/src/tdm_thread.c index 20e995f..2ca90a0 100644 --- a/src/tdm_thread.c +++ b/src/tdm_thread.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_thread.h b/src/tdm_thread.h index 57c4c6f..84ad930 100644 --- a/src/tdm_thread.h +++ b/src/tdm_thread.h @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/src/tdm_vblank.c b/src/tdm_vblank.c index cbedea7..4bfa556 100644 --- a/src/tdm_vblank.c +++ b/src/tdm_vblank.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/tools/tdm_test_client.c b/tools/tdm_test_client.c index 11976fb..1031685 100644 --- a/tools/tdm_test_client.c +++ b/tools/tdm_test_client.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the diff --git a/tools/tdm_test_server.c b/tools/tdm_test_server.c index 17c0121..535462f 100644 --- a/tools/tdm_test_server.c +++ b/tools/tdm_test_server.c @@ -9,7 +9,7 @@ * Taeheon Kim , * YoungJun Cho , * SooChan Lim , - * Boram Park + * Boram Park * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the -- 2.7.4