int tdm_fd;
};
+struct feedback_info {
+ struct wp_presentation_feedback *feedback;
+ twe_wl_surf_source *surf_source;
+};
+
struct _twe_wl_disp_source {
GSource gsource;
GPollFD gfd;
struct wayland_tbm_client *wl_tbm_client;
struct tizen_surface_shm *tss; /* used for surface buffer_flush */
struct wp_presentation *presentation;
+ tpl_list_t *presentation_feedbacks;
struct zwp_linux_explicit_synchronization_v1 *explicit_sync;
tpl_bool_t use_explicit_sync;
struct {
_twe_display_print_err(disp_source, "dispatch_queue_pending");
}
+ __tpl_list_free(disp_source->presentation_feedbacks, (tpl_free_func_t)free);
+
wl_event_queue_destroy(disp_source->ev_queue);
g_mutex_unlock(&disp_source->wl_event_mutex);
TPL_DISPLAY_PRESENT_MODE_FIFO;
_twe_display_wayland_init(source);
+ if (source->presentation)
+ source->presentation_feedbacks = __tpl_list_alloc();
+
source->disp_del_source = _twe_del_source_init(ctx, source);
source->disp_del_source->destroy_target_source_func
= _twe_thread_wl_disp_source_destroy;
TPL_IGNORE(seq_lo);
TPL_IGNORE(flags);
- twe_wl_surf_source *surf_source = (twe_wl_surf_source *)data;
+ struct feedback_info *feedback_info = (struct feedback_info *)data;
+ twe_wl_surf_source *surf_source = feedback_info->surf_source;
+ twe_wl_disp_source *disp_source = surf_source->disp_source;
g_mutex_lock(&surf_source->pst_mutex);
if (presentation_feedback)
wp_presentation_feedback_destroy(presentation_feedback);
+ __tpl_list_remove_data(disp_source->presentation_feedbacks, feedback_info,
+ TPL_FIRST, (tpl_free_func_t)free);
+
g_mutex_unlock(&surf_source->pst_mutex);
}
__cb_presentation_feedback_discarded(void *data,
struct wp_presentation_feedback *presentation_feedback)
{
- twe_wl_surf_source *surf_source = (twe_wl_surf_source *)data;
+ struct feedback_info *feedback_info = (struct feedback_info *)data;
+ twe_wl_surf_source *surf_source = feedback_info->surf_source;
+ twe_wl_disp_source *disp_source = surf_source->disp_source;
g_mutex_lock(&surf_source->pst_mutex);
if (presentation_feedback)
wp_presentation_feedback_destroy(presentation_feedback);
+ __tpl_list_remove_data(disp_source->presentation_feedbacks, feedback_info,
+ TPL_FIRST, (tpl_free_func_t)free);
+
g_mutex_unlock(&surf_source->pst_mutex);
}
g_mutex_lock(&surf_source->pst_mutex);
if (disp_source->presentation &&
surf_source->presentation_sync_req_cnt > 0) {
- p_feedback = wp_presentation_feedback(disp_source->presentation,
- wl_surface);
- wp_presentation_feedback_add_listener(p_feedback, &feedback_listener, surf_source);
+ struct feedback_info *feedback_info =
+ (struct feedback_info *)calloc(1, sizeof(struct feedback_info));
+ if (feedback_info) {
+ feedback_info->feedback = wp_presentation_feedback(disp_source->presentation,
+ wl_surface);
+ feedback_info->surf_source = surf_source;
+ wp_presentation_feedback_add_listener(feedback_info->feedback,
+ &feedback_listener, feedback_info);
+ __tpl_list_push_back(disp_source->presentation_feedbacks, (void *)feedback_info);
+ }
}
g_mutex_unlock(&surf_source->pst_mutex);
g_mutex_lock(&surf_source->surf_mutex);
+ if (disp_source->presentation && disp_source->presentation_feedbacks) {
+ int num_feedbacks = __tpl_list_get_count(disp_source->presentation_feedbacks);
+ while (num_feedbacks) {
+ struct feedback_info *feedback_info = __tpl_list_pop_front(disp_source->presentation_feedbacks, NULL);
+ if (feedback_info && surf_source == feedback_info->surf_source) {
+ wp_presentation_feedback_destroy(feedback_info->feedback);
+ feedback_info->feedback = NULL;
+ feedback_info->surf_source = NULL;
+
+ free(feedback_info);
+ } else {
+ __tpl_list_push_back(disp_source->presentation_feedbacks, feedback_info);
+ }
+
+ num_feedbacks--;
+ }
+ }
+
if (surf_source->in_use_buffers) {
__tpl_list_free(surf_source->in_use_buffers,
(tpl_free_func_t)__cb_buffer_remove_from_list);