From 85530bee1c1714e2c8abf38d1612310063d7e6d5 Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Thu, 8 Feb 2018 11:30:36 +0900 Subject: [PATCH 01/16] do not update caps.status in sub thread Change-Id: Ib11fb4b9d448ade7740887b6aad9cc6a9ee3d91d Signed-off-by: Junkyeong Kim --- src/tdm_output.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tdm_output.c b/src/tdm_output.c index 74745bd..67ec7e9 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -223,7 +223,6 @@ tdm_output_cb_status(tdm_output *output_backend, tdm_output_conn_status status, TDM_INFO("output(%d) %s", private_output->pipe, tdm_status_str(status)); _tdm_output_update(output_backend, user_data); - private_output->caps.status = status; output_status.base.type = TDM_THREAD_CB_OUTPUT_STATUS; output_status.base.length = sizeof output_status; -- 2.7.4 From fab10fef52eb5ace3c8e2d9db498f92b6578b24d Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Thu, 8 Feb 2018 11:34:41 +0900 Subject: [PATCH 02/16] enhance log for distinguishment of output status cb thread Change-Id: Ib78ddd3d3f6c9e1203512e451bf29a171b80d37d Signed-off-by: Junkyeong Kim --- src/tdm_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tdm_output.c b/src/tdm_output.c index 67ec7e9..068cdcd 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -220,7 +220,7 @@ tdm_output_cb_status(tdm_output *output_backend, tdm_output_conn_status status, tdm_thread_cb_output_status output_status; tdm_error ret; - TDM_INFO("output(%d) %s", private_output->pipe, tdm_status_str(status)); + TDM_INFO("output(%d) sub %s", private_output->pipe, tdm_status_str(status)); _tdm_output_update(output_backend, user_data); @@ -242,7 +242,7 @@ tdm_output_cb_status(tdm_output *output_backend, tdm_output_conn_status status, return; } - TDM_INFO("output(%d) %s", private_output->pipe, tdm_status_str(status)); + TDM_INFO("output(%d) main %s", private_output->pipe, tdm_status_str(status)); if (!tdm_thread_is_running()) _tdm_output_update(output_backend, user_data); -- 2.7.4 From 18692b83856bce6d37967718f3258201bcd58220 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Mon, 12 Feb 2018 15:54:34 +0900 Subject: [PATCH 03/16] package version up to 1.13.0 Change-Id: I193a586223f9ca8c9a1dfd36257e146d08905eac --- packaging/libtdm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index 7fa85d4..226fcc0 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define UTEST_GCOV 0 Name: libtdm -Version: 1.12.0 +Version: 1.13.0 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries -- 2.7.4 From cfd12ac159e0bf0557aabfb7c62869b704f8e335 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Mon, 19 Feb 2018 11:36:37 +0900 Subject: [PATCH 04/16] tdm_hwc_window: do not check the null buffer Change-Id: Iffb2096ff4523d5416c01496a79c4d89413fb831 --- src/tdm_hwc_window.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/tdm_hwc_window.c b/src/tdm_hwc_window.c index 08fc80c..417fcd0 100644 --- a/src/tdm_hwc_window.c +++ b/src/tdm_hwc_window.c @@ -463,14 +463,6 @@ tdm_hwc_window_commit(tdm_hwc_window *hwc_window, tdm_hwc_window_commit_handler buffer = func_hwc_window->hwc_window_get_buffer(private_hwc_window->hwc_window_backend, &ret); - if (!buffer) { - /* LCOV_EXCL_START */ - _pthread_mutex_unlock(&private_display->lock); - TDM_ERR("no assigned buffer!!"); - return TDM_ERROR_INVALID_PARAMETER; - /* LCOV_EXCL_STOP */ - } - if (buffer) ret = tdm_layer_set_buffer_internal(private_layer, buffer); else -- 2.7.4 From 8e6edf470329479c8ad7aa00cccc71c996698bee Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Mon, 19 Feb 2018 11:38:11 +0900 Subject: [PATCH 05/16] tdm_output: do not check the null buffer Change-Id: Iaf8d0d134a6fb683bbc1d39afba51fb7768de945 --- src/tdm_output.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/tdm_output.c b/src/tdm_output.c index 068cdcd..dbd7fe4 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -1924,14 +1924,6 @@ tdm_output_hwc_commit_client_target_buffer(tdm_output *output, tdm_output_hwc_ta buffer = func_output->output_hwc_get_client_target_buffer(private_output->output_backend, &ret); - if (!buffer) { - /* LCOV_EXCL_START */ - _pthread_mutex_unlock(&private_display->lock); - TDM_ERR("no assigned buffer!!"); - return TDM_ERROR_INVALID_PARAMETER; - /* LCOV_EXCL_STOP */ - } - if (buffer) ret = tdm_layer_set_buffer_internal(private_layer, buffer); else -- 2.7.4 From 1b4102b50ffb433394a38f7f9423a35c9a2a548a Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Mon, 19 Feb 2018 13:13:27 +0900 Subject: [PATCH 06/16] tdm_output: set the layer_info of the target buffer only when the mode is set. Change-Id: I21bb59e31c6922a827bb5c614e78ee5a7f6b7922 --- src/tdm_output.c | 21 +++++++++++---------- src/tdm_private_types.h | 3 +++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/tdm_output.c b/src/tdm_output.c index dbd7fe4..54ad8dc 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -1144,6 +1144,7 @@ tdm_output_set_mode(tdm_output *output, const tdm_output_mode *mode) ret = func_output->output_set_mode(private_output->output_backend, mode); if (ret == TDM_ERROR_NONE) { private_output->current_mode = mode; + private_output->need_set_target_info = 1; TDM_INFO("mode: %dx%d %dhz", mode->hdisplay, mode->vdisplay, mode->vrefresh); } @@ -1935,9 +1936,7 @@ tdm_output_hwc_commit_client_target_buffer(tdm_output *output, tdm_output_hwc_ta return ret; } - /* set layer_info only one time */ - /* TODO: if the mode changes, set again the target_buffer_info. */ - if (&private_output->target_buffer_info == NULL) { + if (private_output->need_set_target_info) { mode = private_output->current_mode; private_output->target_buffer_info.src_config.size.h = mode->hdisplay; private_output->target_buffer_info.src_config.size.v = mode->vdisplay; @@ -1950,14 +1949,16 @@ tdm_output_hwc_commit_client_target_buffer(tdm_output *output, tdm_output_hwc_ta private_output->target_buffer_info.dst_pos.w = mode->hdisplay; private_output->target_buffer_info.dst_pos.h = mode->vdisplay; private_output->target_buffer_info.transform = TDM_TRANSFORM_NORMAL; - } - ret = tdm_layer_set_info_internal(private_layer, &private_output->target_buffer_info); - if (ret != TDM_ERROR_NONE) { - /* LCOV_EXCL_START */ - TDM_ERR("failed: layer set info(window)"); - /* LCOV_EXCL_STOP */ - return ret; + ret = tdm_layer_set_info_internal(private_layer, &private_output->target_buffer_info); + if (ret != TDM_ERROR_NONE) { + /* LCOV_EXCL_START */ + TDM_ERR("failed: layer set info(window)"); + /* LCOV_EXCL_STOP */ + return ret; + } + + private_output->need_set_target_info = 0; } output_hwc_target_buffer_commit_handler = calloc(1, sizeof(tdm_private_output_hwc_target_buffer_commit_handler)); diff --git a/src/tdm_private_types.h b/src/tdm_private_types.h index 4ef5922..26b4b12 100644 --- a/src/tdm_private_types.h +++ b/src/tdm_private_types.h @@ -215,6 +215,9 @@ struct _tdm_private_output { /* for ttrace vblank */ tdm_vblank *ttrace_vblank; + + /* hwc */ + int need_set_target_info; }; struct _tdm_private_layer { -- 2.7.4 From fb19bda7e3e4cd0889d07d565e193ff9cc6a897d Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Mon, 19 Feb 2018 13:47:49 +0900 Subject: [PATCH 07/16] package version up to 1.13.1 Change-Id: I42a9f79dfc2718c6cb2ad691d7636fdc89e16e5b --- packaging/libtdm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index 226fcc0..4cb9d26 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define UTEST_GCOV 0 Name: libtdm -Version: 1.13.0 +Version: 1.13.1 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries -- 2.7.4 From 3b03a716fd67d4aa909e6f12fa1cb4caa95edeb8 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 12 Feb 2018 18:07:29 +0900 Subject: [PATCH 08/16] display: fix wrong typo Change-Id: Id67480b0ad585df0534d1c317da0ae49661ba654 --- include/tdm.h | 2 +- src/tdm_display.c | 2 +- utests/src/ut_tdm_capture.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/tdm.h b/include/tdm.h index f90fbe8..618f896 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -200,7 +200,7 @@ tdm_display_get_capture_capabilities(tdm_display *dpy, * @return #TDM_ERROR_NONE if success. Otherwise, error value. */ tdm_error -tdm_display_get_catpure_available_formats(tdm_display *dpy, +tdm_display_get_capture_available_formats(tdm_display *dpy, const tbm_format **formats, int *count); /** diff --git a/src/tdm_display.c b/src/tdm_display.c index 83fbec3..8febaf0 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -182,7 +182,7 @@ tdm_display_get_capture_capabilities(tdm_display *dpy, } EXTERN tdm_error -tdm_display_get_catpure_available_formats(tdm_display *dpy, +tdm_display_get_capture_available_formats(tdm_display *dpy, const tbm_format **formats, int *count) { DISPLAY_FUNC_ENTRY(); diff --git a/utests/src/ut_tdm_capture.cpp b/utests/src/ut_tdm_capture.cpp index 7670ea5..5e5e92f 100644 --- a/utests/src/ut_tdm_capture.cpp +++ b/utests/src/ut_tdm_capture.cpp @@ -227,7 +227,7 @@ void TDMCapture::SetUp(void) } error = - tdm_display_get_catpure_available_formats(dpy, &formats, &format_count); + tdm_display_get_capture_available_formats(dpy, &formats, &format_count); ASSERT_EQ(TDM_ERROR_NONE, error); ASSERT_NE(nullptr, formats); ASSERT_GE(format_count, 0); @@ -524,7 +524,7 @@ TEST_F(TDMCaptureWithoutCreation, DisplayGetCaptureAvailableFormatsSuccessful) SKIP_FLAG(has_capture); const tbm_format * formats = nullptr; int count = -42; - ASSERT_TRUE(TDM_ERROR_NONE == tdm_display_get_catpure_available_formats(dpy, &formats, &count)); + ASSERT_TRUE(TDM_ERROR_NONE == tdm_display_get_capture_available_formats(dpy, &formats, &count)); ASSERT_FALSE(-42 == count); ASSERT_FALSE(nullptr == formats); } @@ -977,4 +977,4 @@ TEST_F(TDMCaptureCommit, CaptureCommitSuccessScaleStream) UtHandleCaptureEvent(); ASSERT_EQ(captures.size(), utCaptureDoneHandlerSuccessCounter); -} \ No newline at end of file +} -- 2.7.4 From 17fa403ebeb3de0c042b684f45151e78a92483ce Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 12 Feb 2018 18:09:16 +0900 Subject: [PATCH 09/16] helper: export tdm_helper_dump_buffer_str Change-Id: I426b31bdbb93cfbfec651cac0a5a2eaeb139c0be --- include/tdm_helper.h | 10 ++++++++++ src/tdm_helper.c | 42 ++++++++++++++++++++++-------------------- src/tdm_private.h | 2 -- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/include/tdm_helper.h b/include/tdm_helper.h index 4c501e3..d5d8d6e 100644 --- a/include/tdm_helper.h +++ b/include/tdm_helper.h @@ -77,6 +77,16 @@ void tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file); /** + * @brief Dump a buffer. + * @details + * The filename will includes the buffer information. (width, height, format) + * @param[in] buffer A TDM buffer + * @param[in] file The path of file. + */ +void +tdm_helper_dump_buffer_str(tbm_surface_h buffer, char *dir, char *str); + +/** * @brief fill a buffer with 0 for given pos. * @details * This function supports only if a buffer has below formats. diff --git a/src/tdm_helper.c b/src/tdm_helper.c index c8bcb1c..cd6426f 100644 --- a/src/tdm_helper.c +++ b/src/tdm_helper.c @@ -237,30 +237,26 @@ failed_make: return NULL; } -INTERN void +EXTERN void tdm_helper_dump_buffer_str(tbm_surface_h buffer, char *dir, char *str) { tbm_surface_info_s info; - const char *ext; char file[TDM_PATH_LEN]; int ret, bw, bh; TDM_RETURN_IF_FAIL(buffer != NULL); - TDM_RETURN_IF_FAIL(dir != NULL); TDM_RETURN_IF_FAIL(str != NULL); + if (!dir) + dir = "."; + ret = tbm_surface_get_info(buffer, &info); TDM_RETURN_IF_FAIL(ret == TBM_SURFACE_ERROR_NONE); - if (IS_RGB(info.format)) - ext = file_exts[0]; - else - ext = file_exts[1]; - tdm_helper_get_buffer_full_size(buffer, &bw, &bh); - snprintf(file, TDM_PATH_LEN, "%s/%c%c%c%c_%dx%d_%dx%d_%s.%s", - dir, FOURCC_STR(info.format), bw, bh, info.width, info.height, str, ext); + snprintf(file, TDM_PATH_LEN, "%s/%c%c%c%c_%dx%d_%dx%d_%s", + dir, FOURCC_STR(info.format), bw, bh, info.width, info.height, str); tdm_helper_dump_buffer(buffer, file); } @@ -269,11 +265,13 @@ tdm_helper_dump_buffer_str(tbm_surface_h buffer, char *dir, char *str) EXTERN void tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file) { + char temp[TDM_PATH_LEN] = {0,}; tbm_surface_info_s info; int len, ret; const char *ext; int bo_cnt; int bw, bh; + char *dot, *p = temp; TDM_RETURN_IF_FAIL(buffer != NULL); TDM_RETURN_IF_FAIL(file != NULL); @@ -281,16 +279,20 @@ tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file) ret = tbm_surface_map(buffer, TBM_OPTION_READ, &info); TDM_RETURN_IF_FAIL(ret == TBM_SURFACE_ERROR_NONE); - len = strnlen(file, 1024); if (IS_RGB(info.format)) ext = file_exts[0]; else ext = file_exts[1]; - if (strncmp(file + (len - 3), ext, 3)) { - TDM_ERR("can't dump to '%s' file", file + (len - 3)); - tbm_surface_unmap(buffer); - return; + dot = strrchr(file, '.'); + if (!dot || strlen(dot + 1) != 3 || strncmp(dot + 1, ext, 3)) { + len = strnlen(file, TDM_PATH_LEN - 5); + strncat(p, file, len); + p += len; + *(p++) = '.'; + strncat(p, ext, 3); + p += 3; + *p = '\0'; } tdm_helper_get_buffer_full_size(buffer, &bw, &bh); @@ -305,11 +307,11 @@ tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file) switch (info.format) { case TBM_FORMAT_ARGB8888: case TBM_FORMAT_XRGB8888: - _tdm_helper_dump_png(file, info.planes[0].ptr, bw, bh); + _tdm_helper_dump_png(temp, info.planes[0].ptr, bw, bh); break; case TBM_FORMAT_YVU420: case TBM_FORMAT_YUV420: - _tdm_helper_dump_raw(file, + _tdm_helper_dump_raw((const char*)temp, info.planes[0].ptr, info.planes[0].size, info.planes[1].ptr, @@ -319,7 +321,7 @@ tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file) break; case TBM_FORMAT_NV12: case TBM_FORMAT_NV21: - _tdm_helper_dump_raw(file, + _tdm_helper_dump_raw((const char*)temp, info.planes[0].ptr, info.planes[0].size, info.planes[1].ptr, @@ -328,7 +330,7 @@ tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file) break; case TBM_FORMAT_YUYV: case TBM_FORMAT_UYVY: - _tdm_helper_dump_raw(file, + _tdm_helper_dump_raw((const char*)temp, info.planes[0].ptr, info.planes[0].size, NULL, 0, NULL, 0); @@ -341,7 +343,7 @@ tdm_helper_dump_buffer(tbm_surface_h buffer, const char *file) tbm_surface_unmap(buffer); - TDM_INFO("dump %s", file); + TDM_INFO("dump %s", temp); } EXTERN void diff --git a/src/tdm_private.h b/src/tdm_private.h index 57f97b2..9c76d78 100644 --- a/src/tdm_private.h +++ b/src/tdm_private.h @@ -239,8 +239,6 @@ tdm_server_enable_ttrace_client_vblank(tdm_display *dpy, tdm_output *output, int char * tdm_helper_dump_make_directory(const char *path, char *reply, int *len); -void -tdm_helper_dump_buffer_str(tbm_surface_h buffer, char *dir, char *str); double tdm_helper_get_time(void); -- 2.7.4 From 9c4532473639a9a2f8002975bd7c1468ab86fe25 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 12 Feb 2018 18:10:02 +0900 Subject: [PATCH 10/16] helper: correct symbolic check function Change-Id: Id52e6ed434ae6a2aba926362a2ce02bf58b5788d --- src/tdm_helper.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/tdm_helper.c b/src/tdm_helper.c index cd6426f..a1b7427 100644 --- a/src/tdm_helper.c +++ b/src/tdm_helper.c @@ -61,26 +61,20 @@ tdm_helper_get_time(void) } static int -_tdm_helper_check_file_is_valid(const char* path, int del_link) +_tdm_helper_check_file_is_symbolic_link(const char* path) { - char *real_path; + struct stat sb; if (!path) return 0; - real_path = realpath(path, NULL); - if (real_path && strncmp(path, real_path, strlen(path))) { - if (del_link) - unlink(path); - free(real_path); - + if (stat(path, &sb) != 0) return 0; - } - if (real_path) - free(real_path); + if (S_ISLNK(sb.st_mode)) + return 1; - return 1; + return 0; } static void @@ -90,8 +84,10 @@ _tdm_helper_dump_raw(const char *file, void *data1, int size1, void *data2, unsigned int *blocks; FILE *fp; - if (!_tdm_helper_check_file_is_valid(file, 1)) - TDM_WRN("'%s' may be symbolic link\n", file); + if (_tdm_helper_check_file_is_symbolic_link(file)) { + TDM_ERR("'%s' may be symbolic link\n", file); + return; + } fp = fopen(file, "w+"); TDM_RETURN_IF_FAIL(fp != NULL); @@ -118,8 +114,10 @@ _tdm_helper_dump_png(const char *file, const void *data, int width, { FILE *fp; - if (!_tdm_helper_check_file_is_valid(file, 1)) - TDM_WRN("'%s' may be symbolic link\n", file); + if (_tdm_helper_check_file_is_symbolic_link(file)) { + TDM_ERR("'%s' may be symbolic link\n", file); + return; + } fp = fopen(file, "wb"); TDM_RETURN_IF_FAIL(fp != NULL); -- 2.7.4 From 586f8c6ea978452356d0a0793b375c4d450d2ece Mon Sep 17 00:00:00 2001 From: Boram Park Date: Tue, 20 Feb 2018 13:56:16 +0900 Subject: [PATCH 11/16] add tdm_layer_get_output Change-Id: Icbc2003297276a45b6d2d7f3cda54393aa12bc0d --- include/tdm.h | 8 ++++++++ src/tdm_layer.c | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/include/tdm.h b/include/tdm.h index 618f896..70c99af 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -765,6 +765,14 @@ tdm_output_hwc_get_video_supported_formats(tdm_layer *layer, const tbm_format ** int *count); /** + * @brief Get a output object of a layer object + * @param[in] layer A layer object + * @return A TDM output object if success. Otherwise, NULL. + */ +tdm_output* +tdm_layer_get_output(tdm_layer *layer, tdm_error *error); + +/** * @brief Get the capabilities of a layer object. * @param[in] layer A layer object * @param[out] capabilities The capabilities of a layer object diff --git a/src/tdm_layer.c b/src/tdm_layer.c index 2f97c5c..0ce567e 100644 --- a/src/tdm_layer.c +++ b/src/tdm_layer.c @@ -80,6 +80,25 @@ static void _tdm_layer_cb_output_commit(tdm_output *output, unsigned int sequenc unsigned int tv_sec, unsigned int tv_usec, void *user_data); static void _tdm_layer_reset_pending_data(tdm_private_layer *private_layer); +EXTERN tdm_output* +tdm_layer_get_output(tdm_layer *layer, tdm_error *error) +{ + tdm_output *output; + + LAYER_FUNC_ENTRY_ERROR(); + + _pthread_mutex_lock(&private_display->lock); + + if (error) + *error = TDM_ERROR_NONE; + + output = private_layer->private_output; + + _pthread_mutex_unlock(&private_display->lock); + + return output; +} + EXTERN tdm_error tdm_layer_get_capabilities(tdm_layer *layer, tdm_layer_capability *capabilities) { -- 2.7.4 From f08216fac3a6803d459b5cd267197cc4448deb58 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Tue, 20 Feb 2018 13:56:36 +0900 Subject: [PATCH 12/16] fix buffer leak when deiniting Change-Id: I7a742f011f0e75341f6a4d17140c2f0c184abc91 --- src/tdm.c | 2 ++ src/tdm_layer.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/tdm.c b/src/tdm.c index de6c179..33b27a7 100644 --- a/src/tdm.c +++ b/src/tdm.c @@ -137,6 +137,8 @@ _tdm_display_destroy_private_layer(tdm_private_layer *private_layer) LIST_DEL(&private_layer->link); + tdm_layer_unset_buffer_internal(private_layer); + LIST_FOR_EACH_ENTRY_SAFE(c, cc, &private_layer->capture_list, link) tdm_capture_destroy_internal(c); diff --git a/src/tdm_layer.c b/src/tdm_layer.c index 0ce567e..9add055 100644 --- a/src/tdm_layer.c +++ b/src/tdm_layer.c @@ -555,6 +555,7 @@ tdm_layer_unset_buffer(tdm_layer *layer) _pthread_mutex_lock(&private_display->lock); ret = tdm_layer_unset_buffer_internal(private_layer); + TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE); _pthread_mutex_unlock(&private_display->lock); -- 2.7.4 From b73ff3145dafd2109ddac8f5ceda37286590994a Mon Sep 17 00:00:00 2001 From: Boram Park Date: Tue, 20 Feb 2018 13:57:40 +0900 Subject: [PATCH 13/16] buffers: add extern for testing Change-Id: Ib23b11d99fc399a0673272c39786989a6aa4973a --- tools/buffers.c | 4 +--- tools/buffers.h | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/buffers.c b/tools/buffers.c index 318dcde..8b04b41 100644 --- a/tools/buffers.c +++ b/tools/buffers.c @@ -37,8 +37,6 @@ #include #include -#include "tdm_log.h" -#include "tdm_macro.h" #include "buffers.h" #define ALPHA_VALUE 100 @@ -944,7 +942,7 @@ tdm_test_buffer_fill(tbm_surface_h buffer, int pattern) rand_seed = time(NULL); ret = tbm_surface_map(buffer, TBM_OPTION_WRITE, &info); - TDM_EXIT_IF_FAIL(ret == 0); + assert(ret == 0); plane[0] = info.planes[0].ptr; plane[1] = info.planes[1].ptr; diff --git a/tools/buffers.h b/tools/buffers.h index 55afd3d..acf5661 100644 --- a/tools/buffers.h +++ b/tools/buffers.h @@ -27,6 +27,10 @@ #ifndef __BUFFERS_H__ #define __BUFFERS_H__ +#ifdef __cplusplus +extern "C" { +#endif + enum fill_pattern { PATTERN_TILES = 0, PATTERN_PLAIN = 1, @@ -36,4 +40,8 @@ enum fill_pattern { void tdm_test_buffer_fill(tbm_surface_h buffer, int pattern); +#ifdef __cplusplus +} +#endif + #endif -- 2.7.4 From a44221f9e8dca1cb84da72c255e22d30c3fe08f3 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Tue, 20 Feb 2018 13:58:35 +0900 Subject: [PATCH 14/16] macro: move tdm_debug_module's extern position Change-Id: I5a302cc39c70f28416b7a243286b69749673fe5e --- src/tdm_macro.h | 1 + src/tdm_private.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tdm_macro.h b/src/tdm_macro.h index 4ac6a4f..0cafffe 100644 --- a/src/tdm_macro.h +++ b/src/tdm_macro.h @@ -386,6 +386,7 @@ extern const char *tdm_mutex_lock_func; extern int tdm_mutex_lock_line; extern const char *tdm_mutex_unlock_func; extern int tdm_mutex_unlock_line; +extern int tdm_debug_module; #define _pthread_mutex_lock(l) \ do { \ diff --git a/src/tdm_private.h b/src/tdm_private.h index 9c76d78..0424dd2 100644 --- a/src/tdm_private.h +++ b/src/tdm_private.h @@ -77,7 +77,6 @@ extern "C" { * - function prototypes *****************************************************************************/ -extern int tdm_debug_module; extern int tdm_debug_dump; extern int tdm_ttrace_module; extern int tdm_ttrace_output; -- 2.7.4 From 67f4c07ec0771e515f9e85537ce39b86c41d5f67 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Tue, 20 Feb 2018 13:59:12 +0900 Subject: [PATCH 15/16] helper: allow user_data's NULL Change-Id: I2b7c91dbfaf09be177a43e447692465e76c06944 --- src/tdm_helper.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tdm_helper.c b/src/tdm_helper.c index a1b7427..e3d5f3f 100644 --- a/src/tdm_helper.c +++ b/src/tdm_helper.c @@ -723,7 +723,6 @@ tdm_helper_capture_output(tdm_output *output, tbm_surface_h dst_buffer, TDM_RETURN_VAL_IF_FAIL(w >= 0, TDM_ERROR_INVALID_PARAMETER); TDM_RETURN_VAL_IF_FAIL(h >= 0, TDM_ERROR_INVALID_PARAMETER); TDM_RETURN_VAL_IF_FAIL(func != NULL, TDM_ERROR_INVALID_PARAMETER); - TDM_RETURN_VAL_IF_FAIL(data != NULL, TDM_ERROR_INVALID_PARAMETER); err = tdm_output_get_layer_count(output, &count); if (err != TDM_ERROR_NONE) { -- 2.7.4 From 6fa5ff8f0fe0d8c7aac2ab70bc683f03fdfd18db Mon Sep 17 00:00:00 2001 From: Boram Park Date: Tue, 20 Feb 2018 13:59:48 +0900 Subject: [PATCH 16/16] layer: reset flags in case of success Change-Id: Ib8a9b489b22d0b7bf9381ba01cd87350128b5f97 --- src/tdm_layer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tdm_layer.c b/src/tdm_layer.c index 9add055..a185ae5 100644 --- a/src/tdm_layer.c +++ b/src/tdm_layer.c @@ -1341,6 +1341,7 @@ tdm_layer_get_buffer_flags(tdm_layer *layer, unsigned int *flags) if (!func_layer->layer_get_buffer_flags) { /* LCOV_EXCL_START */ + *flags = 0; _pthread_mutex_unlock(&private_display->lock); TDM_ERR("not implemented!!"); return TDM_ERROR_NOT_IMPLEMENTED; -- 2.7.4