static Eina_Bool _e_hwc_windows_target_window_queue_set(E_Hwc_Window_Target *target_hwc_window);
static Eina_Bool _e_hwc_windows_pp_output_data_commit(E_Hwc *hwc, E_Hwc_Window_Commit_Data *data);
static Eina_Bool _e_hwc_windows_pp_window_commit(E_Hwc *hwc, E_Hwc_Window *hwc_window);
+static void _e_hwc_windows_wait_commit_set(E_Hwc *hwc, Eina_Bool set);
static E_Comp_Wl_Buffer *
_e_hwc_windows_comp_wl_buffer_get(E_Hwc_Window *hwc_window)
/* 'wait_commit' is mechanism to make 'fetch and commit' no more than one time per a frame;
* a 'page flip' happened so it's time to allow to make 'fetch and commit' for the e_output */
- hwc->wait_commit = EINA_FALSE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE);
}
static void
}
static void
-_e_hwc_windows_pp_output_commit_handler(tdm_output *toutput, unsigned int sequence,
+_e_hwc_windows_pp_output_commit_handler(tdm_hwc *thwc, unsigned int sequence,
unsigned int tv_sec, unsigned int tv_usec,
void *user_data)
{
hwc = user_data;
_e_hwc_windows_commit_data_release(hwc, sequence, tv_sec, tv_usec);
- hwc->wait_commit = EINA_FALSE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE);
/* layer already resetted */
if (hwc->pp_output_commit_data)
tbm_surface_internal_unref(hwc->pp_tsurface);
hwc->pp_tsurface = data->buffer.tsurface;
- hwc->wait_commit = EINA_FALSE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE);
E_FREE(data);
E_FREE(data);
_e_hwc_windows_commit_data_release(hwc, 0, 0, 0);
- hwc->wait_commit = EINA_FALSE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE);
return EINA_FALSE;
}
hwc->tpp = NULL;
}
_e_hwc_windows_commit_data_release(hwc, 0, 0, 0);
- hwc->wait_commit = EINA_FALSE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE);
goto done;
}
{
tbm_surface_queue_release(hwc->pp_tqueue, tsurface_dst);
_e_hwc_windows_commit_data_release(hwc, 0, 0, 0);
- hwc->wait_commit = EINA_FALSE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE);
goto done;
}
terror = tdm_pp_commit(hwc->tpp);
EINA_SAFETY_ON_FALSE_GOTO(terror == TDM_ERROR_NONE, commit_fail);
- hwc->wait_commit = EINA_TRUE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE);
hwc->pp_commit = EINA_TRUE;
return EINA_TRUE;
return EINA_FALSE;
}
+ _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE);
+
terror = tdm_hwc_commit(hwc->thwc, 0, _e_hwc_windows_commit_handler, hwc);
if (terror != TDM_ERROR_NONE)
{
+ _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE);
EHWSERR("fail to tdm_hwc_commit", hwc);
/* send tizen_hwc_commit feedback discarded */
e_comp_wl_tizen_hwc_discarded();
NULL, hwc, commit_data->buffer.tsurface, hwc->pp_tqueue,
commit_data->buffer_ref.buffer ? commit_data->buffer_ref.buffer->resource : NULL, commit_data);
- hwc->wait_commit = EINA_TRUE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE);
return EINA_TRUE;
}
return EINA_TRUE;
}
+static Eina_Bool
+_e_hwc_windows_commit_handler_timeout(void *data)
+{
+ E_Hwc *hwc = (E_Hwc *)data;
+
+ if (!hwc) return ECORE_CALLBACK_CANCEL;
+
+ EHWSERR("Timeout wait commit", hwc);
+
+ if (hwc->pp_output_commit_data)
+ _e_hwc_windows_pp_output_commit_handler(hwc->thwc, 0, 0, 0, hwc);
+ else
+ _e_hwc_windows_commit_handler(hwc->thwc, 0, 0, 0, hwc);
+
+ hwc->wait_commit = EINA_FALSE;
+ hwc->commit_handler_timer = NULL;
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_e_hwc_windows_wait_commit_set(E_Hwc *hwc, Eina_Bool set)
+{
+ if (hwc->wait_commit == set) return;
+
+ if (e_comp->commit_handler_timer.use)
+ {
+ if (hwc->commit_handler_timer)
+ {
+ ecore_timer_del(hwc->commit_handler_timer);
+ hwc->commit_handler_timer = NULL;
+ }
+
+ if (set)
+ hwc->commit_handler_timer = ecore_timer_add(e_comp->commit_handler_timer.interval,
+ _e_hwc_windows_commit_handler_timeout,
+ hwc);
+ }
+
+ hwc->wait_commit = set;
+}
+
static Eina_Bool
_e_hwc_windows_device_states_available_check(E_Hwc *hwc)
{
ret = tdm_pp_commit(hwc->tpp);
EINA_SAFETY_ON_FALSE_GOTO(ret == TDM_ERROR_NONE, pp_fail);
- hwc->wait_commit = EINA_TRUE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE);
hwc->pp_commit = EINA_TRUE;
return EINA_TRUE;
EHWSTRACE("!!!!!!!! HWC Commit !!!!!!!!", NULL, hwc);
_e_hwc_windows_update_fps(hwc);
- hwc->wait_commit = EINA_TRUE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE);
error = tdm_hwc_commit(hwc->thwc, 0, _e_hwc_windows_commit_handler, hwc);
if (error != TDM_ERROR_NONE)
return EINA_TRUE;
fail:
- hwc->wait_commit = EINA_FALSE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_FALSE);
return EINA_FALSE;
}
}
if (hwc->pp_output_commit_data)
- hwc->wait_commit = EINA_TRUE;
+ _e_hwc_windows_wait_commit_set(hwc, EINA_TRUE);
hwc->pp_src_rect_prev.x = 0;
hwc->pp_src_rect_prev.y = 0;