From ba16506e941077f35b09f06530b748c7888defd6 Mon Sep 17 00:00:00 2001 From: Xuelian Bai Date: Thu, 7 Mar 2019 19:57:49 +0800 Subject: [PATCH 01/16] Call wayland_tbm_client_create_surface_queue_tiled and set flags for tbm_surface_queue_sequence_create, if GPU support tiled memory. Change-Id: I64da5f16368589777b1d53444f00fa976c783202 --- src/tpl_wayland_egl.c | 44 +++++++++++++++++++++++--------- src/tpl_wayland_egl_thread.c | 61 +++++++++++++++++++++++++++++++++----------- 2 files changed, 78 insertions(+), 27 deletions(-) diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index 387882d..f358985 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -504,6 +504,9 @@ __tpl_wayland_egl_surface_init(tpl_surface_t *surface) tpl_wayland_egl_display_t *wayland_egl_display; tpl_wayland_egl_surface_t *wayland_egl_surface; struct wl_egl_window *wl_egl_window; + tbm_bufmgr bufmgr = NULL; + unsigned int capability; + int flags = TBM_BO_DEFAULT; TPL_ASSERT(surface); TPL_ASSERT(surface->display); @@ -550,22 +553,39 @@ __tpl_wayland_egl_surface_init(tpl_surface_t *surface) goto alloc_dequeue_buffers_fail; } + bufmgr = tbm_bufmgr_init(-1); + capability = tbm_bufmgr_get_capability(bufmgr); + tbm_bufmgr_deinit(bufmgr); + + if (capability & TBM_BUFMGR_CAPABILITY_TILED_MEMORY) + flags = TBM_BO_TILED; + if (wl_egl_window->surface) { - wayland_egl_surface->tbm_queue = wayland_tbm_client_create_surface_queue( - wayland_egl_display->wl_tbm_client, - wl_egl_window->surface, - surface->num_buffers, - wl_egl_window->width, - wl_egl_window->height, - surface->format); + if (flags == TBM_BO_TILED) { + wayland_egl_surface->tbm_queue = wayland_tbm_client_create_surface_queue_tiled( + wayland_egl_display->wl_tbm_client, + wl_egl_window->surface, + surface->num_buffers, + wl_egl_window->width, + wl_egl_window->height, + surface->format); + } else { + wayland_egl_surface->tbm_queue = wayland_tbm_client_create_surface_queue( + wayland_egl_display->wl_tbm_client, + wl_egl_window->surface, + surface->num_buffers, + wl_egl_window->width, + wl_egl_window->height, + surface->format); + } } else /*Why wl_surface is NULL ?*/ wayland_egl_surface->tbm_queue = tbm_surface_queue_sequence_create( - surface->num_buffers, - wl_egl_window->width, - wl_egl_window->height, - surface->format, - 0); + surface->num_buffers, + wl_egl_window->width, + wl_egl_window->height, + surface->format, + flags); if (!wayland_egl_surface->tbm_queue) { TPL_ERR("TBM surface queue creation failed!"); diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index ce438ff..30227a0 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -2146,6 +2146,8 @@ _twe_surface_create_tbm_queue(twe_wl_surf_source *source, { tbm_surface_queue_h tbm_queue = NULL; struct wl_egl_window *wl_egl_window = (struct wl_egl_window *)native_handle; + tbm_bufmgr bufmgr = NULL; + unsigned int capability; if (!wl_tbm_client || !wl_egl_window) { TPL_ERR("Invalid parameters. wl_tbm_client(%p) wl_egl_window(%p)", @@ -2153,13 +2155,27 @@ _twe_surface_create_tbm_queue(twe_wl_surf_source *source, return NULL; } - tbm_queue = wayland_tbm_client_create_surface_queue( - wl_tbm_client, - wl_egl_window->surface, - num_buffers, - wl_egl_window->width, - wl_egl_window->height, - format); + bufmgr = tbm_bufmgr_init(-1); + capability = tbm_bufmgr_get_capability(bufmgr); + tbm_bufmgr_deinit(bufmgr); + + if (capability & TBM_BUFMGR_CAPABILITY_TILED_MEMORY) { + tbm_queue = wayland_tbm_client_create_surface_queue_tiled( + wl_tbm_client, + wl_egl_window->surface, + num_buffers, + wl_egl_window->width, + wl_egl_window->height, + format); + } else { + tbm_queue = wayland_tbm_client_create_surface_queue( + wl_tbm_client, + wl_egl_window->surface, + num_buffers, + wl_egl_window->width, + wl_egl_window->height, + format); + } if (!tbm_queue) { TPL_ERR("Failed to create tbm_surface_queue."); @@ -2529,6 +2545,8 @@ twe_surface_create_swapchain(twe_surface_h twe_surface, twe_wl_surf_source *surf_source = (twe_wl_surf_source *)twe_surface; twe_wl_disp_source *disp_source = NULL; GMainContext *context; + tbm_bufmgr bufmgr = NULL; + unsigned int capability; if (!surf_source || g_source_is_destroyed(&surf_source->gsource)) { TPL_ERR("twe_surface(%p) is invalid.", twe_surface); @@ -2568,12 +2586,25 @@ twe_surface_create_swapchain(twe_surface_h twe_surface, } } - surf_source->tbm_queue = wayland_tbm_client_create_surface_queue( - disp_source->wl_tbm_client, - surf_source->surf, - buffer_count, - width, height, - TBM_FORMAT_ARGB8888); + bufmgr = tbm_bufmgr_init(-1); + capability = tbm_bufmgr_get_capability(bufmgr); + tbm_bufmgr_deinit(bufmgr); + + if (capability & TBM_BUFMGR_CAPABILITY_TILED_MEMORY) { + surf_source->tbm_queue = wayland_tbm_client_create_surface_queue_tiled( + disp_source->wl_tbm_client, + surf_source->surf, + buffer_count, + width, height, + TBM_FORMAT_ARGB8888); + } else { + surf_source->tbm_queue = wayland_tbm_client_create_surface_queue( + disp_source->wl_tbm_client, + surf_source->surf, + buffer_count, + width, height, + TBM_FORMAT_ARGB8888); + } if (!surf_source->tbm_queue) { TPL_ERR("TBM surface queue creation failed!"); @@ -3203,8 +3234,8 @@ twe_surface_queue_force_flush(twe_surface_h twe_surface) g_mutex_unlock(&surf_source->surf_mutex); TPL_LOG_T(BACKEND, - "[FORCE_FLUSH] surf_source(%p) tbm_queue(%p)", - surf_source, surf_source->tbm_queue); + "[FORCE_FLUSH] surf_source(%p) tbm_queue(%p)", + surf_source, surf_source->tbm_queue); return TPL_ERROR_NONE; } -- 2.7.4 From 857e4ecbabd5ad67dc965c5e7ec31bc2594349b2 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Mon, 1 Apr 2019 15:17:38 +0900 Subject: [PATCH 02/16] tpl_wayland_egl: Added checking reset flag to fix frontbuffer mode - If activate-> deactivate-> activate occurs between tpl_surface_dequeue <-> tpl_surface_dequeue, a new dequeue is needed. Change-Id: Ie76f8f0ccd3e7aac6b912f6e9bd4dd90eea9b121 Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl.c | 2 +- src/tpl_wl_egl_thread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index f358985..7185368 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -1231,7 +1231,7 @@ __tpl_wayland_egl_surface_dequeue_buffer(tpl_surface_t *surface, uint64_t timeou * it will return that frontbuffer if it is still activated, * otherwise dequeue the new buffer after initializing * surface->frontbuffer to NULL. */ - if (is_activated) { + if (is_activated && !wayland_egl_surface->reset) { TPL_LOG_B("WL_EGL", "[DEQ][F] surface->frontbuffer(%p) BO_NAME(%d)", surface->frontbuffer, diff --git a/src/tpl_wl_egl_thread.c b/src/tpl_wl_egl_thread.c index 2452d88..bd7ecbb 100644 --- a/src/tpl_wl_egl_thread.c +++ b/src/tpl_wl_egl_thread.c @@ -716,7 +716,7 @@ __tpl_wl_egl_surface_dequeue_buffer(tpl_surface_t *surface, uint64_t timeout_ns, * it will return that frontbuffer if it is still activated, * otherwise dequeue the new buffer after initializing * surface->frontbuffer to NULL. */ - if (is_activated) { + if (is_activated && !wayland_egl_surface->reset) { TPL_LOG_T("WL_EGL", "[DEQ][F] surface->frontbuffer(%p) BO_NAME(%d)", surface->frontbuffer, -- 2.7.4 From cb7d037bb3eba592acfee996234a1ddf20232723 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Mon, 8 Apr 2019 14:49:33 +0900 Subject: [PATCH 03/16] Package version up to 1.6.1 - Minor version up to 6 to separate tizen_5.5 feature. Change-Id: I84612ff2a48b23446502dcfbb47394ee0e23bb7b Signed-off-by: Joonbum Ko --- packaging/libtpl-egl.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 1fc213c..9a1fc6f 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -3,8 +3,8 @@ #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 -%define TPL_VERSION_MINOR 5 -%define TPL_VERSION_PATCH 30 +%define TPL_VERSION_MINOR 6 +%define TPL_VERSION_PATCH 1 %define TPL_VERSION %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH} #TPL WINDOW SYSTEM DEFINITION -- 2.7.4 From d1ada33513a9a4934f1f92882e6498e5a431724a Mon Sep 17 00:00:00 2001 From: Xuelian Bai Date: Mon, 15 Apr 2019 20:15:44 +0800 Subject: [PATCH 04/16] Fix a typo Change-Id: I3411edd175f7898dfe426bd398f29739cb39044a --- src/tpl_wayland_egl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index 7185368..f9debe1 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -802,7 +802,7 @@ __cb_tdm_client_wait_vblank(tdm_client_vblank *vblank, tdm_error error, tpl_wayland_egl_surface_t *wayland_egl_surface = (tpl_wayland_egl_surface_t *)user_data; wayland_egl_surface->vblank_done = TPL_TRUE; - TRACE_MARK("TDM_CLIENT_VBLACK"); + TRACE_MARK("TDM_CLIENT_VBLANK"); } static void -- 2.7.4 From 20d3cbf66b6987f36dd72ad8240fdecd8ab4047d Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Mon, 15 Apr 2019 14:55:41 +0900 Subject: [PATCH 05/16] tpl_wayland_egl_thread: Modified get_window_info internal function. - Modified the internal function so that the first format can be maintained to avoid problems when a_size is changed in a way different from the format at the time of surface creation. Change-Id: I8b65c5fb9a02f7b01286429735f703aad90adbfe Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl_thread.c | 14 +++++++++++++- src/tpl_wayland_egl_thread.h | 2 +- src/tpl_wl_egl_thread.c | 9 +-------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 30227a0..8e65783 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -3265,7 +3265,8 @@ twe_check_native_handle_is_wl_display(tpl_handle_t display) } tpl_result_t -twe_get_native_window_info(tpl_handle_t window, int *width, int *height) +twe_get_native_window_info(tpl_handle_t window, int *width, int *height, + tbm_format *format, int a_size) { struct wl_egl_window *wl_egl_window = (struct wl_egl_window *)window; if (!wl_egl_window) { @@ -3275,6 +3276,17 @@ twe_get_native_window_info(tpl_handle_t window, int *width, int *height) if (width) *width = wl_egl_window->width; if (height) *height = wl_egl_window->height; + if (format) { + if (wl_egl_window->private) { + twe_wl_surf_source *surf_source = (twe_wl_surf_source *)wl_egl_window->private; + *format = surf_source->format; + } else { + if (a_size == 8) + *format = TBM_FORMAT_ARGB8888; + else + *format = TBM_FORMAT_XRGB8888; + } + } return TPL_ERROR_NONE; } diff --git a/src/tpl_wayland_egl_thread.h b/src/tpl_wayland_egl_thread.h index dfe6f6f..6cb9116 100644 --- a/src/tpl_wayland_egl_thread.h +++ b/src/tpl_wayland_egl_thread.h @@ -105,7 +105,7 @@ tpl_bool_t twe_check_native_handle_is_wl_display(tpl_handle_t display); tpl_result_t -twe_get_native_window_info(tpl_handle_t window, int *width, int *height); +twe_get_native_window_info(tpl_handle_t window, int *width, int *height, tbm_format *format, int a_size); tbm_surface_h twe_get_native_buffer_from_pixmap(tpl_handle_t pixmap); diff --git a/src/tpl_wl_egl_thread.c b/src/tpl_wl_egl_thread.c index bd7ecbb..4ebe168 100644 --- a/src/tpl_wl_egl_thread.c +++ b/src/tpl_wl_egl_thread.c @@ -189,14 +189,7 @@ __tpl_wl_egl_display_get_window_info(tpl_display_t *display, TPL_ASSERT(display); TPL_ASSERT(window); - if (format) { - if (a_size == 8) - *format = TBM_FORMAT_ARGB8888; - else - *format = TBM_FORMAT_XRGB8888; - } - - if ((ret = twe_get_native_window_info(window, width, height)) + if ((ret = twe_get_native_window_info(window, width, height, format, a_size)) != TPL_ERROR_NONE) { TPL_ERR("Failed to get size info of native_window(%p)", window); } -- 2.7.4 From f393494b728527648a021ef13c07aa2278135758 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 18 Apr 2019 16:39:43 +0900 Subject: [PATCH 06/16] Added TRACE at the missed point. Change-Id: I70f6bdd58f2962b4e9b9224eda2c83545b4b1ee3 Signed-off-by: Joonbum Ko --- src/tpl_tbm.c | 4 ++++ src/tpl_wayland_egl.c | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/tpl_tbm.c b/src/tpl_tbm.c index df39918..5fbf2e9 100644 --- a/src/tpl_tbm.c +++ b/src/tpl_tbm.c @@ -536,6 +536,8 @@ __tpl_tbm_surface_enqueue_buffer(tpl_surface_t *surface, return TPL_ERROR_INVALID_PARAMETER; } + TRACE_ASYNC_END((void *)tbm_surface, "[DEQ]~[ENQ] BO(%d)", tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); + tbm_surface_internal_unref(tbm_surface); if (surface->type == TPL_SURFACE_TYPE_PIXMAP) { @@ -686,6 +688,8 @@ __tpl_tbm_surface_dequeue_buffer(tpl_surface_t *surface, uint64_t timeout_ns, surface, tbm_queue, tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); + TRACE_ASYNC_BEGIN((void *)tbm_surface, "[DEQ]~[ENQ] BO(%d)", tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); + return tbm_surface; } diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index f9debe1..80a2812 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -824,8 +824,7 @@ __tpl_wayland_egl_surface_commit(tpl_surface_t *surface, __tpl_wayland_egl_get_wayland_buffer_from_tbm_surface(tbm_surface); TPL_ASSERT(wayland_egl_buffer); - TRACE_ASYNC_END((int)wayland_egl_buffer, "[DEQ]~[ENQ] BO_NAME:%d", - tbm_bo_export(wayland_egl_buffer->bo)); + TRACE_MARK("[COMMIT] BO_NAME:%d", tbm_bo_export(wayland_egl_buffer->bo)); TPL_IMAGE_DUMP(tbm_surface, surface->width, surface->height); @@ -998,9 +997,6 @@ __tpl_wayland_egl_surface_enqueue_buffer(tpl_surface_t *surface, wayland_egl_buffer->is_new = TPL_FALSE; - if (wayland_egl_surface->vblank_done == TPL_FALSE) - __tpl_wayland_egl_surface_wait_vblank(surface); - if (sync_fence != -1) { tbm_sync_fence_wait(sync_fence, -1); close(sync_fence); @@ -1022,6 +1018,14 @@ __tpl_wayland_egl_surface_enqueue_buffer(tpl_surface_t *surface, return TPL_ERROR_INVALID_OPERATION; } + TRACE_ASYNC_END((int)wayland_egl_buffer, "[DEQ]~[ENQ] BO_NAME:%d", + tbm_bo_export(wayland_egl_buffer->bo)); + + TRACE_BEGIN("[WAIT_VBLANK]"); + if (wayland_egl_surface->vblank_done == TPL_FALSE) + __tpl_wayland_egl_surface_wait_vblank(surface); + TRACE_END(); + tsq_err = tbm_surface_queue_acquire(wayland_egl_surface->tbm_queue, &tbm_surface); if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE) { -- 2.7.4 From 69e513002ad5aa535d932454520c07c2b08722fe Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 7 May 2019 11:05:43 +0900 Subject: [PATCH 07/16] Package version up to 1.6.2 Change-Id: Ieb01036ab1ca55e4b44bf4c8f46266ed4f9e6f43 Signed-off-by: Joonbum Ko --- packaging/libtpl-egl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 9a1fc6f..372d9fe 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -4,7 +4,7 @@ #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 %define TPL_VERSION_MINOR 6 -%define TPL_VERSION_PATCH 1 +%define TPL_VERSION_PATCH 2 %define TPL_VERSION %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH} #TPL WINDOW SYSTEM DEFINITION -- 2.7.4 From 6d084053fc1a218d4312ecc8cf99e07c92836b1a Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 9 May 2019 10:08:16 +0900 Subject: [PATCH 08/16] tpl_tbm: Fixed build warning Change-Id: I91f2a54b138ad03e42489e55b86ca2e470f1b54b Signed-off-by: Joonbum Ko --- src/tpl_tbm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tpl_tbm.c b/src/tpl_tbm.c index 5fbf2e9..33dd453 100644 --- a/src/tpl_tbm.c +++ b/src/tpl_tbm.c @@ -536,7 +536,7 @@ __tpl_tbm_surface_enqueue_buffer(tpl_surface_t *surface, return TPL_ERROR_INVALID_PARAMETER; } - TRACE_ASYNC_END((void *)tbm_surface, "[DEQ]~[ENQ] BO(%d)", tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); + TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO(%d)", tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); tbm_surface_internal_unref(tbm_surface); @@ -688,7 +688,7 @@ __tpl_tbm_surface_dequeue_buffer(tpl_surface_t *surface, uint64_t timeout_ns, surface, tbm_queue, tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); - TRACE_ASYNC_BEGIN((void *)tbm_surface, "[DEQ]~[ENQ] BO(%d)", tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); + TRACE_ASYNC_BEGIN((int)tbm_surface, "[DEQ]~[ENQ] BO(%d)", tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); return tbm_surface; } -- 2.7.4 From f3c13ca0055e7a46b96b29450ac2aa3445655ddc Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Fri, 10 May 2019 13:10:11 +0900 Subject: [PATCH 09/16] tpl_wayland_egl_thread: Modified del_source related thread_cond. Change-Id: I2547293e6849c2fb6322d0351f437ed5580a6e73 Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl_thread.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 8e65783..767dba7 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -240,8 +240,12 @@ _twe_thread_del_source_dispatch(GSource *source, GSourceFunc cb, gpointer data) twe_del_source *del_source = (twe_del_source *)source; GIOCondition cond; + g_mutex_lock(&_twe_ctx->thread_mutex); + if (g_source_is_destroyed(source)) { TPL_ERR("del_source(%p) already destroyed.", source); + g_cond_signal(&_twe_ctx->thread_cond); + g_mutex_unlock(&_twe_ctx->thread_mutex); return G_SOURCE_REMOVE; } @@ -261,9 +265,14 @@ _twe_thread_del_source_dispatch(GSource *source, GSourceFunc cb, gpointer data) } else { TPL_ERR("eventfd(%d) cannot wake up with other condition. cond(%d)", del_source->event_fd, cond); + g_cond_signal(&_twe_ctx->thread_cond); + g_mutex_unlock(&_twe_ctx->thread_mutex); TPL_ASSERT((cond & G_IO_IN)); } + g_cond_signal(&_twe_ctx->thread_cond); + g_mutex_unlock(&_twe_ctx->thread_mutex); + return G_SOURCE_CONTINUE; } @@ -448,12 +457,8 @@ _twe_thread_tdm_source_destroy(void *source) { twe_tdm_source *tdm_source = (twe_tdm_source *)source; - g_mutex_lock(&_twe_ctx->thread_mutex); - if (!tdm_source || g_source_is_destroyed(&tdm_source->gsource)) { TPL_ERR("TDM source(%p) already destroyed.", tdm_source); - g_cond_signal(&_twe_ctx->thread_cond); - g_mutex_unlock(&_twe_ctx->thread_mutex); return; } @@ -462,9 +467,6 @@ _twe_thread_tdm_source_destroy(void *source) g_source_remove_unix_fd(&tdm_source->gsource, tdm_source->tag); g_source_destroy(&tdm_source->gsource); g_source_unref(&tdm_source->gsource); - - g_cond_signal(&_twe_ctx->thread_cond); - g_mutex_unlock(&_twe_ctx->thread_mutex); } twe_thread* @@ -888,7 +890,6 @@ _twe_thread_wl_disp_source_destroy(void *source) return; } - g_mutex_lock(&_twe_ctx->thread_mutex); g_mutex_lock(&disp_source->wl_event_mutex); /* If disp_source is in prepared state, cancel it */ @@ -913,9 +914,6 @@ _twe_thread_wl_disp_source_destroy(void *source) g_source_remove_poll(&disp_source->gsource, &disp_source->gfd); g_source_destroy(&disp_source->gsource); g_source_unref(&disp_source->gsource); - - g_cond_signal(&_twe_ctx->thread_cond); - g_mutex_unlock(&_twe_ctx->thread_mutex); } twe_display_h @@ -2269,8 +2267,6 @@ _twe_thread_wl_surf_source_destroy(void *source) return; } - g_mutex_lock(&_twe_ctx->thread_mutex); - g_mutex_lock(&disp_source->wl_event_mutex); g_mutex_lock(&surf_source->surf_mutex); @@ -2356,9 +2352,6 @@ _twe_thread_wl_surf_source_destroy(void *source) g_source_remove_unix_fd(&surf_source->gsource, surf_source->tag); g_source_destroy(&surf_source->gsource); g_source_unref(&surf_source->gsource); - - g_cond_signal(&_twe_ctx->thread_cond); - g_mutex_unlock(&_twe_ctx->thread_mutex); } static gpointer -- 2.7.4 From 2a27f7abff3bca56f2a9411198aa9789ebc319cf Mon Sep 17 00:00:00 2001 From: Xiaowei Guan Date: Mon, 13 May 2019 22:04:46 +0800 Subject: [PATCH 10/16] Sync wayland-egl code from wayland Because mesa need use latest wayland-egl code, so sync latest wayland-egl code from wayland.freedesktop.org. Change-Id: I891d777e88540e64e509c8c991dc117750887bad --- src/wayland-egl/wayland-egl-priv.h | 3 +++ src/wayland-egl/wayland-egl.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wayland-egl/wayland-egl-priv.h b/src/wayland-egl/wayland-egl-priv.h index e729417..b37d9e2 100644 --- a/src/wayland-egl/wayland-egl-priv.h +++ b/src/wayland-egl/wayland-egl-priv.h @@ -15,7 +15,10 @@ extern "C" { #include #include +#define WL_EGL_WINDOW_VERSION 3 + struct wl_egl_window { + const intptr_t version; struct wl_surface *surface; int width; diff --git a/src/wayland-egl/wayland-egl.c b/src/wayland-egl/wayland-egl.c index cdb8b6a..05b726a 100644 --- a/src/wayland-egl/wayland-egl.c +++ b/src/wayland-egl/wayland-egl.c @@ -90,11 +90,13 @@ wl_egl_window_create(struct wl_surface *surface, WL_EGL_ERR("failed to allocate memory for egl_window"); return NULL; } + intptr_t *version = (intptr_t *)&egl_window->version; + *version = WL_EGL_WINDOW_VERSION; egl_window->surface = surface; - egl_window->width = 0; - egl_window->height = 0; + egl_window->width = width; + egl_window->height = height; egl_window->resize_callback = NULL; wl_egl_window_resize(egl_window, width, height, 0, 0); -- 2.7.4 From 5d70d0baf76880209524035e5f22a9c6ad4454c2 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Fri, 10 May 2019 13:11:09 +0900 Subject: [PATCH 11/16] Package version up to 1.6.3 Change-Id: I2de6663a7447ea96e009e69eb4de9118be1f47ca Signed-off-by: Joonbum Ko --- packaging/libtpl-egl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 372d9fe..1a9d1b2 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -4,7 +4,7 @@ #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 %define TPL_VERSION_MINOR 6 -%define TPL_VERSION_PATCH 2 +%define TPL_VERSION_PATCH 3 %define TPL_VERSION %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH} #TPL WINDOW SYSTEM DEFINITION -- 2.7.4 From 045adf7abab4d62827c671ff89c503b7ef48ab7e Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Wed, 3 Jul 2019 16:49:51 +0900 Subject: [PATCH 12/16] gbm: Deleted the usage of gbm. Change-Id: I50a7b5a44fc844020cd6ec2bee17f51178bc8a21 Signed-off-by: Joonbum Ko --- src/Makefile.am | 1 - tc/src/tpl-test_base.h | 2 -- tc/test/tpl-test_display_test.cpp | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index bafc8fd..d885262 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,7 +25,6 @@ libtpl_egl_la_SOURCES = tpl.c \ # Wayland if WITH_WAYLAND libtpl_egl_la_SOURCES += tpl_wayland_egl.c \ - tpl_gbm.c \ tpl_wl_egl_thread.c \ tpl_wayland_egl_thread.c \ tpl_wayland_vk_wsi.c \ diff --git a/tc/src/tpl-test_base.h b/tc/src/tpl-test_base.h index 071357e..7678ae2 100644 --- a/tc/src/tpl-test_base.h +++ b/tc/src/tpl-test_base.h @@ -12,8 +12,6 @@ #include #include -#include - #ifdef __cplusplus extern "C" { #endif diff --git a/tc/test/tpl-test_display_test.cpp b/tc/test/tpl-test_display_test.cpp index af7df80..ffacbf8 100644 --- a/tc/test/tpl-test_display_test.cpp +++ b/tc/test/tpl-test_display_test.cpp @@ -110,7 +110,7 @@ typedef TPLTestBase DEFAULT_tpl_display_filter_config; TEST_F(DEFAULT_tpl_display_filter_config, success) { tpl_result_t result; - int test_visual_id = GBM_FORMAT_ARGB8888; + int test_visual_id = TBM_FORMAT_ARGB8888; result = tpl_display_filter_config(backend->tpl_display, &test_visual_id, 0); @@ -120,7 +120,7 @@ TEST_F(DEFAULT_tpl_display_filter_config, success) TEST_F(DEFAULT_tpl_display_filter_config, failure_invalid_display) { tpl_result_t result; - int test_visual_id = GBM_FORMAT_ARGB8888; + int test_visual_id = TBM_FORMAT_ARGB8888; result = tpl_display_filter_config(NULL, &test_visual_id, 0); ASSERT_EQ(TPL_ERROR_INVALID_PARAMETER, result); -- 2.7.4 From 2158f127a0c7e0d88c5ca3ec10e65e506bd8f778 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Wed, 3 Jul 2019 16:51:31 +0900 Subject: [PATCH 13/16] gbm: Removed the build dependency with libgbm. - Removed the tpl_gbm backend from the build. - but did not delete the source file yet. Change-Id: Ie812a4f92a234b210955ddade0a958c6e51499be Signed-off-by: Joonbum Ko --- configure.ac | 2 +- packaging/libtpl-egl.spec | 1 - src/tpl.c | 8 -------- src/tpl_internal.h | 3 --- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index fbdb729..07b3094 100644 --- a/configure.ac +++ b/configure.ac @@ -60,7 +60,7 @@ AC_ARG_WITH([wayland], [with_wayland=yes]) AS_IF([test "${with_wayland}" = "yes" || test "${with_wayland}" = "1"], - [PKG_CHECK_MODULES([TPL_WL], [gbm libtdm-client wayland-tbm-client wayland-tbm-server tizen-surface-client glib-2.0]) + [PKG_CHECK_MODULES([TPL_WL], [libtdm-client wayland-tbm-client wayland-tbm-server tizen-surface-client glib-2.0]) TPL_CFLAGS+="$TPL_WL_CFLAGS" TPL_CFLAGS+=" -DTPL_WINSYS_WL=1 " TPL_LIBS+="$TPL_WL_LIBS"], diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 1a9d1b2..3a1b38e 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -78,7 +78,6 @@ BuildRequires: pkgconfig(libdrm) %if "%{TPL_WINSYS}" == "WL" BuildRequires: libtool BuildRequires: wayland-devel -BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(libtdm-client) BuildRequires: pkgconfig(wayland-tbm-client) BuildRequires: pkgconfig(wayland-tbm-server) diff --git a/src/tpl.c b/src/tpl.c index 7c834ce..2a19d8d 100644 --- a/src/tpl.c +++ b/src/tpl.c @@ -261,8 +261,6 @@ __tpl_display_choose_backend(tpl_handle_t native_dpy) #ifdef TPL_WINSYS_WL if (__tpl_display_choose_backend_tbm(native_dpy) == TPL_TRUE) return TPL_BACKEND_TBM; - if (__tpl_display_choose_backend_gbm(native_dpy) == TPL_TRUE) - return TPL_BACKEND_GBM; if (wl_egl_thread) { if (__tpl_display_choose_backend_wl_egl_thread(native_dpy)) return TPL_BACKEND_WAYLAND_THREAD; @@ -292,9 +290,6 @@ __tpl_display_init_backend(tpl_display_t *display, tpl_backend_type_t type) switch (type) { #ifdef TPL_WINSYS_WL - case TPL_BACKEND_GBM: - __tpl_display_init_backend_gbm(&display->backend); - break; case TPL_BACKEND_WAYLAND: __tpl_display_init_backend_wayland_egl(&display->backend); break; @@ -434,9 +429,6 @@ __tpl_surface_init_backend(tpl_surface_t *surface, tpl_backend_type_t type) switch (type) { #ifdef TPL_WINSYS_WL - case TPL_BACKEND_GBM: - __tpl_surface_init_backend_gbm(&surface->backend); - break; case TPL_BACKEND_WAYLAND: __tpl_surface_init_backend_wayland_egl(&surface->backend); break; diff --git a/src/tpl_internal.h b/src/tpl_internal.h index 4d1d45d..6dff22f 100644 --- a/src/tpl_internal.h +++ b/src/tpl_internal.h @@ -213,7 +213,6 @@ void __tpl_runtime_remove_surface(tpl_surface_t *surface); /* Backend initialization functions. */ tpl_backend_type_t __tpl_display_choose_backend(tpl_handle_t native_dpy); -tpl_bool_t __tpl_display_choose_backend_gbm(tpl_handle_t native_dpy); tpl_bool_t __tpl_display_choose_backend_tbm(tpl_handle_t native_dpy); tpl_bool_t __tpl_display_choose_backend_wayland_egl(tpl_handle_t native_dpy); tpl_bool_t __tpl_display_choose_backend_wl_egl_thread(tpl_handle_t native_dpy); @@ -224,7 +223,6 @@ void __tpl_display_init_backend(tpl_display_t *display, tpl_backend_type_t type); void __tpl_surface_init_backend(tpl_surface_t *surface, tpl_backend_type_t type); -void __tpl_display_init_backend_gbm(tpl_display_backend_t *backend); void __tpl_display_init_backend_tbm(tpl_display_backend_t *backend, tpl_backend_type_t type); void __tpl_display_init_backend_wayland_egl(tpl_display_backend_t *backend); @@ -233,7 +231,6 @@ void __tpl_display_init_backend_wayland_vk_wsi(tpl_display_backend_t *backend); void __tpl_display_init_backend_wl_vk_wsi_thread(tpl_display_backend_t *backend); void __tpl_display_init_backend_x11_dri2(tpl_display_backend_t *backend); void __tpl_display_init_backend_x11_dri3(tpl_display_backend_t *backend); -void __tpl_surface_init_backend_gbm(tpl_surface_backend_t *backend); void __tpl_surface_init_backend_tbm(tpl_surface_backend_t *backend, tpl_backend_type_t type); void __tpl_surface_init_backend_wayland_egl(tpl_surface_backend_t *backend); -- 2.7.4 From 1b9dd6d33d1cc6c8a1218ac92d4f041ee30af10e Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 4 Jul 2019 10:27:43 +0900 Subject: [PATCH 14/16] Package version up to 1.6.4 - Deleted the gbm dependency to resolve conflicts with Mesa. Change-Id: Iac16688ab8ffef51e9f1dd08447f28f7190aef27 Signed-off-by: Joonbum Ko --- packaging/libtpl-egl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 3a1b38e..340ca71 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -4,7 +4,7 @@ #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 %define TPL_VERSION_MINOR 6 -%define TPL_VERSION_PATCH 3 +%define TPL_VERSION_PATCH 4 %define TPL_VERSION %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH} #TPL WINDOW SYSTEM DEFINITION -- 2.7.4 From d00f3636c3c5338e5635e6fd4ad8d4fde419da0e Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 25 Jun 2019 17:56:04 +0900 Subject: [PATCH 15/16] [1/4]wayland-egl-priv: Changed the name of 'private' to be same as uptream. Change-Id: Ie9b44ab73354547e9867cb8d02cae855171fafaf Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl.c | 6 +++--- src/tpl_wayland_egl_thread.c | 10 +++++----- src/wayland-egl/wayland-egl-priv.h | 4 +++- src/wayland-egl/wayland-egl-tizen.c | 8 ++++---- src/wayland-egl/wayland-egl.c | 14 +++++++------- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index 80a2812..19b06b3 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -366,7 +366,7 @@ __tpl_wayland_egl_display_get_window_info(tpl_display_t *display, /* Wayland-egl window doesn't have native format information. It is fixed from 'EGLconfig' when called eglCreateWindowSurface(). So we use the tpl_surface format instead. */ - tpl_surface_t *surface = wl_egl_window->private; + tpl_surface_t *surface = wl_egl_window->driver_private; if (surface) *format = surface->format; else { if (a_size == 8) *format = TBM_FORMAT_ARGB8888; @@ -613,7 +613,7 @@ __tpl_wayland_egl_surface_init(tpl_surface_t *surface) surface->rotation = wl_egl_window->rotation; surface->rotation_capability = TPL_FALSE; - wl_egl_window->private = surface; + wl_egl_window->driver_private = surface; wl_egl_window->resize_callback = (void *)__cb_client_window_resize_callback; wl_egl_window->rotate_callback = (void *)__cb_client_window_rotate_callback; wl_egl_window->get_rotation_capability = (void *) @@ -693,7 +693,7 @@ __tpl_wayland_egl_surface_fini(tpl_surface_t *surface) TPL_ASSERT(wl_egl_window); /* TPL_ASSERT(wl_egl_window->surface); */ /* to be enabled once evas/gl patch is in place */ - wl_egl_window->private = NULL; + wl_egl_window->driver_private = NULL; wl_egl_window->resize_callback = NULL; wl_egl_window->rotate_callback = NULL; wl_egl_window->get_rotation_capability = NULL; diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 767dba7..ccac3f6 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1089,7 +1089,7 @@ __cb_destroy_callback(void *private) TPL_LOG_T(BACKEND, "[DESTROY_CB] wl_egl_window(%p) surf_source(%p)", surf_source->wl_egl_window, surf_source); g_mutex_lock(&surf_source->surf_mutex); - surf_source->wl_egl_window->private = NULL; + surf_source->wl_egl_window->driver_private = NULL; surf_source->wl_egl_window = NULL; surf_source->surf = NULL; surf_source->is_destroying = TPL_TRUE; @@ -2336,7 +2336,7 @@ _twe_thread_wl_surf_source_destroy(void *source) surf_source->wl_egl_window->resize_callback = NULL; surf_source->wl_egl_window->rotate_callback = NULL; surf_source->wl_egl_window->get_rotation_capability = NULL; - surf_source->wl_egl_window->private = NULL; + surf_source->wl_egl_window->driver_private = NULL; surf_source->wl_egl_window = NULL; surf_source->surf = NULL; } @@ -2447,7 +2447,7 @@ twe_surface_add(twe_thread* thread, struct wl_egl_window *wl_egl_window = (struct wl_egl_window *)native_handle; - wl_egl_window->private = (void *)source; + wl_egl_window->driver_private = (void *)source; wl_egl_window->destroy_window_callback = (void *)__cb_destroy_callback; wl_egl_window->resize_callback = (void *)__cb_resize_callback; wl_egl_window->rotate_callback = (void *)__cb_rotate_callback; @@ -3270,8 +3270,8 @@ twe_get_native_window_info(tpl_handle_t window, int *width, int *height, if (width) *width = wl_egl_window->width; if (height) *height = wl_egl_window->height; if (format) { - if (wl_egl_window->private) { - twe_wl_surf_source *surf_source = (twe_wl_surf_source *)wl_egl_window->private; + if (wl_egl_window->driver_private) { + twe_wl_surf_source *surf_source = (twe_wl_surf_source *)wl_egl_window->driver_private; *format = surf_source->format; } else { if (a_size == 8) diff --git a/src/wayland-egl/wayland-egl-priv.h b/src/wayland-egl/wayland-egl-priv.h index b37d9e2..40cbd5b 100644 --- a/src/wayland-egl/wayland-egl-priv.h +++ b/src/wayland-egl/wayland-egl-priv.h @@ -29,13 +29,15 @@ struct wl_egl_window { int attached_width; int attached_height; + void *driver_private; + + /* Tizen specific datas */ wl_egl_window_rotation rotation; int frontbuffer_mode; int transform; int window_transform; unsigned int serial; - void *private; void (*destroy_window_callback)(void *); void (*resize_callback)(struct wl_egl_window *, void *); void (*rotate_callback)(struct wl_egl_window *, void *); diff --git a/src/wayland-egl/wayland-egl-tizen.c b/src/wayland-egl/wayland-egl-tizen.c index b44004a..238d450 100644 --- a/src/wayland-egl/wayland-egl-tizen.c +++ b/src/wayland-egl/wayland-egl-tizen.c @@ -66,7 +66,7 @@ wl_egl_window_tizen_set_rotation(struct wl_egl_window *egl_window, egl_window->rotation = rotation; if (egl_window->rotate_callback) - egl_window->rotate_callback(egl_window, egl_window->private); + egl_window->rotate_callback(egl_window, egl_window->driver_private); } int @@ -79,7 +79,7 @@ wl_egl_window_tizen_get_capabilities(struct wl_egl_window *egl_window) } if (egl_window->get_rotation_capability) - capabilities = egl_window->get_rotation_capability(egl_window, egl_window->private); + capabilities = egl_window->get_rotation_capability(egl_window, egl_window->driver_private); else capabilities = WL_EGL_WINDOW_CAPABILITY_ROTATION_UNKNOWN; @@ -117,7 +117,7 @@ wl_egl_window_tizen_set_frontbuffer_mode(struct wl_egl_window *egl_window, egl_window->frontbuffer_mode = set; if (egl_window->set_frontbuffer_callback) - egl_window->set_frontbuffer_callback(egl_window, egl_window->private, + egl_window->set_frontbuffer_callback(egl_window, egl_window->driver_private, set); } @@ -161,6 +161,6 @@ wl_egl_window_tizen_set_window_serial(struct wl_egl_window *egl_window, } if (egl_window->set_window_serial_callback) - egl_window->set_window_serial_callback(egl_window, egl_window->private, + egl_window->set_window_serial_callback(egl_window, egl_window->driver_private, serial); } \ No newline at end of file diff --git a/src/wayland-egl/wayland-egl.c b/src/wayland-egl/wayland-egl.c index 05b726a..6a8e9ec 100644 --- a/src/wayland-egl/wayland-egl.c +++ b/src/wayland-egl/wayland-egl.c @@ -67,7 +67,7 @@ wl_egl_window_resize(struct wl_egl_window *egl_window, egl_window->height = height; if (egl_window->resize_callback) - egl_window->resize_callback(egl_window, egl_window->private); + egl_window->resize_callback(egl_window, egl_window->driver_private); WL_EGL_LOG(2, "egl_win:%10p WxH:%dx%d dx:%d dy:%d rsz_cb:%10p", egl_window, width, height, egl_window->dx, egl_window->dy, @@ -110,14 +110,14 @@ wl_egl_window_create(struct wl_surface *surface, egl_window->window_transform = 0; egl_window->serial = 0; - egl_window->private = NULL; + egl_window->driver_private = NULL; egl_window->rotate_callback = NULL; egl_window->get_rotation_capability = NULL; egl_window->destroy_window_callback = NULL; WL_EGL_LOG(2, "surf:%10p WxH:%dx%d egl_win:%10p priv:%10p", - surface, width, height, egl_window, egl_window->private); + surface, width, height, egl_window, egl_window->driver_private); return egl_window; } @@ -131,7 +131,7 @@ wl_egl_window_destroy(struct wl_egl_window *egl_window) } if (egl_window->destroy_window_callback) - egl_window->destroy_window_callback(egl_window->private); + egl_window->destroy_window_callback(egl_window->driver_private); WL_EGL_LOG(2, "egl_win:%10p", egl_window); @@ -170,7 +170,7 @@ wl_egl_window_set_rotation(struct wl_egl_window *egl_window, egl_window->rotation = rotation; if (egl_window->rotate_callback) - egl_window->rotate_callback(egl_window, egl_window->private); + egl_window->rotate_callback(egl_window, egl_window->driver_private); } WL_EGL_EXPORT void @@ -202,7 +202,7 @@ wl_egl_window_get_capabilities(struct wl_egl_window *egl_window) } if (egl_window->get_rotation_capability) - capabilities = egl_window->get_rotation_capability(egl_window, egl_window->private); + capabilities = egl_window->get_rotation_capability(egl_window, egl_window->driver_private); else capabilities = WL_EGL_WINDOW_CAPABILITY_ROTATION_UNKNOWN; @@ -221,7 +221,7 @@ wl_egl_window_set_frontbuffer_mode(struct wl_egl_window *egl_window, egl_window->frontbuffer_mode = set; if (egl_window->set_frontbuffer_callback) - egl_window->set_frontbuffer_callback(egl_window, egl_window->private, + egl_window->set_frontbuffer_callback(egl_window, egl_window->driver_private, set); } -- 2.7.4 From 59be89060e620150f7ec64ca6369e9175cba0af5 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Mon, 1 Jul 2019 13:32:03 +0900 Subject: [PATCH 16/16] [2/4]wayland-egl-tizen-priv: Added new header to support tizen specific feature. Change-Id: Icb1e4afa47597cb2bc7c6e9467e5a6ec0e547dfb Signed-off-by: Joonbum Ko --- src/wayland-egl/wayland-egl-tizen-priv.h | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/wayland-egl/wayland-egl-tizen-priv.h diff --git a/src/wayland-egl/wayland-egl-tizen-priv.h b/src/wayland-egl/wayland-egl-tizen-priv.h new file mode 100644 index 0000000..5b65a70 --- /dev/null +++ b/src/wayland-egl/wayland-egl-tizen-priv.h @@ -0,0 +1,52 @@ +#ifndef _WAYLAND_EGL_TIZEN_PRIV_H +#define _WAYLAND_EGL_TIZEN_PRIV_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +struct tizen_private { + int rotation; + int frontbuffer_mode; + int transform; + int window_transform; + unsigned int serial; + + void *data; + + void (*rotate_callback)(struct wl_egl_window *, void *); + int (*get_rotation_capability)(struct wl_egl_window *, void *); + void (*set_frontbuffer_callback)(struct wl_egl_window *, void *, int); + void (*set_window_serial_callback)(struct wl_egl_window *, void *, unsigned int); +}; + +static struct tizen_private* tizen_private_create() +{ + struct tizen_private *private = NULL; + private = (struct tizen_private *)calloc(1, sizeof(struct tizen_private)); + if (private) { + private->rotation = 0; + private->frontbuffer_mode = 0; + private->transform = 0; + private->window_transform = 0; + private->serial = 0; + + private->data = NULL; + private->rotate_callback = NULL; + private->get_rotation_capability = NULL; + private->set_window_serial_callback = NULL; + private->set_frontbuffer_callback = NULL; + } + + return private; +} + +#ifdef __cplusplus +} +#endif + +#endif -- 2.7.4