* Taeheon Kim <th908.kim@samsung.com>,
* YoungJun Cho <yj44.cho@samsung.com>,
* SooChan Lim <sc1.lim@samsung.com>,
- * Boram Park <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
tdm_private_display *private_display;
tdm_private_thread_cb *cb = NULL, *hh = NULL;
tdm_error ret;
- int i;
TDM_RETURN_IF_FAIL(TDM_MUTEX_IS_LOCKED());
- if (!private_loop->private_thread) {
- for (i = 0; i < TDM_THREAD_CB_MAX; i++)
- find_funcs[i] = NULL;
+ if (!private_loop->private_thread)
return;
- }
ret = _tdm_thread_exit(private_loop);
if (ret != TDM_ERROR_NONE)
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");
}
case TDM_THREAD_CB_CAPTURE_DONE:
case TDM_THREAD_CB_VBLANK_SW:
case TDM_THREAD_CB_VBLANK_CREATE:
- case TDM_THREAD_CB_NEED_VALIDATE:
+ case TDM_THREAD_CB_HWC_COMMIT:
/* this event comes from other thread. so we don't need to propagate this to other thread */
ret = tdm_thread_cb_call(NULL, base, 0);
TDM_WARNING_IF_FAIL(ret == TDM_ERROR_NONE);
assert(find_funcs[cb_base->type] != NULL);
+ if (keep_private_thread && keep_private_thread->thread_tid != caller_tid) {
+ /* A sync-type event from display-thread to tdm-thread can't be handled.
+ * If sync-type events happen in both threads at the same time,
+ * it would make a deadlock issue.
+ */
+ assert(cb_base->sync != 1);
+ }
+
if (tdm_debug_module & TDM_DEBUG_THREAD)
TDM_INFO("'%s' thread_cb (sync:%d, propagation:%d) ------",
tdm_cb_type_str(cb_base->type), cb_base->sync, propagation);
- /* handling only output-status as sync. below logic can't handle two sync-type events */
- if (cb_base->type == TDM_THREAD_CB_OUTPUT_STATUS)
- assert(cb_base->sync == 1);
- else
- assert(cb_base->sync == 0);
-
if (!object) {
object = find_funcs[cb_base->type](private_display, cb_base->object_stamp);
if (!object) {