{
tdm_private_display *private_display;
tdm_private_thread *private_thread;
- int thread;
+ int thread, i;
TDM_RETURN_VAL_IF_FAIL(TDM_MUTEX_IS_LOCKED(), TDM_ERROR_OPERATION_FAILED);
TDM_RETURN_VAL_IF_FAIL(private_loop->dpy, TDM_ERROR_OPERATION_FAILED);
private_display = private_loop->dpy;
TDM_RETURN_VAL_IF_FAIL(private_display->private_loop, TDM_ERROR_OPERATION_FAILED);
+ for (i = 0; i < TDM_THREAD_CB_MAX; i++)
+ find_funcs[i] = NULL;
+
LIST_INITHEAD(&cb_list);
if (private_loop->private_thread)
TDM_RETURN_IF_FAIL(TDM_MUTEX_IS_LOCKED());
+ for (i = 0; i < TDM_THREAD_CB_MAX; i++)
+ find_funcs[i] = NULL;
+
if (!private_loop->private_thread)
return;
private_loop->private_thread = NULL;
keep_private_thread = NULL;
- for (i = 0; i < TDM_THREAD_CB_MAX; i++)
- find_funcs[i] = NULL;
-
TDM_INFO("Finish a TDM event thread");
}
if (tdm_debug_module & TDM_DEBUG_THREAD)
TDM_INFO("type(%d), length(%d)", base->type, base->length);
switch (base->type) {
- case TDM_THREAD_CB_OUTPUT_COMMIT: {
- tdm_thread_cb_output_commit *output_commit = (tdm_thread_cb_output_commit*)base;
- tdm_output *output_backend =
- tdm_display_find_output_stamp(private_loop->dpy, output_commit->output_stamp);
- if (!output_backend) {
- TDM_WRN("no output(%f)", output_commit->output_stamp);
- break;
- }
- tdm_output_cb_commit(output_backend, output_commit->sequence,
- output_commit->tv_sec, output_commit->tv_usec,
- output_commit->user_data);
- break;
- }
- case TDM_THREAD_CB_OUTPUT_VBLANK: {
- tdm_thread_cb_output_vblank *output_vblank = (tdm_thread_cb_output_vblank*)base;
- tdm_output *output_backend =
- tdm_display_find_output_stamp(private_loop->dpy, output_vblank->output_stamp);
- if (!output_backend) {
- TDM_WRN("no output(%f)", output_vblank->output_stamp);
- break;
- }
- tdm_output_cb_vblank(output_backend, output_vblank->sequence,
- output_vblank->tv_sec, output_vblank->tv_usec,
- output_vblank->user_data);
- break;
- }
- case TDM_THREAD_CB_OUTPUT_STATUS: {
- /* LCOV_EXCL_START */
- tdm_thread_cb_output_status *output_status = (tdm_thread_cb_output_status*)base;
- tdm_output *output_backend =
- tdm_display_find_output_stamp(private_loop->dpy, output_status->output_stamp);
- if (!output_backend) {
- TDM_WRN("no output(%f)", output_status->output_stamp);
- break;
- }
- tdm_output_cb_status(output_backend, output_status->status,
- output_status->user_data);
- break;
- /* LCOV_EXCL_STOP */
- }
- case TDM_THREAD_CB_OUTPUT_DPMS: {
- /* LCOV_EXCL_START */
- tdm_thread_cb_output_dpms *output_dpms = (tdm_thread_cb_output_dpms*)base;
- tdm_output *output_backend =
- tdm_display_find_output_stamp(private_loop->dpy, output_dpms->output_stamp);
- if (!output_backend) {
- TDM_WRN("no output(%f)", output_dpms->output_stamp);
- break;
- }
- tdm_output_cb_dpms(output_backend, output_dpms->dpms, output_dpms->user_data);
- break;
- /* LCOV_EXCL_STOP */
- }
+ case TDM_THREAD_CB_OUTPUT_COMMIT:
+ case TDM_THREAD_CB_OUTPUT_VBLANK:
+ case TDM_THREAD_CB_OUTPUT_CHANGE:
case TDM_THREAD_CB_PP_DONE:
case TDM_THREAD_CB_CAPTURE_DONE:
+ case TDM_THREAD_CB_VBLANK_SW:
+ case TDM_THREAD_CB_VBLANK_CREATE:
+ case TDM_THREAD_CB_NEED_VALIDATE:
tdm_thread_cb_call(NULL, base);
break;
- case TDM_THREAD_CB_VBLANK_SW: {
- tdm_thread_cb_vblank_sw *vblank_sw = (tdm_thread_cb_vblank_sw*)base;
- tdm_vblank_cb_vblank_SW(NULL, vblank_sw->vblank_stamp);
- break;
- }
- case TDM_THREAD_CB_VBLANK_CREATE: {
- tdm_thread_cb_vblank_create *vblank_create = (tdm_thread_cb_vblank_create*)base;
- tdm_vblank_cb_vblank_create(NULL, vblank_create->vblank_stamp);
- break;
- }
- case TDM_THREAD_CB_NEED_VALIDATE: {
- tdm_thread_cb_need_validate *ev = (tdm_thread_cb_need_validate*)base;
- tdm_output_cb_need_validate(ev->o);
- break;
- }
default:
break;
}