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)
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) {
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);
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: