if (tdm_debug_module & TDM_DEBUG_THREAD)
TDM_INFO("type(%s), length(%d)", tdm_cb_type_str(base->type), base->length);
switch (base->type) {
+ case TDM_THREAD_CB_DISPLAY_OUTPUT_CREATE:
+ case TDM_THREAD_CB_OUTPUT_DESTROY:
case TDM_THREAD_CB_OUTPUT_COMMIT:
case TDM_THREAD_CB_OUTPUT_VBLANK:
case TDM_THREAD_CB_OUTPUT_STATUS:
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:
+ case TDM_THREAD_CB_VOUTPUT_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);
if (!handler_in_other_thread) {
if (keep_private_thread) {
- if (cb_base->sync && waiting_tid != 0) {
+ /* NOTE quick fix
+ * In case of 'cb_base->sync = 0' and 'waiting_tid != 0',
+ * probably it means one thread is waiting for signal of
+ * pthread condition.
+ */
+ if (!cb_base->sync && waiting_tid != 0) {
waiting_tid = 0;
pthread_cond_signal(&keep_private_thread->event_cond);
if (tdm_debug_module & TDM_DEBUG_THREAD)
*/
assert(keep_private_thread != NULL);
- ret = tdm_thread_send_cb(private_display->private_loop, cb_base);
- TDM_RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, TDM_ERROR_OPERATION_FAILED);
-
+ if (!cb_base->sync) {
+ ret = tdm_thread_send_cb(private_display->private_loop, cb_base);
+ TDM_RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, TDM_ERROR_OPERATION_FAILED);
+ }
/* waiting until all cb are done in another thread */
- if (cb_base->sync) {
+ else {
+ /* NOTE quick fix
+ * Sync type event from display-thread(main thread) can't be
+ * handled. In this way, if we call tdm_thread_send_cb() with
+ * 'cb_base->sync = 1', then libtdm will eveventually raise
+ * abort(). Please see commit '4abfab36' for more detail.
+ */
+ cb_base->sync = 0;
+ ret = tdm_thread_send_cb(private_display->private_loop, cb_base);
+ TDM_RETURN_VAL_IF_FAIL(ret == TDM_ERROR_NONE, TDM_ERROR_OPERATION_FAILED);
+ cb_base->sync = 1;
+
/* if waiting_tid is not 0, it means there are two sync-type events at the same time.
* and it would make deadlock issue.
*/