From 8d55bd62398e7dd275b26b6ebabe51e3b428c333 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 2 Sep 2020 14:52:41 +0900 Subject: [PATCH] DSDisplayDeviceHWCTDMImpl: add LCOV exceptions Change-Id: I09abcc5167dc47655349416069b56273d261810f --- src/DSDisplayDevice/DSDisplayDeviceHWCTDMImpl.cpp | 14 ++++++++++++++ .../DSDisplayDeviceHWCWindowTDMTargetImpl.cpp | 10 +++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/DSDisplayDevice/DSDisplayDeviceHWCTDMImpl.cpp b/src/DSDisplayDevice/DSDisplayDeviceHWCTDMImpl.cpp index b6be04f..2355e11 100644 --- a/src/DSDisplayDevice/DSDisplayDeviceHWCTDMImpl.cpp +++ b/src/DSDisplayDevice/DSDisplayDeviceHWCTDMImpl.cpp @@ -52,7 +52,9 @@ std::shared_ptr DSDisplayDeviceHWCTDMImpl::getTargetBufferQueue( tqueue = tdm_hwc_get_client_target_buffer_queue(__thwc, &terror); if (terror != TDM_ERROR_NONE) { +/*LCOV_EXCL_START*/ DSLOG_ERR("HWCTDM", "tdm_hwc_get_client_target_buffer_queue fails."); +/*LCOV_EXCL_STOP*/ } __bufferQueue = std::make_shared(tqueue); @@ -70,8 +72,10 @@ bool DSDisplayDeviceHWCTDMImpl::setTargetBuffer(std::shared_ptr buffe terror = tdm_hwc_set_client_target_buffer(__thwc, (tbm_surface_h)buffer->getNativeBuffer(), fb_damage); if (terror != TDM_ERROR_NONE) { +/*LCOV_EXCL_START*/ DSLOG_ERR("TDM_HWC", "tdm_hwc_set_client_target_buffer fails."); return false; +/*LCOV_EXCL_STOP*/ } return true; @@ -85,14 +89,18 @@ std::shared_ptr DSDisplayDeviceHWCTDMImpl::makeHWCWin twindow = tdm_hwc_create_window(__thwc, &terror); if (!twindow) { +/*LCOV_EXCL_START*/ DSLOG_ERR("HWCTDM", "tdm_hwc_create_window fails."); return nullptr; +/*LCOV_EXCL_STOP*/ } deviceHWCWindow = std::make_shared(twindow); if (!deviceHWCWindow) { +/*LCOV_EXCL_START*/ DSLOG_ERR("HWCTDM", "new DSDisplayDeviceHWCWindowTDMImpl fails."); return nullptr; +/*LCOV_EXCL_STOP*/ } return deviceHWCWindow; @@ -152,9 +160,11 @@ bool DSDisplayDeviceHWCTDMImpl::commit() //TODO: commit with async terror = tdm_hwc_commit(__thwc, true, NULL, NULL); if (terror != TDM_ERROR_NONE) { +/*LCOV_EXCL_START*/ DSLOG_ERR("HWCTDM", "tdm_hwc_commit fails."); __presentFrameDoneWindows(); return false; +/*LCOV_EXCL_STOP*/ } DSLOG_INF("HWCTDM", "HWC COMMIT COMMIT COMMIT ~#######"); @@ -186,9 +196,11 @@ bool DSDisplayDeviceHWCTDMImpl::__validate(uint32_t &numChanges) // validate thwc_windows terror = tdm_hwc_validate(__thwc, thwc_windows, numVisibleHWCWins, &numChanges); if (terror != TDM_ERROR_NONE) { +/*LCOV_EXCL_START*/ DSLOG_ERR("TDM_HWC", "tdm_hwc_validate fails."); free(thwc_windows); return false; +/*LCOV_EXCL_STOP*/ } free(thwc_windows); @@ -242,8 +254,10 @@ bool DSDisplayDeviceHWCTDMImpl::__acceptValidation() // TODO: accept_validation is depending on the transitions. terror = tdm_hwc_accept_validation(__thwc); if (terror != TDM_ERROR_NONE) { +/*LCOV_EXCL_STOP*/ DSLOG_ERR("TDM_HWC", "tdm_hwc_accept_validation fails."); return false; +/*LCOV_EXCL_STOP*/ } return true; diff --git a/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp b/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp index 37269ec..fc67c7c 100644 --- a/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp +++ b/src/DSDisplayDevice/DSDisplayDeviceHWCWindowTDMTargetImpl.cpp @@ -34,7 +34,9 @@ DSDisplayDeviceHWCWindowTDMTargetImpl::DSDisplayDeviceHWCWindowTDMTargetImpl(IDS __ecoreFdHandler(nullptr) { if (!ecore_init()) { +/*LCOV_EXCL_START*/ DSLOG_ERR("EventLoop", "ecore_init() fails."); +/*LCOV_EXCL_STOP*/ } __eventFd = eventfd(0, EFD_NONBLOCK); @@ -93,6 +95,7 @@ void DSDisplayDeviceHWCWindowTDMTargetImpl::onPresentFrameDone() Eina_Bool DSDisplayDeviceHWCWindowTDMTargetImpl::__onFdHandler(void *data, Ecore_Fd_Handler *hdlr) { +/*LCOV_EXCL_START*/ int len; int fd; char buffer[64]; @@ -106,6 +109,7 @@ Eina_Bool DSDisplayDeviceHWCWindowTDMTargetImpl::__onFdHandler(void *data, Ecore DSLOG_WRN("DSDisplayDeviceHWCWindowTDMTargetImpl", "failed to read buffer from event fd:%m"); return ECORE_CALLBACK_RENEW; +/*LCOV_EXCL_STOP*/ } void DSDisplayDeviceHWCWindowTDMTargetImpl::__onAcquirable(void *data) @@ -114,8 +118,12 @@ void DSDisplayDeviceHWCWindowTDMTargetImpl::__onAcquirable(void *data) int ret; ret = write(__eventFd, &value, sizeof(value)); - if (ret == -1) + if (ret == -1) { +/*LCOV_EXCL_START*/ DSLOG_WRN("DSDisplayDeviceHWCWindowTDMTargetImpl", "failed to write a value on event fd:%m"); +/*LCOV_EXCL_STOP*/ + } + } } -- 2.7.4