TDM_RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, ret);
if (!TDM_OUTPUT_DPMS_VSYNC_IS_OFF(dpms_value)) {
- if (func) {
- if (!private_output->regist_commit_cb) {
- private_output->regist_commit_cb = 1;
- ret = func_output->output_set_commit_handler(private_output->output_backend, _tdm_output_cb_commit);
- TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, commit_failed);
- }
-
- output_commit_handler = calloc(1, sizeof(tdm_private_output_commit_handler));
- if (!output_commit_handler) {
- /* LCOV_EXCL_START */
- TDM_ERR("failed: alloc memory");
- return TDM_ERROR_OUT_OF_MEMORY;
- /* LCOV_EXCL_STOP */
- }
-
- ret = tdm_thread_cb_add(private_output, TDM_THREAD_CB_OUTPUT_COMMIT, output_commit_handler, _tdm_output_thread_cb_commit, NULL);
- if (ret != TDM_ERROR_NONE) {
- TDM_ERR("tdm_thread_cb_add failed");
- free(output_commit_handler);
- return ret;
- }
-
- LIST_ADDTAIL(&output_commit_handler->link, &private_output->output_commit_handler_list);
- output_commit_handler->private_output = private_output;
- output_commit_handler->func = func;
- output_commit_handler->user_data = user_data;
- output_commit_handler->owner_tid = syscall(SYS_gettid);
+ if (!private_output->regist_commit_cb) {
+ private_output->regist_commit_cb = 1;
+ ret = func_output->output_set_commit_handler(private_output->output_backend, _tdm_output_cb_commit);
+ TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, commit_failed);
}
+ output_commit_handler = calloc(1, sizeof(tdm_private_output_commit_handler));
+ if (!output_commit_handler) {
+ /* LCOV_EXCL_START */
+ TDM_ERR("failed: alloc memory");
+ return TDM_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
+ }
+
+ ret = tdm_thread_cb_add(private_output, TDM_THREAD_CB_OUTPUT_COMMIT, output_commit_handler, _tdm_output_thread_cb_commit, NULL);
+ if (ret != TDM_ERROR_NONE) {
+ TDM_ERR("tdm_thread_cb_add failed");
+ free(output_commit_handler);
+ return ret;
+ }
+
+ LIST_ADDTAIL(&output_commit_handler->link, &private_output->output_commit_handler_list);
+ output_commit_handler->private_output = private_output;
+ output_commit_handler->func = func;
+ output_commit_handler->user_data = user_data;
+ output_commit_handler->owner_tid = syscall(SYS_gettid);
+
ret = func_output->output_commit(private_output->output_backend, sync,
output_commit_handler);
TDM_GOTO_IF_FAIL(ret == TDM_ERROR_NONE, commit_failed);