From baa55bfdbc3876a956816e46ef996fdffd7b8248 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 14:16:46 +0900 Subject: [PATCH 01/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 02/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 03/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 From c312230a89afa92bf752c17d658c3b310178e523 Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Mon, 26 Mar 2018 18:56:57 +0900 Subject: [PATCH 04/16] utests: change pp scale test src buffer size Change-Id: Ia80d1fea3d626132b4ff6ee7b638a58048d53a17 Signed-off-by: Junkyeong Kim --- utests/src/ut_tdm_backend_pp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utests/src/ut_tdm_backend_pp.cpp b/utests/src/ut_tdm_backend_pp.cpp index e65de76..78b268f 100644 --- a/utests/src/ut_tdm_backend_pp.cpp +++ b/utests/src/ut_tdm_backend_pp.cpp @@ -626,7 +626,7 @@ TEST_P(TDMBackendPP, PPConvertScale) ASSERT_EQ(PreparePP(), true); - ASSERT_EQ(PrepareBuffers(TDM_UT_BUFFER_SIZE, TDM_UT_BUFFER_SIZE / 2, dst_formats[f], + ASSERT_EQ(PrepareBuffers(mode->hdisplay / 2, mode->vdisplay / 4, dst_formats[f], mode->hdisplay, mode->vdisplay / 2, dst_formats[f], TDM_TRANSFORM_NORMAL), true); -- 2.7.4 From fea25ace45feadad465b8b3a65233315ca66bc22 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 20:19:10 +0900 Subject: [PATCH 05/16] display: move function position Change-Id: Icccd42165bd5b19f97ebb2b0e358318004ab346b --- src/tdm.c | 302 -------------------------------------------------- src/tdm_display.c | 321 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 311 insertions(+), 312 deletions(-) diff --git a/src/tdm.c b/src/tdm.c index 5d9e04d..b2e2c35 100644 --- a/src/tdm.c +++ b/src/tdm.c @@ -1213,305 +1213,3 @@ tdm_output_is_valid(tdm_output *output) return 0; } - -/* LCOV_EXCL_START */ -INTERN int -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 0; - - if (TDM_BACKEND_GET_ABI_MINOR(module->abi_version) < abimin) - return 0; - - return 1; -} - -INTERN tdm_error -tdm_display_enable_debug_module(const char*modules) -{ - char temp[TDM_PATH_LEN]; - char *arg; - char *end; - - snprintf(temp, TDM_PATH_LEN, "%s", modules); - - tdm_debug_module = 0; - - arg = strtok_r(temp, TDM_CONFIG_DELIM, &end); - while (arg) { - if (!strncmp(arg, "none", 4)) { - tdm_debug_module = 0; - return TDM_ERROR_NONE; - } - if (!strncmp(arg, "all", 3)) { - tdm_debug_module = 0xFFFFFFFF; - return TDM_ERROR_NONE; - } - if (!strncmp(arg, "buffer", 6)) - tdm_debug_module |= TDM_DEBUG_BUFFER; - else if (!strncmp(arg, "event", 5)) - tdm_debug_module |= TDM_DEBUG_EVENT; - else if (!strncmp(arg, "thread", 6)) - tdm_debug_module |= TDM_DEBUG_THREAD; - else if (!strncmp(arg, "mutex", 5)) - tdm_debug_module |= TDM_DEBUG_MUTEX; - else if (!strncmp(arg, "vblank", 6)) - tdm_debug_module |= TDM_DEBUG_VBLANK; - else if (!strncmp(arg, "commit", 6)) - tdm_debug_module |= TDM_DEBUG_COMMIT; - - arg = strtok_r(NULL, TDM_CONFIG_DELIM, &end); - } - - TDM_INFO("module debugging... '%s'", modules); - - return TDM_ERROR_NONE; -} - -INTERN tdm_error -tdm_display_enable_dump(tdm_private_display *private_display, const char *dump_str, char *reply, int *len) -{ - char temp[TDM_PATH_LEN] = {0,}, temp2[TDM_PATH_LEN] = {0,}; - char *path = NULL, *path2; - char *arg; - char *end; - - snprintf(temp2, TDM_PATH_LEN, "%s", dump_str); - path2 = strtostr(temp, TDM_PATH_LEN, temp2, "@"); - if (!path2 || path2[0] == '\0') - path2 = TDM_DUMP_DIR; - else - path2++; - - tdm_debug_dump = 0; - - snprintf(temp, sizeof(temp), "%s", dump_str); - arg = strtok_r(temp, ",", &end); - TDM_GOTO_IF_FAIL(arg != NULL, done); - - if (!strncmp(arg, "none", 4)) { - tdm_debug_dump = 0; - TDM_SNPRINTF(reply, len, "path: %s\n", (tdm_debug_dump_dir) ? : "unknown"); - if (tdm_debug_dump_dir) { - free(tdm_debug_dump_dir); - tdm_debug_dump_dir = NULL; - } - goto done; - } - - path = tdm_helper_dump_make_directory(path2, reply, len); - TDM_GOTO_IF_FAIL(path != NULL, done); - - if (!strncmp(arg, "current", 7)) { - tdm_private_module *b = NULL; - tdm_private_output *o = NULL; - - if (!private_display) { - TDM_WRN("no private_display"); - goto done; - } - - LIST_FOR_EACH_ENTRY(b, &private_display->module_list, link) { - LIST_FOR_EACH_ENTRY(o, &b->output_list, link) { - tdm_private_layer *l = NULL; - LIST_FOR_EACH_ENTRY(l, &o->layer_list, link) { - char str[TDM_PATH_LEN]; - if (l->usable || l->caps.capabilities & TDM_LAYER_CAPABILITY_VIDEO) - continue; - if (!l->showing_buffer) - continue; - snprintf(str, TDM_PATH_LEN, "layer_%d_%d", o->index, l->index); - tdm_helper_dump_buffer_str(l->showing_buffer->buffer, path, str); - } - } - } - - TDM_SNPRINTF(reply, len, "path: %s\n", path); - goto done; - } - - TDM_SNPRINTF(reply, len, "dump: %s\n", arg); - - while (arg) { - if (!strncmp(arg, "all", 3)) { - tdm_debug_dump = 0xFFFFFFFF; - goto done; - } else if (!strncmp(arg, "layer", 5)) { - tdm_debug_dump |= TDM_DUMP_FLAG_LAYER; - } else if (!strncmp(arg, "pp", 2)) { - tdm_debug_dump |= TDM_DUMP_FLAG_PP; - } else if (!strncmp(arg, "capture", 7)) { - tdm_debug_dump |= TDM_DUMP_FLAG_CAPTURE; - } else if (!strncmp(arg, "window", 6)) { - tdm_debug_dump |= TDM_DUMP_FLAG_WINDOW; - } else - goto done; - - arg = strtok_r(NULL, ",", &end); - } - - if (tdm_debug_dump_dir) - free(tdm_debug_dump_dir); - - tdm_debug_dump_dir = strndup(path, TDM_PATH_LEN); - - TDM_INFO("dump... '%s'", dump_str); - -done: - if (path) - free(path); - - return TDM_ERROR_NONE; -} - -static void -_tdm_display_ttrace_vblank_cb(tdm_vblank *vblank, tdm_error error, unsigned int sequence, - unsigned int tv_sec, unsigned int tv_usec, void *user_data) -{ - tdm_error ret = TDM_ERROR_NONE; - - TDM_TRACE_MARK("VSYNC"); - - ret = tdm_vblank_wait(vblank, 0, 0, 1, _tdm_display_ttrace_vblank_cb, NULL); - TDM_RETURN_IF_FAIL(ret == TDM_ERROR_NONE); -} - -INTERN tdm_error -tdm_display_enable_ttrace_vblank(tdm_display *dpy, tdm_output *output, int enable) -{ - tdm_private_display *private_display = dpy; - tdm_private_module *private_module = NULL; - tdm_private_output *private_output = NULL; - const tdm_output_mode *mode = NULL; - tdm_vblank *vblank = NULL; - tdm_error ret = TDM_ERROR_NONE; - - if (!enable) { - LIST_FOR_EACH_ENTRY(private_module, &private_display->module_list, link) { - LIST_FOR_EACH_ENTRY(private_output, &private_module->output_list, link) { - if (private_output->ttrace_vblank) - tdm_vblank_destroy(private_output->ttrace_vblank); - private_output->ttrace_vblank = NULL; - } - } - return TDM_ERROR_NONE; - } - - private_output = output; - TDM_RETURN_VAL_IF_FAIL(private_output != NULL, TDM_ERROR_INVALID_PARAMETER); - - if (private_output->ttrace_vblank) - return TDM_ERROR_NONE; - - vblank = tdm_vblank_create(private_display, output, &ret); - TDM_RETURN_VAL_IF_FAIL(vblank != NULL, ret); - - ret = tdm_output_get_mode(output, &mode); - TDM_GOTO_IF_FAIL(mode != NULL, enable_fail); - - ret = tdm_vblank_set_fps(vblank, mode->vrefresh); - TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, enable_fail); - - ret = tdm_vblank_set_enable_fake(vblank, 1); - TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, enable_fail); - - ret = tdm_vblank_wait(vblank, 0, 0, 1, _tdm_display_ttrace_vblank_cb, NULL); - TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, enable_fail); - - private_output->ttrace_vblank = vblank; - - return TDM_ERROR_NONE; - -enable_fail: - if (vblank) - tdm_vblank_destroy(vblank); - - return ret; -} - -INTERN tdm_error -tdm_display_enable_ttrace(tdm_private_display *private_display, const char *ttrace, int output_id, char *reply, int *len) -{ - char temp[TDM_PATH_LEN]; - char *arg; - char *end; - tdm_output *output; - tdm_error ret; - tdm_output_type type; - - snprintf(temp, TDM_PATH_LEN, "%s", ttrace); - - tdm_ttrace_output = output_id; - tdm_ttrace_module = 0; - - output = tdm_display_get_output(private_display, output_id, &ret); - if (!output) { - TDM_SNPRINTF(reply, len, "can't find the output_id(%d)\n", output_id); - return ret; - } - - ret = tdm_output_get_output_type(output, &type); - if (ret != TDM_ERROR_NONE) { - TDM_SNPRINTF(reply, len, "can't find the type of output_id(%d)\n", output_id); - return ret; - } - - arg = strtok_r(temp, TDM_CONFIG_DELIM, &end); - while (arg) { - if (!strncmp(arg, "none", 4)) - tdm_ttrace_module = 0; - else if (!strncmp(arg, "all", 3)) - tdm_ttrace_module = 0xFFFFFFFF; - else if (!strncmp(arg, "vsync", 5)) - tdm_ttrace_module |= TDM_TTRACE_VSYNC; - else if (!strncmp(arg, "client_vblank", 13)) - tdm_ttrace_module |= TDM_TTRACE_CLIENT_VBLANK; - else if (!strncmp(arg, "server_vblank", 13)) - tdm_ttrace_module |= TDM_TTRACE_SERVER_VBLANK; - else if (!strncmp(arg, "vblank", 6)) - tdm_ttrace_module |= TDM_TTRACE_VBLANK; - else if (!strncmp(arg, "layer", 5)) - tdm_ttrace_module |= TDM_TTRACE_LAYER; - else if (!strncmp(arg, "pp", 2)) - tdm_ttrace_module |= TDM_TTRACE_PP; - else if (!strncmp(arg, "capture", 7)) - tdm_ttrace_module |= TDM_TTRACE_CAPTURE; - else { - tdm_ttrace_module = 0; - tdm_display_enable_ttrace_vblank(private_display, NULL, 0); - tdm_server_enable_ttrace_client_vblank(private_display, NULL, 0); - TDM_SNPRINTF(reply, len, "unknown option: '%s'\n", arg); - return TDM_ERROR_NONE; - } - - arg = strtok_r(NULL, TDM_CONFIG_DELIM, &end); - } - - TDM_SNPRINTF(reply, len, "ttrace debugging... '%s' %x\n", ttrace, tdm_ttrace_module); - - if (tdm_ttrace_module & TDM_TTRACE_VSYNC) - tdm_display_enable_ttrace_vblank(private_display, output, 1); - else - tdm_display_enable_ttrace_vblank(private_display, NULL, 0); - - if (tdm_ttrace_module & TDM_TTRACE_CLIENT_VBLANK) - tdm_server_enable_ttrace_client_vblank(private_display, output, 1); - else - tdm_server_enable_ttrace_client_vblank(private_display, NULL, 0); - - return TDM_ERROR_NONE; -} - -INTERN tdm_error -tdm_display_enable_fps(tdm_private_display *private_display, int enable) -{ - private_display->print_fps = enable; - - TDM_INFO("print fps: %s", (enable) ? "enable" : "disable"); - - return TDM_ERROR_NONE; -} -/* LCOV_EXCL_STOP */ diff --git a/src/tdm_display.c b/src/tdm_display.c index 57e5a11..d9741a4 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -63,6 +63,292 @@ private_module = (tdm_private_module*)module; \ private_display = private_module->private_display; +INTERN tdm_error +tdm_display_enable_debug_module(const char*modules) +{ + char temp[TDM_PATH_LEN]; + char *arg; + char *end; + + snprintf(temp, TDM_PATH_LEN, "%s", modules); + + tdm_debug_module = 0; + + arg = strtok_r(temp, TDM_CONFIG_DELIM, &end); + while (arg) { + if (!strncmp(arg, "none", 4)) { + tdm_debug_module = 0; + return TDM_ERROR_NONE; + } + if (!strncmp(arg, "all", 3)) { + tdm_debug_module = 0xFFFFFFFF; + return TDM_ERROR_NONE; + } + if (!strncmp(arg, "buffer", 6)) + tdm_debug_module |= TDM_DEBUG_BUFFER; + else if (!strncmp(arg, "event", 5)) + tdm_debug_module |= TDM_DEBUG_EVENT; + else if (!strncmp(arg, "thread", 6)) + tdm_debug_module |= TDM_DEBUG_THREAD; + else if (!strncmp(arg, "mutex", 5)) + tdm_debug_module |= TDM_DEBUG_MUTEX; + else if (!strncmp(arg, "vblank", 6)) + tdm_debug_module |= TDM_DEBUG_VBLANK; + else if (!strncmp(arg, "commit", 6)) + tdm_debug_module |= TDM_DEBUG_COMMIT; + + arg = strtok_r(NULL, TDM_CONFIG_DELIM, &end); + } + + TDM_INFO("module debugging... '%s'", modules); + + return TDM_ERROR_NONE; +} + +INTERN tdm_error +tdm_display_enable_dump(tdm_private_display *private_display, const char *dump_str, char *reply, int *len) +{ + char temp[TDM_PATH_LEN] = {0,}, temp2[TDM_PATH_LEN] = {0,}; + char *path = NULL, *path2; + char *arg; + char *end; + + snprintf(temp2, TDM_PATH_LEN, "%s", dump_str); + path2 = strtostr(temp, TDM_PATH_LEN, temp2, "@"); + if (!path2 || path2[0] == '\0') + path2 = TDM_DUMP_DIR; + else + path2++; + + tdm_debug_dump = 0; + + snprintf(temp, sizeof(temp), "%s", dump_str); + arg = strtok_r(temp, ",", &end); + TDM_GOTO_IF_FAIL(arg != NULL, done); + + if (!strncmp(arg, "none", 4)) { + tdm_debug_dump = 0; + TDM_SNPRINTF(reply, len, "path: %s\n", (tdm_debug_dump_dir) ? : "unknown"); + if (tdm_debug_dump_dir) { + free(tdm_debug_dump_dir); + tdm_debug_dump_dir = NULL; + } + goto done; + } + + path = tdm_helper_dump_make_directory(path2, reply, len); + TDM_GOTO_IF_FAIL(path != NULL, done); + + if (!strncmp(arg, "current", 7)) { + tdm_private_module *b = NULL; + tdm_private_output *o = NULL; + + if (!private_display) { + TDM_WRN("no private_display"); + goto done; + } + + LIST_FOR_EACH_ENTRY(b, &private_display->module_list, link) { + LIST_FOR_EACH_ENTRY(o, &b->output_list, link) { + tdm_private_layer *l = NULL; + LIST_FOR_EACH_ENTRY(l, &o->layer_list, link) { + char str[TDM_PATH_LEN]; + if (l->usable || l->caps.capabilities & TDM_LAYER_CAPABILITY_VIDEO) + continue; + if (!l->showing_buffer) + continue; + snprintf(str, TDM_PATH_LEN, "layer_%d_%d", o->index, l->index); + tdm_helper_dump_buffer_str(l->showing_buffer->buffer, path, str); + } + } + } + + TDM_SNPRINTF(reply, len, "path: %s\n", path); + goto done; + } + + TDM_SNPRINTF(reply, len, "dump: %s\n", arg); + + while (arg) { + if (!strncmp(arg, "all", 3)) { + tdm_debug_dump = 0xFFFFFFFF; + goto done; + } else if (!strncmp(arg, "layer", 5)) { + tdm_debug_dump |= TDM_DUMP_FLAG_LAYER; + } else if (!strncmp(arg, "pp", 2)) { + tdm_debug_dump |= TDM_DUMP_FLAG_PP; + } else if (!strncmp(arg, "capture", 7)) { + tdm_debug_dump |= TDM_DUMP_FLAG_CAPTURE; + } else if (!strncmp(arg, "window", 6)) { + tdm_debug_dump |= TDM_DUMP_FLAG_WINDOW; + } else + goto done; + + arg = strtok_r(NULL, ",", &end); + } + + if (tdm_debug_dump_dir) + free(tdm_debug_dump_dir); + + tdm_debug_dump_dir = strndup(path, TDM_PATH_LEN); + + TDM_INFO("dump... '%s'", dump_str); + +done: + if (path) + free(path); + + return TDM_ERROR_NONE; +} + +static void +_tdm_display_ttrace_vblank_cb(tdm_vblank *vblank, tdm_error error, unsigned int sequence, + unsigned int tv_sec, unsigned int tv_usec, void *user_data) +{ + tdm_error ret = TDM_ERROR_NONE; + + TDM_TRACE_MARK("VSYNC"); + + ret = tdm_vblank_wait(vblank, 0, 0, 1, _tdm_display_ttrace_vblank_cb, NULL); + TDM_RETURN_IF_FAIL(ret == TDM_ERROR_NONE); +} + +INTERN tdm_error +tdm_display_enable_ttrace_vblank(tdm_display *dpy, tdm_output *output, int enable) +{ + tdm_private_display *private_display = dpy; + tdm_private_module *private_module = NULL; + tdm_private_output *private_output = NULL; + const tdm_output_mode *mode = NULL; + tdm_vblank *vblank = NULL; + tdm_error ret = TDM_ERROR_NONE; + + if (!enable) { + LIST_FOR_EACH_ENTRY(private_module, &private_display->module_list, link) { + LIST_FOR_EACH_ENTRY(private_output, &private_module->output_list, link) { + if (private_output->ttrace_vblank) + tdm_vblank_destroy(private_output->ttrace_vblank); + private_output->ttrace_vblank = NULL; + } + } + return TDM_ERROR_NONE; + } + + private_output = output; + TDM_RETURN_VAL_IF_FAIL(private_output != NULL, TDM_ERROR_INVALID_PARAMETER); + + if (private_output->ttrace_vblank) + return TDM_ERROR_NONE; + + vblank = tdm_vblank_create(private_display, output, &ret); + TDM_RETURN_VAL_IF_FAIL(vblank != NULL, ret); + + ret = tdm_output_get_mode(output, &mode); + TDM_GOTO_IF_FAIL(mode != NULL, enable_fail); + + ret = tdm_vblank_set_fps(vblank, mode->vrefresh); + TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, enable_fail); + + ret = tdm_vblank_set_enable_fake(vblank, 1); + TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, enable_fail); + + ret = tdm_vblank_wait(vblank, 0, 0, 1, _tdm_display_ttrace_vblank_cb, NULL); + TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, enable_fail); + + private_output->ttrace_vblank = vblank; + + return TDM_ERROR_NONE; + +enable_fail: + if (vblank) + tdm_vblank_destroy(vblank); + + return ret; +} + +INTERN tdm_error +tdm_display_enable_ttrace(tdm_private_display *private_display, const char *ttrace, int output_id, char *reply, int *len) +{ + char temp[TDM_PATH_LEN]; + char *arg; + char *end; + tdm_output *output; + tdm_error ret; + tdm_output_type type; + + snprintf(temp, TDM_PATH_LEN, "%s", ttrace); + + tdm_ttrace_output = output_id; + tdm_ttrace_module = 0; + + output = tdm_display_get_output(private_display, output_id, &ret); + if (!output) { + TDM_SNPRINTF(reply, len, "can't find the output_id(%d)\n", output_id); + return ret; + } + + ret = tdm_output_get_output_type(output, &type); + if (ret != TDM_ERROR_NONE) { + TDM_SNPRINTF(reply, len, "can't find the type of output_id(%d)\n", output_id); + return ret; + } + + arg = strtok_r(temp, TDM_CONFIG_DELIM, &end); + while (arg) { + if (!strncmp(arg, "none", 4)) + tdm_ttrace_module = 0; + else if (!strncmp(arg, "all", 3)) + tdm_ttrace_module = 0xFFFFFFFF; + else if (!strncmp(arg, "vsync", 5)) + tdm_ttrace_module |= TDM_TTRACE_VSYNC; + else if (!strncmp(arg, "client_vblank", 13)) + tdm_ttrace_module |= TDM_TTRACE_CLIENT_VBLANK; + else if (!strncmp(arg, "server_vblank", 13)) + tdm_ttrace_module |= TDM_TTRACE_SERVER_VBLANK; + else if (!strncmp(arg, "vblank", 6)) + tdm_ttrace_module |= TDM_TTRACE_VBLANK; + else if (!strncmp(arg, "layer", 5)) + tdm_ttrace_module |= TDM_TTRACE_LAYER; + else if (!strncmp(arg, "pp", 2)) + tdm_ttrace_module |= TDM_TTRACE_PP; + else if (!strncmp(arg, "capture", 7)) + tdm_ttrace_module |= TDM_TTRACE_CAPTURE; + else { + tdm_ttrace_module = 0; + tdm_display_enable_ttrace_vblank(private_display, NULL, 0); + tdm_server_enable_ttrace_client_vblank(private_display, NULL, 0); + TDM_SNPRINTF(reply, len, "unknown option: '%s'\n", arg); + return TDM_ERROR_NONE; + } + + arg = strtok_r(NULL, TDM_CONFIG_DELIM, &end); + } + + TDM_SNPRINTF(reply, len, "ttrace debugging... '%s' %x\n", ttrace, tdm_ttrace_module); + + if (tdm_ttrace_module & TDM_TTRACE_VSYNC) + tdm_display_enable_ttrace_vblank(private_display, output, 1); + else + tdm_display_enable_ttrace_vblank(private_display, NULL, 0); + + if (tdm_ttrace_module & TDM_TTRACE_CLIENT_VBLANK) + tdm_server_enable_ttrace_client_vblank(private_display, output, 1); + else + tdm_server_enable_ttrace_client_vblank(private_display, NULL, 0); + + return TDM_ERROR_NONE; +} + +INTERN tdm_error +tdm_display_enable_fps(tdm_private_display *private_display, int enable) +{ + private_display->print_fps = enable; + + TDM_INFO("print fps: %s", (enable) ? "enable" : "disable"); + + return TDM_ERROR_NONE; +} + EXTERN tdm_error tdm_display_get_capabilities(tdm_display *dpy, tdm_display_capability *capabilities) @@ -485,6 +771,22 @@ tdm_display_get_backend_info(tdm_display *dpy, const char **name, return ret; } +EXTERN tdm_pp * +tdm_display_create_pp(tdm_display *dpy, tdm_error *error) +{ + tdm_pp *pp; + + DISPLAY_FUNC_ENTRY_ERROR(); + + _pthread_mutex_lock(&private_display->lock); + + pp = (tdm_pp *)tdm_pp_create_internal(private_display->pp_module, error); + + _pthread_mutex_unlock(&private_display->lock); + + return pp; +} + EXTERN tdm_error tdm_module_get_info(tdm_module *module, const char **name, const char **vendor, int *major, int *minor) @@ -511,18 +813,17 @@ tdm_module_get_info(tdm_module *module, const char **name, return ret; } -EXTERN tdm_pp * -tdm_display_create_pp(tdm_display *dpy, tdm_error *error) +INTERN int +tdm_module_check_abi(tdm_private_module *private_module, int abimaj, int abimin) { - tdm_pp *pp; - - DISPLAY_FUNC_ENTRY_ERROR(); + tdm_backend_module *module = private_module->module_data; - _pthread_mutex_lock(&private_display->lock); + if (TDM_BACKEND_GET_ABI_MAJOR(module->abi_version) < abimaj) + return 0; - pp = (tdm_pp *)tdm_pp_create_internal(private_display->pp_module, error); + if (TDM_BACKEND_GET_ABI_MINOR(module->abi_version) < abimin) + return 0; - _pthread_mutex_unlock(&private_display->lock); - - return pp; + return 1; } + -- 2.7.4 From d5c10eca115610d5b5b85152bccbc22c96e47267 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 20:22:46 +0900 Subject: [PATCH 06/16] common: remove unuseful functions Change-Id: I47dd2ac0cde4a5acb2d0d6a2ac4bf39c9af00aa2 --- src/tdm.c | 28 ---------------------------- src/tdm_display.c | 2 -- src/tdm_output.c | 10 +++++----- src/tdm_private.h | 4 ---- src/tdm_vblank.c | 4 ++-- 5 files changed, 7 insertions(+), 41 deletions(-) diff --git a/src/tdm.c b/src/tdm.c index b2e2c35..bdb2a87 100644 --- a/src/tdm.c +++ b/src/tdm.c @@ -658,7 +658,6 @@ EXTERN tdm_error tdm_display_update(tdm_display *dpy) { TDM_RETURN_VAL_IF_FAIL(dpy != NULL, TDM_ERROR_INVALID_PARAMETER); - TDM_RETURN_VAL_IF_FAIL(tdm_display_is_valid(dpy), TDM_ERROR_INVALID_PARAMETER); TDM_DEPRECATED(NULL); @@ -1130,8 +1129,6 @@ tdm_display_deinit(tdm_display *dpy) if (!private_display) return; - TDM_RETURN_IF_FAIL(tdm_display_is_valid(dpy)); - pthread_mutex_lock(&gLock); private_display->init_count--; @@ -1188,28 +1185,3 @@ tdm_display_get(void) return g_private_display; } -INTERN int -tdm_display_is_valid(tdm_display *dpy) -{ - if (dpy != NULL && dpy == g_private_display) - return 1; - return 0; -} - -INTERN int -tdm_output_is_valid(tdm_output *output) -{ - tdm_private_module *b = NULL; - tdm_private_output *o = NULL; - - if (!output || !g_private_display) - return 0; - - LIST_FOR_EACH_ENTRY(b, &g_private_display->module_list, link) { - LIST_FOR_EACH_ENTRY(o, &b->output_list, link) - if (o == output) - return 1; - } - - return 0; -} diff --git a/src/tdm_display.c b/src/tdm_display.c index d9741a4..d2fcde4 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -45,14 +45,12 @@ tdm_private_display *private_display; \ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\ TDM_RETURN_VAL_IF_FAIL(dpy != NULL, TDM_ERROR_INVALID_PARAMETER); \ - TDM_RETURN_VAL_IF_FAIL(tdm_display_is_valid(dpy), TDM_ERROR_INVALID_PARAMETER); \ private_display = (tdm_private_display*)dpy; #define DISPLAY_FUNC_ENTRY_ERROR() \ tdm_private_display *private_display; \ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\ TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(dpy != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); \ - TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(tdm_display_is_valid(dpy), TDM_ERROR_INVALID_PARAMETER, NULL); \ private_display = (tdm_private_display*)dpy; #define BACKEND_FUNC_ENTRY() \ diff --git a/src/tdm_output.c b/src/tdm_output.c index a8b5065..b66c27b 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -45,7 +45,7 @@ tdm_private_display *private_display; \ tdm_private_output *private_output; \ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\ - TDM_RETURN_VAL_IF_FAIL(tdm_output_is_valid(output), TDM_ERROR_INVALID_PARAMETER); \ + TDM_RETURN_VAL_IF_FAIL(output != NULL, TDM_ERROR_INVALID_PARAMETER); \ private_output = (tdm_private_output*)output; \ private_display = private_output->private_display @@ -53,7 +53,7 @@ tdm_private_display *private_display; \ tdm_private_output *private_output; \ tdm_error ret = TDM_ERROR_NONE; /* default TDM_ERROR_NONE */\ - TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(tdm_output_is_valid(output), TDM_ERROR_INVALID_PARAMETER, NULL); \ + TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(output != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); \ private_output = (tdm_private_output*)output; \ private_display = private_output->private_display @@ -404,7 +404,7 @@ tdm_output_remove_change_handler(tdm_output *output, tdm_private_output *private_output; tdm_private_output_change_handler *change_handler = NULL, *hh = NULL; - TDM_RETURN_IF_FAIL(tdm_output_is_valid(output)); + TDM_RETURN_IF_FAIL(output != NULL); TDM_RETURN_IF_FAIL(func != NULL); private_output = (tdm_private_output*)output; @@ -1112,7 +1112,7 @@ tdm_output_commit_internal(tdm_output *output, int sync, tdm_output_commit_handl tdm_output_dpms dpms_value = TDM_OUTPUT_DPMS_ON; tdm_error ret = TDM_ERROR_NONE; - TDM_RETURN_VAL_IF_FAIL(tdm_output_is_valid(output), TDM_ERROR_INVALID_PARAMETER); + TDM_RETURN_VAL_IF_FAIL(output != NULL, TDM_ERROR_INVALID_PARAMETER); private_output = (tdm_private_output*)output; private_module = private_output->private_module; @@ -1467,7 +1467,7 @@ tdm_output_get_dpms_internal(tdm_output *output, tdm_output_dpms *dpms_value) tdm_func_output *func_output; tdm_error ret = TDM_ERROR_NONE; - TDM_RETURN_VAL_IF_FAIL(tdm_output_is_valid(output), TDM_ERROR_INVALID_PARAMETER); + TDM_RETURN_VAL_IF_FAIL(output != NULL, TDM_ERROR_INVALID_PARAMETER); private_output = (tdm_private_output*)output; diff --git a/src/tdm_private.h b/src/tdm_private.h index 2d60eb7..9b1951d 100644 --- a/src/tdm_private.h +++ b/src/tdm_private.h @@ -82,8 +82,6 @@ extern int tdm_debug_dump; extern int tdm_ttrace_module; extern int tdm_ttrace_output; -int -tdm_display_is_valid(tdm_display *display); tdm_private_display * tdm_display_get(void); @@ -97,8 +95,6 @@ tdm_display_find_private_output(tdm_private_display *private_display, tdm_output tdm_error tdm_output_init(tdm_private_display *private_display); -int -tdm_output_is_valid(tdm_output *output); void tdm_output_thread_cb_change(tdm_private_display *private_display, void *object, tdm_thread_cb_base *cb_base, void *user_data); diff --git a/src/tdm_vblank.c b/src/tdm_vblank.c index 4bfa556..b461a5b 100644 --- a/src/tdm_vblank.c +++ b/src/tdm_vblank.c @@ -732,8 +732,8 @@ tdm_vblank_create(tdm_display *dpy, tdm_output *output, tdm_error *error) tdm_private_vblank *private_vblank; tdm_error ret; - TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(tdm_display_is_valid(dpy), TDM_ERROR_INVALID_PARAMETER, NULL); - TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(tdm_output_is_valid(output), TDM_ERROR_INVALID_PARAMETER, NULL); + TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(dpy != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); + TDM_RETURN_VAL_IF_FAIL_WITH_ERROR(output != NULL, TDM_ERROR_INVALID_PARAMETER, NULL); if (error) *error = TDM_ERROR_NONE; -- 2.7.4 From a22b592b92bceb3c87adc3f005e2f1a640e0b5da Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 20:24:54 +0900 Subject: [PATCH 07/16] utests: remove unuseful tcs Change-Id: I5acfce9cc3ee9ef2f7d8b883c8e47d73f8ea5c22 --- utests/src/ut_tdm_display.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/utests/src/ut_tdm_display.cpp b/utests/src/ut_tdm_display.cpp index f6aaf2d..1548a5e 100644 --- a/utests/src/ut_tdm_display.cpp +++ b/utests/src/ut_tdm_display.cpp @@ -119,15 +119,6 @@ TEST_P(TDMDisplay, DisplayUpdate) ASSERT_EQ(tdm_display_update(dpy), TDM_ERROR_NONE); } -TEST_P(TDMDisplay, DisplayUpdateWrongDpy) -{ - EXPECT_EXIT({ - tdm_display *wrong_dpy = (tdm_display *)TDM_UT_INVALID_VALUE; - tdm_display_update(wrong_dpy); - exit(0); - }, ::testing::ExitedWithCode(0), ""); -} - TEST_P(TDMDisplay, DisplayUpdateNullObject) { ASSERT_EQ(tdm_display_update(NULL), TDM_ERROR_INVALID_PARAMETER); @@ -152,15 +143,6 @@ TEST_P(TDMDisplay, DisplayGetFDNullFD) ASSERT_EQ(tdm_display_get_fd(dpy, NULL), TDM_ERROR_INVALID_PARAMETER); } -TEST_P(TDMDisplay, DisplayGetFDWrongDpy) -{ - tdm_display *wrong_dpy = (tdm_display *)TDM_UT_INVALID_VALUE; - int fd = TDM_UT_INVALID_VALUE; - - ASSERT_EQ(tdm_display_get_fd(wrong_dpy, &fd), TDM_ERROR_INVALID_PARAMETER); - ASSERT_EQ(fd, TDM_UT_INVALID_VALUE); -} - /* DISABLED */ TEST_P(TDMDisplay, DISABLED_DisplayHandleEvents) { -- 2.7.4 From 5adeb9a774b05d820fceba93ef554cad9d7334c1 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 21:00:53 +0900 Subject: [PATCH 08/16] utests: fix wrong input param Change-Id: I99d930aba8cdbc080a935e0734601dee77a5f3bd --- utests/src/ut_tdm_backend_pp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utests/src/ut_tdm_backend_pp.cpp b/utests/src/ut_tdm_backend_pp.cpp index 78b268f..4e40e82 100644 --- a/utests/src/ut_tdm_backend_pp.cpp +++ b/utests/src/ut_tdm_backend_pp.cpp @@ -391,7 +391,7 @@ TEST_P(TDMBackendPP, PPDispalyGetAvaiableSizeNullOther) { if (ut_tdm_display_has_pp_capability(dpy)) { ASSERT_EQ(PreparePP(), true); - ASSERT_EQ(tdm_display_get_pp_available_size(pp, NULL, NULL, NULL, NULL, NULL), TDM_ERROR_INVALID_PARAMETER); + ASSERT_EQ(tdm_display_get_pp_available_size(dpy, NULL, NULL, NULL, NULL, NULL), TDM_ERROR_NONE); } } -- 2.7.4 From 8ca7eda0b879649453e1b7d85fa6f67c53c78cab Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 21:08:18 +0900 Subject: [PATCH 09/16] utests: change pp scale test src buffer size to test YUV buffers correctly Change-Id: I4ae8ac621df9da577caa10a32c787d0f3da4759e --- utests/src/ut_tdm_backend_pp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utests/src/ut_tdm_backend_pp.cpp b/utests/src/ut_tdm_backend_pp.cpp index 4e40e82..f1d4991 100644 --- a/utests/src/ut_tdm_backend_pp.cpp +++ b/utests/src/ut_tdm_backend_pp.cpp @@ -626,7 +626,7 @@ TEST_P(TDMBackendPP, PPConvertScale) ASSERT_EQ(PreparePP(), true); - ASSERT_EQ(PrepareBuffers(mode->hdisplay / 2, mode->vdisplay / 4, dst_formats[f], + ASSERT_EQ(PrepareBuffers(640, 480, dst_formats[f], mode->hdisplay, mode->vdisplay / 2, dst_formats[f], TDM_TRANSFORM_NORMAL), true); -- 2.7.4 From 5f5db38c60ac7e80131ba48a5804f3be5325a740 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Mar 2018 20:37:58 +0900 Subject: [PATCH 10/16] display: rename to _tdm_display_setup Change-Id: I2cb9b73d98e6b337a2c1b1b7279db6cfd3e36b3a --- src/tdm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tdm.c b/src/tdm.c index bdb2a87..9f41287 100644 --- a/src/tdm.c +++ b/src/tdm.c @@ -611,7 +611,7 @@ failed_get_outputs: } static tdm_error -_tdm_display_update(tdm_private_display *private_display) +_tdm_display_setup(tdm_private_display *private_display) { tdm_private_module *private_module = NULL; tdm_error ret = TDM_ERROR_NONE; @@ -1049,7 +1049,7 @@ tdm_display_init(tdm_error *error) #endif TDM_TRACE_BEGIN("TDM_Update_Display"); - ret = _tdm_display_update(private_display); + ret = _tdm_display_setup(private_display); TDM_TRACE_END(); if (ret != TDM_ERROR_NONE) goto failed_update; -- 2.7.4 From 81203f5d7b673bb1bad12fe2afa99ad6e82baa7e Mon Sep 17 00:00:00 2001 From: Boram Park Date: Wed, 28 Mar 2018 13:55:21 +0900 Subject: [PATCH 11/16] package version up to 1.16.11 Change-Id: I83da899535b541cbe57c729e7b68651885676cd4 --- packaging/libtdm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index bc608fb..bb8f425 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define UTEST_GCOV 0 Name: libtdm -Version: 1.16.10 +Version: 1.16.11 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries -- 2.7.4 From 84462d289bf79a1b13fb890a4594b8f6bc76ae54 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Wed, 28 Mar 2018 14:58:02 +0900 Subject: [PATCH 12/16] Revert "output: set output connection status if needed" This reverts commit ebb1cbd983e6251a7d4869538c75916a996ef3d9. Change-Id: I8b7620d2e39f6500b7257ae0c0c2affecaf9b3a2 --- src/tdm_output.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/tdm_output.c b/src/tdm_output.c index b66c27b..691d7bb 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -1160,16 +1160,6 @@ 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 2e34878fe12e363ed637f9d35d712407e9807fea Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Fri, 30 Mar 2018 11:47:22 +0900 Subject: [PATCH 13/16] set to null current mode after output update if output disconnected Change-Id: I27b78b4ea4cd63c1ba2ef480e2c3afab71d0140e Signed-off-by: Junkyeong Kim --- src/tdm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tdm.c b/src/tdm.c index 9f41287..15840f4 100644 --- a/src/tdm.c +++ b/src/tdm.c @@ -453,6 +453,9 @@ tdm_display_update_output(tdm_private_module *private_module, ret = _tdm_display_update_caps_output(private_module, pipe, output_backend, &private_output->caps); TDM_RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, ret); + + if (private_output->caps.status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED) + private_output->current_mode = NULL; } layers = func_output->output_get_layers(output_backend, &layer_count, &ret); -- 2.7.4 From 6f850479b3b81b84899e09fd99a51b580e00164b Mon Sep 17 00:00:00 2001 From: Boram Park Date: Fri, 30 Mar 2018 10:51:55 +0900 Subject: [PATCH 14/16] helper: try to dump all formats to a raw file Change-Id: Id2aa867fe19930aa01d5c3d73e1156b28aa45dd5 --- src/tdm_helper.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/tdm_helper.c b/src/tdm_helper.c index 61971e5..0c8b336 100644 --- a/src/tdm_helper.c +++ b/src/tdm_helper.c @@ -44,7 +44,7 @@ #define PNG_DEPTH 8 -static const char *file_exts[2] = {"png", "yuv"}; +static const char *file_exts[2] = {"png", "raw"}; int tdm_dump_enable; char *tdm_debug_dump_dir; @@ -332,9 +332,14 @@ tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file) 0); break; default: - TDM_ERR("can't dump %c%c%c%c buffer", FOURCC_STR(info.format)); - tbm_surface_unmap(buffer); - return; + _tdm_helper_dump_raw((const char*)temp, + info.planes[0].ptr, + info.planes[0].size, + info.planes[1].ptr, + info.planes[1].size, + info.planes[2].ptr, + info.planes[2].size); + break; } tbm_surface_unmap(buffer); -- 2.7.4 From e6035c2be184ee7fc40a7425a70b8f4d583246d0 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Fri, 30 Mar 2018 10:54:22 +0900 Subject: [PATCH 15/16] utests: use TDM_CONFIG_KEY_DEBUG_DUMP to dump all tc's buffer All tcs do tdm_display_init/deinit repeatly. "tdm-monitor -dump" can't be used. So we'd better use env. Change-Id: If518b97cc45e4d8620e89c2e513ad8056be1b8f9 --- utests/src/ut_tdm_env.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utests/src/ut_tdm_env.cpp b/utests/src/ut_tdm_env.cpp index 47144ab..25915aa 100644 --- a/utests/src/ut_tdm_env.cpp +++ b/utests/src/ut_tdm_env.cpp @@ -62,6 +62,10 @@ void TDMEnv::SetUp(void) const char *debug = getenv("TDM_UT_DEBUG_MODULE"); if (debug && strstr(debug, "1")) tdm_config_set_string(TDM_CONFIG_KEY_DEBUG_MODULE, "buffer,vblank,commit,pp,capture"); + + debug = getenv("TDM_UT_DEBUG_DUMP"); + if (debug && (debug[0] == '1')) + tdm_config_set_string(TDM_CONFIG_KEY_DEBUG_DUMP, "all"); } void TDMEnv::TearDown(void) -- 2.7.4 From 8dcd982832e67f110c4622fee789c755ecb28cf3 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Fri, 30 Mar 2018 10:55:24 +0900 Subject: [PATCH 16/16] utests: scale up to screen size We have to make more TCs to test various different sizes later. Change-Id: Ie36ef263d486d17905d0b73fcc58c23cef7a1d70 --- utests/src/ut_tdm_backend_pp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utests/src/ut_tdm_backend_pp.cpp b/utests/src/ut_tdm_backend_pp.cpp index f1d4991..794046c 100644 --- a/utests/src/ut_tdm_backend_pp.cpp +++ b/utests/src/ut_tdm_backend_pp.cpp @@ -627,7 +627,7 @@ TEST_P(TDMBackendPP, PPConvertScale) ASSERT_EQ(PreparePP(), true); ASSERT_EQ(PrepareBuffers(640, 480, dst_formats[f], - mode->hdisplay, mode->vdisplay / 2, dst_formats[f], + mode->hdisplay, mode->vdisplay, dst_formats[f], TDM_TRANSFORM_NORMAL), true); ASSERT_EQ(tdm_pp_set_done_handler(pp, _ut_tdm_pp_done_cb, &done), TDM_ERROR_NONE); -- 2.7.4