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) {
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:
return ret;
}
+EXTERN tdm_error
+tdm_hwc_set_client_target_acquire_fence(tdm_hwc *hwc, int acquire_fence)
+{
+ tdm_private_module *private_module;
+ tdm_func_hwc *func_hwc = NULL;
+
+ HWC_FUNC_ENTRY();
+
+ _pthread_mutex_lock(&private_display->lock);
+
+ private_module = private_hwc->private_module;
+ func_hwc = &private_module->func_hwc;
+
+ if (!func_hwc->hwc_set_client_target_acquire_fence) {
+ /* LCOV_EXCL_START */
+ _pthread_mutex_unlock(&private_display->lock);
+ TDM_WRN("not implemented!!");
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ /* LCOV_EXCL_STOP */
+ }
+
+ ret = func_hwc->hwc_set_client_target_acquire_fence(private_hwc->hwc_backend, acquire_fence);
+
+ _pthread_mutex_unlock(&private_display->lock);
+
+ return ret;
+}
EXTERN tdm_error
tdm_hwc_validate(tdm_hwc *hwc, tdm_hwc_window **composited_wnds, uint32_t num_wnds, uint32_t *num_types)
/* LCOV_EXCL_STOP */
}
+EXTERN tdm_error
+tdm_hwc_get_commit_fence(tdm_hwc *hwc, int *commit_fence)
+{
+ tdm_private_module *private_module;
+ tdm_func_hwc *func_hwc = NULL;
+
+ HWC_FUNC_ENTRY();
+
+ _pthread_mutex_lock(&private_display->lock);
+
+ private_module = private_hwc->private_module;
+ func_hwc = &private_module->func_hwc;
+
+ if (!func_hwc->hwc_get_commit_fence) {
+ /* LCOV_EXCL_START */
+ _pthread_mutex_unlock(&private_display->lock);
+ TDM_WRN("not implemented!!");
+ return TDM_ERROR_NOT_IMPLEMENTED;
+ /* LCOV_EXCL_STOP */
+ }
+
+ ret = func_hwc->hwc_get_commit_fence(private_hwc->hwc_backend, commit_fence);
+
+ _pthread_mutex_unlock(&private_display->lock);
+
+ return ret;
+}
+
tdm_error
tdm_hwc_set_property(tdm_hwc *hwc, uint32_t id, tdm_value value)
{