if (hwc_window->thwc_window)
tdm_hwc_window_destroy(hwc_window->thwc_window);
+ if (hwc_window->cqueue)
+ wayland_tbm_server_client_queue_set_destroy_cb(hwc_window->cqueue,
+ NULL,
+ NULL);
+
EHWINF("Free", NULL, hwc_window->hwc, hwc_window);
done:
return EINA_TRUE;
}
+static void
+_e_hwc_window_cqueue_destroy_cb(struct wayland_tbm_client_queue *cqueue, void *data)
+{
+ E_Hwc_Window *hwc_window = (E_Hwc_Window *)data;
+
+ hwc_window->cqueue = NULL;
+}
+
EINTERN Eina_Bool
e_hwc_window_activate(E_Hwc_Window *hwc_window, E_Hwc_Window_Queue *queue)
{
cqueue = _get_wayland_tbm_client_queue(hwc_window->ec);
if (cqueue)
- wayland_tbm_server_client_queue_activate(cqueue, 0, queue_size,
- queue_width, queue_height, flush);
+ {
+ wayland_tbm_server_client_queue_activate(cqueue, 0, queue_size,
+ queue_width, queue_height, flush);
+ wayland_tbm_server_client_queue_set_destroy_cb(cqueue,
+ _e_hwc_window_cqueue_destroy_cb,
+ hwc_window);
+ hwc_window->cqueue = cqueue;
+ }
EHWINF("Activate -- ehwq:%p {%s}",
hwc_window->ec, hwc_window->hwc, hwc_window, queue,
EINTERN Eina_Bool
e_hwc_window_deactivate(E_Hwc_Window *hwc_window)
{
- struct wayland_tbm_client_queue * cqueue = NULL;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window->ec, EINA_FALSE);
if (e_hwc_window_is_cursor(hwc_window)) return EINA_TRUE;
- cqueue = _get_wayland_tbm_client_queue(hwc_window->ec);
- if (cqueue)
- wayland_tbm_server_client_queue_deactivate(cqueue);
+ if (hwc_window->cqueue)
+ {
+ wayland_tbm_server_client_queue_deactivate(hwc_window->cqueue);
+ wayland_tbm_server_client_queue_set_destroy_cb(hwc_window->cqueue,
+ NULL,
+ NULL);
+ hwc_window->cqueue = NULL;
+ }
EHWINF("Deactivate -- {%s}",
hwc_window->ec, hwc_window->hwc, hwc_window,
static Eina_Bool
_e_hwc_window_queue_buffer_export(E_Hwc_Window_Queue *queue, E_Hwc_Window_Queue_Buffer *queue_buffer)
{
- struct wayland_tbm_client_queue * cqueue = NULL;
struct wl_resource *wl_buffer = NULL;
E_Hwc_Window *user = NULL;
user = queue->user;
EINA_SAFETY_ON_NULL_RETURN_VAL(user, EINA_FALSE);
- cqueue = _user_cqueue_get(user->ec);
- EINA_SAFETY_ON_NULL_RETURN_VAL(cqueue, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(user->cqueue, EINA_FALSE);
if (queue_buffer->exported) return EINA_TRUE;
/* export the tbm_surface(wl_buffer) to the client_queue */
- wl_buffer = wayland_tbm_server_client_queue_export_buffer2(cqueue, queue_buffer->tsurface,
+ wl_buffer = wayland_tbm_server_client_queue_export_buffer2(user->cqueue, queue_buffer->tsurface,
E_HWC_WINDOW_QUEUE_BUFFER_FLAGS,
_e_hwc_window_queue_exported_buffer_detach_cb,
NULL,
{
E_Hwc_Window_Queue_Buffer *queue_buffer = NULL;
E_Hwc_Window *hwc_window = NULL;
- struct wayland_tbm_client_queue * cqueue = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(queue, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(queue->tqueue, EINA_FALSE);
hwc_window = queue->user;
EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
- cqueue = _user_cqueue_get(hwc_window->ec);
- EINA_SAFETY_ON_NULL_RETURN_VAL(cqueue, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window->cqueue, EINA_FALSE);
queue_buffer = e_hwc_window_queue_buffer_dequeue(queue);
EINA_SAFETY_ON_NULL_RETURN_VAL(queue_buffer, EINA_FALSE);
}
/* send the buffer_usable to the wl_tbm client */
- wayland_tbm_server_client_queue_send_buffer_usable(cqueue, queue_buffer->exported_wl_buffer);
+ wayland_tbm_server_client_queue_send_buffer_usable(hwc_window->cqueue, queue_buffer->exported_wl_buffer);
queue_buffer->usable = EINA_TRUE;
EHWQINF("USA ts:%p tq:%p wl_buffer:%p ehw:%p",
static void
_e_hwc_window_queue_prepare_unset(E_Hwc_Window_Queue *queue)
{
- struct wayland_tbm_client_queue *cqueue = NULL;
E_Hwc_Window *hwc_window = queue->user;
tbm_surface_h tsurface;
E_Hwc_Window_Queue_Buffer *queue_buffer;
if (!hwc_window || !hwc_window->ec) return;
- cqueue = _user_cqueue_get(hwc_window->ec);
- if (cqueue)
- wayland_tbm_server_client_queue_set_wait_usable_cb(cqueue, NULL, NULL);
+ if (hwc_window->cqueue)
+ wayland_tbm_server_client_queue_set_wait_usable_cb(hwc_window->cqueue, NULL, NULL);
if ((!_comp_wl_buffer_get(hwc_window->ec)) &&
(!evas_object_visible_get(hwc_window->ec->frame)) &&