From 7d00ee72d582f1f7cb8b54b712df033add9261a7 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 6 Apr 2016 17:17:08 +0900 Subject: [PATCH] remove queue reset callback Change-Id: I7fcfb64b79d80d5767268785b556a035dca1106a --- src/wayland-tbm-client.c | 97 ------------------------------------------------ src/wayland-tbm-client.h | 13 ------- 2 files changed, 110 deletions(-) diff --git a/src/wayland-tbm-client.c b/src/wayland-tbm-client.c index 24e88b4..d145f57 100755 --- a/src/wayland-tbm-client.c +++ b/src/wayland-tbm-client.c @@ -79,19 +79,8 @@ struct wayland_tbm_surface_queue { struct wl_list attach_bufs; tbm_surface_queue_h tbm_queue; - - struct wl_list reset_noti; -}; - -typedef struct _wayland_tbm_client_queue_notify wayland_tbm_client_queue_notify; - -struct _wayland_tbm_client_queue_notify { - wayland_tbm_client_queue_notify_cb cb; - void *data; - struct wl_list link; }; - static const int key_wl_buffer_imported; #define KEY_WL_BUFFER_IMPORTED ((unsigned long)&key_wl_buffer_imported) @@ -765,7 +754,6 @@ handle_tbm_queue_active(void *data, uint32_t usage) { struct wayland_tbm_surface_queue *queue_info = data; - wayland_tbm_client_queue_notify *item, *tmp = NULL; if (queue_info->is_active) { WL_TBM_C_LOG("warning: queue_info is already activated\n"); @@ -778,11 +766,6 @@ handle_tbm_queue_active(void *data, queue_info->is_active = 1; queue_info->usage = usage; - /* call the reset_noti */ - wl_list_for_each_safe(item, tmp, &queue_info->reset_noti, link) { - item->cb(queue_info->tbm_queue, item->data); - } - /* flush the allocated surfaces at the client */ tbm_surface_queue_flush(queue_info->tbm_queue); } @@ -792,7 +775,6 @@ handle_tbm_queue_deactive(void *data, struct wl_tbm_queue *wl_tbm_queue) { struct wayland_tbm_surface_queue *queue_info = data; - wayland_tbm_client_queue_notify *item, *tmp = NULL; #ifdef DEBUG_TRACE WL_TBM_TRACE(" pid:%d\n", getpid()); @@ -805,11 +787,6 @@ handle_tbm_queue_deactive(void *data, queue_info->is_active = 0; - /* call the reset_noti */ - wl_list_for_each_safe(item, tmp, &queue_info->reset_noti, link) { - item->cb(queue_info->tbm_queue, item->data); - } - /* flush the attached surfaces */ _wayland_tbm_client_surface_queue_flush(queue_info); } @@ -848,18 +825,11 @@ handle_tbm_surface_queue_destroy_notify(tbm_surface_queue_h surface_queue, void *data) { struct wayland_tbm_surface_queue *queue_info = data; - wayland_tbm_client_queue_notify *item, *tmp; #ifdef DEBUG_TRACE WL_TBM_TRACE(" pid:%d\n", getpid()); #endif - /* remove the reset notis in the queue_info */ - wl_list_for_each_safe(item, tmp, &queue_info->reset_noti, link) { - wl_list_remove(&item->link); - free(item); - } - /* remove the attach_bufs int the queue_info */ _wayland_tbm_client_queue_destory_attach_bufs(queue_info); @@ -889,7 +859,6 @@ wayland_tbm_client_create_surface_queue(struct wayland_tbm_client *tbm_client, WL_TBM_RETURN_VAL_IF_FAIL(queue_info != NULL, NULL); queue_info->bufmgr = tbm_client->bufmgr; wl_list_init(&queue_info->attach_bufs); - wl_list_init(&queue_info->reset_noti); queue = wl_tbm_create_surface_queue(tbm_client->wl_tbm, surface); WL_TBM_GOTO_IF_FAIL(queue != NULL, fail); @@ -937,69 +906,3 @@ fail: return NULL; } -int wayland_tbm_client_add_reset_queue_cb(struct wayland_tbm_client *tbm_client, - tbm_surface_queue_h surface_queue, - wayland_tbm_client_queue_notify_cb reset_queue_cb, - void *data) -{ - struct wayland_tbm_surface_queue *queue_info = NULL; - wayland_tbm_client_queue_notify *item = NULL; - - WL_TBM_RETURN_VAL_IF_FAIL(tbm_client != NULL, 0); - WL_TBM_RETURN_VAL_IF_FAIL(surface_queue != NULL, 0); - WL_TBM_RETURN_VAL_IF_FAIL(reset_queue_cb != NULL, 0); - - // TODO: verify the surface_queue in the tbm_client - WL_TBM_RETURN_VAL_IF_FAIL(tbm_client->queue_info != NULL, 0); - queue_info = tbm_client->queue_info; - if (surface_queue != queue_info->tbm_queue) { - WL_TBM_C_LOG("surface_queue != queue_info->tbm_queue\n"); - return 0; - } - - item = calloc(1, sizeof(struct _wayland_tbm_client_queue_notify)); - WL_TBM_RETURN_VAL_IF_FAIL(item != NULL,0); - - item->cb = reset_queue_cb; - item->data = data; - - wl_list_insert(&queue_info->reset_noti, &item->link); - - return 1; -} - - -int wayland_tbm_client_remove_reset_queue_cb(struct wayland_tbm_client *tbm_client, - tbm_surface_queue_h surface_queue, - wayland_tbm_client_queue_notify_cb reset_queue_cb, - void *data) -{ - struct wayland_tbm_surface_queue *queue_info = NULL; - wayland_tbm_client_queue_notify *item, *tmp = NULL; - - WL_TBM_RETURN_VAL_IF_FAIL(tbm_client != NULL, 0); - WL_TBM_RETURN_VAL_IF_FAIL(surface_queue != NULL, 0); - WL_TBM_RETURN_VAL_IF_FAIL(reset_queue_cb != NULL, 0); - - // TODO: verify the surface_queue in the tbm_client - WL_TBM_RETURN_VAL_IF_FAIL(tbm_client->queue_info != NULL, 0); - queue_info = tbm_client->queue_info; - if (surface_queue != queue_info->tbm_queue) { - WL_TBM_C_LOG("surface_queue != queue_info->tbm_queue\n"); - return 0; - } - - /* unref the tbm surfaces attached */ - wl_list_for_each_safe(item, tmp, &queue_info->reset_noti, link) { - if (item->cb == reset_queue_cb && item->data == data) { - wl_list_remove(&item->link); - free(item); - return 1; - } - } - - WL_TBM_C_LOG("Warning: cannot fine the reset notify in the queue.\n"); - - return 0; -} - diff --git a/src/wayland-tbm-client.h b/src/wayland-tbm-client.h index ec8f8a6..054441e 100755 --- a/src/wayland-tbm-client.h +++ b/src/wayland-tbm-client.h @@ -40,9 +40,6 @@ extern "C" { struct wayland_tbm_client; -typedef void (*wayland_tbm_client_queue_notify_cb) (tbm_surface_queue_h surface_queue, - void *data); - struct wayland_tbm_client * wayland_tbm_client_init(struct wl_display *display); @@ -66,16 +63,6 @@ wayland_tbm_client_create_surface_queue(struct wayland_tbm_client *tbm_client, int queue_size, int width, int height, tbm_format format); -int wayland_tbm_client_add_reset_queue_cb(struct wayland_tbm_client *tbm_client, - tbm_surface_queue_h surface_queue, - wayland_tbm_client_queue_notify_cb reset_queue_cb, - void *data); -; -int wayland_tbm_client_remove_reset_queue_cb(struct wayland_tbm_client *tbm_client, - tbm_surface_queue_h surface_queue, - wayland_tbm_client_queue_notify_cb reset_queue_cb, - void *data); - #ifdef __cplusplus } #endif -- 2.7.4