From: Changyeon Lee Date: Mon, 22 Jun 2020 07:39:02 +0000 (+0900) Subject: Merge branch 'tizen' into sandbox/cyeon/devel X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fsandbox%2Fcyeon%2Fdevel;hp=591dc2959335302fca5897aa1e7daba2554fc746;p=platform%2Fcore%2Fuifw%2Flibtdm.git Merge branch 'tizen' into sandbox/cyeon/devel --- diff --git a/packaging/libtdm.spec b/packaging/libtdm.spec index 9dba25f..d9141d5 100644 --- a/packaging/libtdm.spec +++ b/packaging/libtdm.spec @@ -2,7 +2,7 @@ %define HALTESTS_GCOV 0 Name: libtdm -Version: 2.10.8 +Version: 2.10.9 Release: 0 Summary: User Library of Tizen Display Manager Group: Development/Libraries diff --git a/src/tdm_hwc.c b/src/tdm_hwc.c index f9071a6..9238b29 100644 --- a/src/tdm_hwc.c +++ b/src/tdm_hwc.c @@ -86,6 +86,22 @@ _tdm_hwc_find_private_hwc_window(tdm_private_hwc *private_hwc, tdm_hwc_window *h return NULL; } +static tdm_error +_tdm_hwc_check_hwc_commit_handler_validation(tdm_private_hwc *private_hwc, tdm_private_hwc_commit_handler *hwc_commit_handler) +{ + tdm_private_hwc_commit_handler *commit_handler = NULL; + + if (LIST_IS_EMPTY(&private_hwc->hwc_commit_handler_list)) + return TDM_ERROR_INVALID_PARAMETER; + + LIST_FOR_EACH_ENTRY(commit_handler, &private_hwc->hwc_commit_handler_list, link) { + if (commit_handler == hwc_commit_handler) + return TDM_ERROR_NONE; + } + + return TDM_ERROR_INVALID_PARAMETER; +} + static void _tdm_hwc_thread_cb_commit(tdm_private_display *private_display, void *object, tdm_thread_cb_base *cb_base, void *user_data) @@ -104,6 +120,8 @@ _tdm_hwc_thread_cb_commit(tdm_private_display *private_display, void *object, tdm_thread_cb_remove(private_hwc, TDM_THREAD_CB_HWC_COMMIT, hwc_commit_handler, _tdm_hwc_thread_cb_commit, NULL); + TDM_RETURN_IF_FAIL(_tdm_hwc_check_hwc_commit_handler_validation(private_hwc, hwc_commit_handler) == TDM_ERROR_NONE) + LIST_DEL(&hwc_commit_handler->link); if (tdm_debug_module & TDM_DEBUG_COMMIT) { @@ -212,6 +230,7 @@ _tdm_hwc_cb_wait_vblank(tdm_vblank *vblank, tdm_error error, unsigned int sequen return; TDM_RETURN_IF_FAIL(hwc_commit_handler != NULL); + TDM_RETURN_IF_FAIL(hwc_commit_handler->private_hwc != NULL); private_output = hwc_commit_handler->private_hwc->private_output; TDM_RETURN_IF_FAIL(private_output != NULL); @@ -249,17 +268,19 @@ _tdm_hwc_vblank(tdm_private_hwc *private_hwc, tdm_private_hwc_commit_handler *hw if (ret != TDM_ERROR_NONE) goto done; + hwc_commit_handler->use_vblank = 1; + private_output->layer_waiting_vblank = 1; + /* tdm_vblank APIs is for server. it should be called in unlock status*/ _pthread_mutex_unlock(&private_display->lock); ret = tdm_vblank_wait(private_output->vblank, 0, 0, 1, _tdm_hwc_cb_wait_vblank, hwc_commit_handler); _pthread_mutex_lock(&private_display->lock); if (ret != TDM_ERROR_NONE) { - if (!TDM_OUTPUT_DPMS_VSYNC_IS_OFF(private_output->current_dpms_value)) - goto done; + if (!TDM_OUTPUT_DPMS_VSYNC_IS_OFF(private_output->current_dpms_value)) { + hwc_commit_handler->use_vblank = 0; + private_output->layer_waiting_vblank = 0; + } } - - hwc_commit_handler->use_vblank = 1; - private_output->layer_waiting_vblank = 1; } done: