struct tizen_surface_shm;
struct tizen_surface_shm_flusher;
+struct wl_surface;
extern const struct wl_interface tizen_surface_shm_interface;
extern const struct wl_interface tizen_surface_shm_flusher_interface;
#define TIZEN_SURFACE_SHM_GET_FLUSHER 0
+#define TIZEN_SURFACE_SHM_GET_FLUSHER_SINCE_VERSION 1
+
static inline void
-tizen_surface_shm_set_user_data(struct tizen_surface_shm *tizen_surface_shm,
- void *user_data)
+tizen_surface_shm_set_user_data(struct tizen_surface_shm *tizen_surface_shm, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) tizen_surface_shm, user_data);
}
return wl_proxy_get_user_data((struct wl_proxy *) tizen_surface_shm);
}
+static inline uint32_t
+tizen_surface_shm_get_version(struct tizen_surface_shm *tizen_surface_shm)
+{
+ return wl_proxy_get_version((struct wl_proxy *) tizen_surface_shm);
+}
+
static inline void
tizen_surface_shm_destroy(struct tizen_surface_shm *tizen_surface_shm)
{
}
static inline struct tizen_surface_shm_flusher *
-tizen_surface_shm_get_flusher(struct tizen_surface_shm *tizen_surface_shm,
- struct wl_surface *surface)
+tizen_surface_shm_get_flusher(struct tizen_surface_shm *tizen_surface_shm, struct wl_surface *surface)
{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) tizen_surface_shm,
- TIZEN_SURFACE_SHM_GET_FLUSHER, &tizen_surface_shm_flusher_interface, NULL,
- surface);
+ TIZEN_SURFACE_SHM_GET_FLUSHER, &tizen_surface_shm_flusher_interface, NULL, surface);
return (struct tizen_surface_shm_flusher *) id;
}
* flush - (none)
*/
void (*flush)(void *data,
- struct tizen_surface_shm_flusher *tizen_surface_shm_flusher);
+ struct tizen_surface_shm_flusher *tizen_surface_shm_flusher);
+ /**
+ * free_flush - (none)
+ * @since: 2
+ */
+ void (*free_flush)(void *data,
+ struct tizen_surface_shm_flusher *tizen_surface_shm_flusher);
};
static inline int
-tizen_surface_shm_flusher_add_listener(struct tizen_surface_shm_flusher
- *tizen_surface_shm_flusher,
- const struct tizen_surface_shm_flusher_listener *listener, void *data)
+tizen_surface_shm_flusher_add_listener(struct tizen_surface_shm_flusher *tizen_surface_shm_flusher,
+ const struct tizen_surface_shm_flusher_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) tizen_surface_shm_flusher,
- (void (* *)(void)) listener, data);
+ (void (**)(void)) listener, data);
}
#define TIZEN_SURFACE_SHM_FLUSHER_DESTROY 0
+#define TIZEN_SURFACE_SHM_FLUSHER_DESTROY_SINCE_VERSION 1
+
static inline void
-tizen_surface_shm_flusher_set_user_data(struct tizen_surface_shm_flusher
- *tizen_surface_shm_flusher, void *user_data)
+tizen_surface_shm_flusher_set_user_data(struct tizen_surface_shm_flusher *tizen_surface_shm_flusher, void *user_data)
{
- wl_proxy_set_user_data((struct wl_proxy *) tizen_surface_shm_flusher,
- user_data);
+ wl_proxy_set_user_data((struct wl_proxy *) tizen_surface_shm_flusher, user_data);
}
static inline void *
-tizen_surface_shm_flusher_get_user_data(struct tizen_surface_shm_flusher
- *tizen_surface_shm_flusher)
+tizen_surface_shm_flusher_get_user_data(struct tizen_surface_shm_flusher *tizen_surface_shm_flusher)
{
return wl_proxy_get_user_data((struct wl_proxy *) tizen_surface_shm_flusher);
}
+static inline uint32_t
+tizen_surface_shm_flusher_get_version(struct tizen_surface_shm_flusher *tizen_surface_shm_flusher)
+{
+ return wl_proxy_get_version((struct wl_proxy *) tizen_surface_shm_flusher);
+}
+
static inline void
-tizen_surface_shm_flusher_destroy(struct tizen_surface_shm_flusher
- *tizen_surface_shm_flusher)
+tizen_surface_shm_flusher_destroy(struct tizen_surface_shm_flusher *tizen_surface_shm_flusher)
{
wl_proxy_marshal((struct wl_proxy *) tizen_surface_shm_flusher,
- TIZEN_SURFACE_SHM_FLUSHER_DESTROY);
+ TIZEN_SURFACE_SHM_FLUSHER_DESTROY);
wl_proxy_destroy((struct wl_proxy *) tizen_surface_shm_flusher);
}
static const struct wl_message tizen_surface_shm_flusher_events[] = {
{ "flush", "", types + 0 },
+ { "free_flush", "2", types + 0 },
};
WL_EXPORT const struct wl_interface tizen_surface_shm_flusher_interface = {
- "tizen_surface_shm_flusher", 1,
+ "tizen_surface_shm_flusher", 2,
1, tizen_surface_shm_flusher_requests,
- 1, tizen_surface_shm_flusher_events,
+ 2, tizen_surface_shm_flusher_events,
};
}
}
+static void __cb_tizen_surface_shm_flusher_free_flush_callback(void *data,
+ struct tizen_surface_shm_flusher *tizen_surface_shm_flusher)
+{
+ tpl_surface_t *surface = data;
+ tpl_wayland_egl_surface_t *wayland_egl_surface;
+ tpl_wayland_egl_display_t *wayland_egl_display;
+ int ret;
+
+ TPL_CHECK_ON_NULL_RETURN(surface);
+ wayland_egl_surface = surface->backend.data;
+ TPL_CHECK_ON_NULL_RETURN(wayland_egl_surface);
+ TPL_CHECK_ON_NULL_RETURN(surface->display);
+ wayland_egl_display = surface->display->backend.data;
+ TPL_CHECK_ON_NULL_RETURN(wayland_egl_display);
+
+ TPL_CHECK_ON_NULL_RETURN(wayland_egl_display->wl_dpy);
+ TPL_CHECK_ON_NULL_RETURN(wayland_egl_display->wl_tbm_event_queue);
+ TPL_CHECK_ON_NULL_RETURN(wayland_egl_surface->tbm_queue);
+
+ TPL_LOG_B("WL_EGL", "[FLUSH_CB] tpl_wayland_egl_surface_t(%p)",
+ wayland_egl_surface);
+
+ /*Fist distach panding queue for TPL
+ - dispatch buffer-release
+ - dispatch queue flush
+ */
+ ret = wl_display_dispatch_queue_pending(wayland_egl_display->wl_dpy,
+ wayland_egl_display->wl_tbm_event_queue);
+ if (ret == -1) {
+ TPL_ERR("Failed to wl_display_dispatch_queue_pending ret:%d, err:%d", ret,
+ errno);
+ return;
+ }
+
+ tbm_surface_queue_free_flush(wayland_egl_surface->tbm_queue);
+}
+
static const struct tizen_surface_shm_flusher_listener
tizen_surface_shm_flusher_listener = {
- __cb_tizen_surface_shm_flusher_flush_callback
+ __cb_tizen_surface_shm_flusher_flush_callback,
+ __cb_tizen_surface_shm_flusher_free_flush_callback
};
static void