typedef struct _tpl_wl_egl_buffer tpl_wl_egl_buffer_t;
typedef struct _surface_vblank tpl_surface_vblank_t;
+#define wl_egl_display(ptr) *wl_egl_display = (tpl_wl_egl_display_t *)ptr;
+#define wl_egl_surface(ptr) *wl_egl_surface = (tpl_wl_egl_surface_t *)ptr;
+#define wl_egl_buffer(ptr) *wl_egl_buffer = (tpl_wl_egl_buffer_t *)ptr;
+#define tizen_private(ptr) *tizen_private = (struct tizen_private *)ptr;
+
struct _tpl_wl_egl_display {
tpl_gsource *disp_source;
tpl_gthread *thread;
static struct tizen_private *
tizen_private_create()
{
- struct tizen_private *private = NULL;
- private = (struct tizen_private *)calloc(1, sizeof(struct tizen_private));
+ struct tizen_private *private = calloc(1, sizeof(struct tizen_private));
if (private) {
private->magic = WL_EGL_TIZEN_MAGIC;
private->rotation = 0;
static tpl_bool_t
__thread_func_tdm_dispatch(tpl_gsource *gsource, uint64_t message)
{
- tpl_wl_egl_display_t *wl_egl_display = NULL;
+ tpl_wl_egl_display_t wl_egl_display(tpl_gsource_get_data(gsource));
tdm_error tdm_err = TDM_ERROR_NONE;
TPL_IGNORE(message);
- wl_egl_display = (tpl_wl_egl_display_t *)tpl_gsource_get_data(gsource);
if (!wl_egl_display) {
TPL_ERR("Failed to get wl_egl_display from gsource(%p)", gsource);
TPL_WARN("tdm_source(%p) will be removed from thread.", gsource);
static void
__thread_func_tdm_finalize(tpl_gsource *gsource)
{
- tpl_wl_egl_display_t *wl_egl_display = NULL;
-
- wl_egl_display = (tpl_wl_egl_display_t *)tpl_gsource_get_data(gsource);
+ tpl_wl_egl_display_t wl_egl_display(tpl_gsource_get_data(gsource));
tpl_gmutex_lock(&wl_egl_display->tdm.tdm_mutex);
uint32_t version)
{
#if TIZEN_FEATURE_ENABLE
- tpl_wl_egl_display_t *wl_egl_display = (tpl_wl_egl_display_t *)data;
+ tpl_wl_egl_display_t wl_egl_display(data);
if (!strcmp(interface, "tizen_surface_shm")) {
wl_egl_display->tss =
static void*
_thread_init(void *data)
{
- tpl_wl_egl_display_t *wl_egl_display = (tpl_wl_egl_display_t *)data;
+ tpl_wl_egl_display_t wl_egl_display(data);
if (_thread_wl_display_init(wl_egl_display) != TPL_ERROR_NONE) {
TPL_ERR("Failed to initialize wl_egl_display(%p) with wl_display(%p)",
static tpl_bool_t
__thread_func_disp_prepare(tpl_gsource *gsource)
{
- tpl_wl_egl_display_t *wl_egl_display =
- (tpl_wl_egl_display_t *)tpl_gsource_get_data(gsource);
+ tpl_wl_egl_display_t wl_egl_display(tpl_gsource_get_data(gsource));
/* If this wl_egl_display is already prepared,
* do nothing in this function. */
static tpl_bool_t
__thread_func_disp_check(tpl_gsource *gsource)
{
- tpl_wl_egl_display_t *wl_egl_display =
- (tpl_wl_egl_display_t *)tpl_gsource_get_data(gsource);
+ tpl_wl_egl_display_t wl_egl_display(tpl_gsource_get_data(gsource));
tpl_bool_t ret = TPL_FALSE;
if (!wl_egl_display->prepared)
static tpl_bool_t
__thread_func_disp_dispatch(tpl_gsource *gsource, uint64_t message)
{
- tpl_wl_egl_display_t *wl_egl_display =
- (tpl_wl_egl_display_t *)tpl_gsource_get_data(gsource);
+ tpl_wl_egl_display_t wl_egl_display(tpl_gsource_get_data(gsource));
TPL_IGNORE(message);
static void
__thread_func_disp_finalize(tpl_gsource *gsource)
{
- tpl_wl_egl_display_t *wl_egl_display =
- (tpl_wl_egl_display_t *)tpl_gsource_get_data(gsource);
+ tpl_wl_egl_display_t wl_egl_display(tpl_gsource_get_data(gsource));
tpl_gmutex_lock(&wl_egl_display->disp_mutex);
TPL_LOG_D("[D_FINALIZE]", "wl_egl_display(%p) tpl_gsource(%p)",
return TPL_ERROR_INVALID_PARAMETER;
}
- wl_egl_display = (tpl_wl_egl_display_t *) calloc(1,
- sizeof(tpl_wl_egl_display_t));
+ wl_egl_display = calloc(1, sizeof(tpl_wl_egl_display_t));
if (!wl_egl_display) {
TPL_ERR("Failed to allocate memory for new tpl_wl_egl_display_t.");
return TPL_ERROR_OUT_OF_MEMORY;
static void
__tpl_wl_egl_display_fini(tpl_display_t *display)
{
- tpl_wl_egl_display_t *wl_egl_display;
-
- TPL_ASSERT(display);
-
- wl_egl_display = (tpl_wl_egl_display_t *)display->backend.data;
+ tpl_wl_egl_display_t wl_egl_display(display->backend.data);
if (wl_egl_display) {
TPL_INFO("[DISPLAY_FINI]",
"wl_egl_display(%p) tpl_gthread(%p) wl_display(%p)",
tpl_result_t ret = TPL_ERROR_NONE;
struct wl_egl_window *wl_egl_window = (struct wl_egl_window *)window;
- TPL_ASSERT(display);
- TPL_ASSERT(window);
-
if (!wl_egl_window) {
TPL_ERR("Invalid parameter. tpl_handle_t(%p)", window);
return TPL_ERROR_INVALID_PARAMETER;
if (width) *width = wl_egl_window->width;
if (height) *height = wl_egl_window->height;
if (format) {
- struct tizen_private *tizen_private =
- (struct tizen_private *)wl_egl_window->driver_private;
+ struct tizen_private tizen_private(wl_egl_window->driver_private);
if (tizen_private && tizen_private->data) {
- tpl_wl_egl_surface_t *wl_egl_surface =
- (tpl_wl_egl_surface_t *)tizen_private->data;
+ tpl_wl_egl_surface_t wl_egl_surface(tizen_private->data);
*format = wl_egl_surface->format;
} else {
if (a_size == 8)
static void
__cb_destroy_callback(void *private)
{
- struct tizen_private *tizen_private = (struct tizen_private *)private;
- tpl_wl_egl_surface_t *wl_egl_surface = NULL;
+ struct tizen_private tizen_private(private);
if (!tizen_private) {
TPL_LOG_D("[WL_EGL_WINDOW_DESTROY_CALLBACK]", "Already destroyed surface");
return;
}
- wl_egl_surface = (tpl_wl_egl_surface_t *)tizen_private->data;
+ tpl_wl_egl_surface_t wl_egl_surface(tizen_private->data);
if (wl_egl_surface) {
TPL_WARN("[DESTROY_CB][!!!ABNORMAL BEHAVIOR!!!] wl_egl_window(%p) is destroyed.",
wl_egl_surface->wl_egl_window);
__cb_resize_callback(struct wl_egl_window *wl_egl_window, void *private)
{
TPL_ASSERT(private);
- TPL_ASSERT(wl_egl_window);
- struct tizen_private *tizen_private = (struct tizen_private *)private;
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)tizen_private->data;
+ struct tizen_private tizen_private(private);
+ tpl_wl_egl_surface_t wl_egl_surface(tizen_private->data);
int cur_w, cur_h, req_w, req_h, format;
if (!wl_egl_surface) {
__cb_rotate_callback(struct wl_egl_window *wl_egl_window, void *private)
{
TPL_ASSERT(private);
- TPL_ASSERT(wl_egl_window);
- struct tizen_private *tizen_private = (struct tizen_private *)private;
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)tizen_private->data;
+ struct tizen_private tizen_private(private);
+ tpl_wl_egl_surface_t wl_egl_surface(tizen_private->data);
int rotation = tizen_private->rotation;
if (!wl_egl_surface) {
void *private)
{
TPL_ASSERT(private);
- TPL_ASSERT(wl_egl_window);
int rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_NONE;
- struct tizen_private *tizen_private = (struct tizen_private *)private;
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)tizen_private->data;
+ struct tizen_private tizen_private(private);
+ tpl_wl_egl_surface_t wl_egl_surface(tizen_private->data);
if (!wl_egl_surface) {
TPL_ERR("Invalid wl_egl_window(%p) tizen_private->data is null.",
void *private, unsigned int serial)
{
TPL_ASSERT(private);
- TPL_ASSERT(wl_egl_window);
- struct tizen_private *tizen_private = (struct tizen_private *)private;
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)tizen_private->data;
+ struct tizen_private tizen_private(private);
+ tpl_wl_egl_surface_t wl_egl_surface(tizen_private->data);
if (!wl_egl_surface) {
TPL_ERR("Invalid wl_egl_window(%p) tizen_private->data is null.",
int commit_sync_fd = -1;
- struct tizen_private *tizen_private = (struct tizen_private *)private;
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)tizen_private->data;
+ struct tizen_private tizen_private(private);
+ tpl_wl_egl_surface_t wl_egl_surface(tizen_private->data);
if (!wl_egl_surface) {
TPL_ERR("Invalid parameter. wl_egl_surface(%p) is NULL", wl_egl_surface);
{
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
- struct tizen_private *tizen_private = (struct tizen_private *)private;
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)tizen_private->data;
+ struct tizen_private tizen_private(private);
+ tpl_wl_egl_surface_t wl_egl_surface(tizen_private->data);
TPL_CHECK_ON_NULL_RETURN(wl_egl_surface);
tpl_surface_t *surface = wl_egl_surface->tpl_surface;
int presentation_sync_fd = -1;
- struct tizen_private *tizen_private = (struct tizen_private *)private;
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)tizen_private->data;
+ struct tizen_private tizen_private(private);
+ tpl_wl_egl_surface_t wl_egl_surface(tizen_private->data);
if (!wl_egl_surface) {
TPL_ERR("Invalid parameter. wl_egl_surface is NULL");
static void __cb_tss_flusher_flush_callback(void *data,
struct tizen_surface_shm_flusher *tss_flusher)
{
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)data;
+ tpl_wl_egl_surface_t wl_egl_surface(data);
tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_NONE;
TPL_INFO("[BUFFER_FLUSH]", "wl_egl_surface(%p) tbm_queue(%p)",
static void __cb_tss_flusher_free_flush_callback(void *data,
struct tizen_surface_shm_flusher *tss_flusher)
{
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)data;
+ tpl_wl_egl_surface_t wl_egl_surface(data);
tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_NONE;
TPL_INFO("[FREE_BUFFER_FLUSH]", "wl_egl_surface(%p) tbm_queue(%p)",
__cb_tbm_queue_reset_callback(tbm_surface_queue_h tbm_queue,
void *data)
{
- tpl_wl_egl_surface_t *wl_egl_surface = NULL;
tpl_wl_egl_display_t *wl_egl_display = NULL;
tpl_surface_t *surface = NULL;
tpl_bool_t is_activated = TPL_FALSE;
int width, height;
- wl_egl_surface = (tpl_wl_egl_surface_t *)data;
+ tpl_wl_egl_surface_t wl_egl_surface(data);
TPL_CHECK_ON_NULL_RETURN(wl_egl_surface);
wl_egl_display = wl_egl_surface->wl_egl_display;
{
TPL_IGNORE(tbm_queue);
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)data;
+ tpl_wl_egl_surface_t wl_egl_surface(data);
TPL_CHECK_ON_NULL_RETURN(wl_egl_surface);
tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
static tpl_bool_t
__thread_func_surf_dispatch(tpl_gsource *gsource, uint64_t message)
{
- tpl_wl_egl_surface_t *wl_egl_surface = NULL;
-
- wl_egl_surface = (tpl_wl_egl_surface_t *)tpl_gsource_get_data(gsource);
+ tpl_wl_egl_surface_t wl_egl_surface(tpl_gsource_get_data(gsource));
tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
if (message == INIT_SURFACE) { /* Initialize surface */
static void
__thread_func_surf_finalize(tpl_gsource *gsource)
{
- tpl_wl_egl_surface_t *wl_egl_surface = NULL;
-
- wl_egl_surface = (tpl_wl_egl_surface_t *)tpl_gsource_get_data(gsource);
+ tpl_wl_egl_surface_t wl_egl_surface(tpl_gsource_get_data(gsource));
TPL_CHECK_ON_NULL_RETURN(wl_egl_surface);
tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
static tpl_result_t
__tpl_wl_egl_surface_init(tpl_surface_t *surface)
{
- tpl_wl_egl_display_t *wl_egl_display = NULL;
+ tpl_wl_egl_display_t wl_egl_display(surface->display->backend.data);
tpl_wl_egl_surface_t *wl_egl_surface = NULL;
tpl_gsource *surf_source = NULL;
struct wl_egl_window *wl_egl_window =
(struct wl_egl_window *)surface->native_handle;
- TPL_ASSERT(surface);
- TPL_ASSERT(surface->display);
TPL_ASSERT(surface->type == TPL_SURFACE_TYPE_WINDOW);
TPL_ASSERT(surface->native_handle);
+ TPL_CHECK_ON_NULL_RETURN_VAL(wl_egl_display, TPL_ERROR_INVALID_PARAMETER);
- wl_egl_display =
- (tpl_wl_egl_display_t *)surface->display->backend.data;
- if (!wl_egl_display) {
- TPL_ERR("Invalid parameter. wl_egl_display(%p)",
- wl_egl_display);
- return TPL_ERROR_INVALID_PARAMETER;
- }
-
- wl_egl_surface = (tpl_wl_egl_surface_t *) calloc(1,
- sizeof(tpl_wl_egl_surface_t));
+ wl_egl_surface = calloc(1, sizeof(tpl_wl_egl_surface_t));
if (!wl_egl_surface) {
TPL_ERR("Failed to allocate memory for new tpl_wl_egl_surface_t.");
return TPL_ERROR_OUT_OF_MEMORY;
{
tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_NONE;
tpl_wl_egl_display_t *wl_egl_display = wl_egl_surface->wl_egl_display;
- tpl_wl_egl_buffer_t *wl_egl_buffer = NULL;
tpl_bool_t need_to_release = TPL_FALSE;
tpl_bool_t need_to_cancel = TPL_FALSE;
buffer_status_t status = RELEASED;
buffer_cnt = __tpl_list_get_count(wl_egl_surface->buffers);
while (!__tpl_list_is_empty(wl_egl_surface->buffers)) {
- wl_egl_buffer = (tpl_wl_egl_buffer_t *)__tpl_list_pop_front(wl_egl_surface->buffers,
- NULL);
+ tpl_wl_egl_buffer_t wl_egl_buffer(__tpl_list_pop_front(wl_egl_surface->buffers,
+ NULL));
tpl_gmutex_lock(&wl_egl_buffer->mutex);
static void
__tpl_wl_egl_surface_fini(tpl_surface_t *surface)
{
- tpl_wl_egl_surface_t *wl_egl_surface = NULL;
tpl_wl_egl_display_t *wl_egl_display = NULL;
TPL_ASSERT(surface);
TPL_CHECK_ON_FALSE_RETURN(surface->type == TPL_SURFACE_TYPE_WINDOW);
- wl_egl_surface = (tpl_wl_egl_surface_t *) surface->backend.data;
+ tpl_wl_egl_surface_t wl_egl_surface(surface->backend.data);
TPL_CHECK_ON_NULL_RETURN(wl_egl_surface);
wl_egl_display = wl_egl_surface->wl_egl_display;
}
if (wl_egl_surface->wl_egl_window) {
- struct tizen_private *tizen_private = NULL;
struct wl_egl_window *wl_egl_window = wl_egl_surface->wl_egl_window;
+ struct tizen_private tizen_private(wl_egl_window->driver_private);
TPL_INFO("[WL_EGL_WINDOW_FINI]",
"wl_egl_surface(%p) wl_egl_window(%p) wl_surface(%p)",
wl_egl_surface, wl_egl_window,
wl_egl_surface->wl_surface);
- tizen_private = (struct tizen_private *)wl_egl_window->driver_private;
+
if (tizen_private) {
tizen_private->set_window_serial_callback = NULL;
tizen_private->rotate_callback = NULL;
__tpl_wl_egl_surface_set_rotation_capability(tpl_surface_t *surface,
tpl_bool_t set)
{
- tpl_wl_egl_surface_t *wl_egl_surface = NULL;
-
TPL_CHECK_ON_NULL_RETURN_VAL(surface, TPL_ERROR_INVALID_PARAMETER);
- wl_egl_surface = (tpl_wl_egl_surface_t *)surface->backend.data;
+ tpl_wl_egl_surface_t wl_egl_surface(surface->backend.data);
TPL_CHECK_ON_NULL_RETURN_VAL(wl_egl_surface, TPL_ERROR_INVALID_PARAMETER);
__tpl_wl_egl_surface_set_post_interval(tpl_surface_t *surface,
int post_interval)
{
- tpl_wl_egl_surface_t *wl_egl_surface = NULL;
-
TPL_CHECK_ON_NULL_RETURN_VAL(surface, TPL_ERROR_INVALID_PARAMETER);
- wl_egl_surface = (tpl_wl_egl_surface_t *)surface->backend.data;
+ tpl_wl_egl_surface_t wl_egl_surface(surface->backend.data);
TPL_CHECK_ON_NULL_RETURN_VAL(wl_egl_surface, TPL_ERROR_INVALID_PARAMETER);
TPL_ASSERT(surface);
TPL_ASSERT(surface->backend.data);
- tpl_wl_egl_surface_t *wl_egl_surface =
- (tpl_wl_egl_surface_t *)surface->backend.data;
+ tpl_wl_egl_surface_t wl_egl_surface(surface->backend.data);
retval = !(wl_egl_surface->reset);
static void
__tpl_wl_egl_surface_get_size(tpl_surface_t *surface, int *width, int *height)
{
- tpl_wl_egl_surface_t *wl_egl_surface =
- (tpl_wl_egl_surface_t *)surface->backend.data;
+ tpl_wl_egl_surface_t wl_egl_surface(surface->backend.data);
if (width)
*width = tbm_surface_queue_get_width(wl_egl_surface->tbm_queue);
static tpl_bool_t
__tpl_wl_egl_surface_fence_sync_is_available(tpl_surface_t *surface)
{
- tpl_wl_egl_surface_t *wl_egl_surface =
- (tpl_wl_egl_surface_t *)surface->backend.data;
+ tpl_wl_egl_surface_t wl_egl_surface(surface->backend.data);
return !wl_egl_surface->frontbuffer_activated;
}
while (!__tpl_list_is_empty(wl_egl_surface->buffers)) {
tpl_bool_t need_to_release = TPL_FALSE;
- tpl_wl_egl_buffer_t *wl_egl_buffer =
- (tpl_wl_egl_buffer_t *)__tpl_list_pop_front(wl_egl_surface->buffers,
- NULL);
+ tpl_wl_egl_buffer_t wl_egl_buffer(
+ __tpl_list_pop_front(wl_egl_surface->buffers, NULL));
need_to_release = (wl_egl_buffer->status >= ACQUIRED) &&
(wl_egl_buffer->status <= COMMITTED);
tpl_wl_egl_surface_t *wl_egl_surface)
{
struct wl_egl_window *wl_egl_window = wl_egl_surface->wl_egl_window;
- struct tizen_private *tizen_private =
- (struct tizen_private *)wl_egl_window->driver_private;
+ struct tizen_private tizen_private(wl_egl_window->driver_private);
TPL_ASSERT(tizen_private);
wl_egl_buffer = _get_wl_egl_buffer(tbm_surface);
if (!wl_egl_buffer) {
- wl_egl_buffer = (tpl_wl_egl_buffer_t *)calloc(1, sizeof(tpl_wl_egl_buffer_t));
+ wl_egl_buffer = calloc(1, sizeof(tpl_wl_egl_buffer_t));
TPL_CHECK_ON_NULL_RETURN_VAL(wl_egl_buffer, NULL);
tbm_surface_internal_add_user_data(tbm_surface, KEY_WL_EGL_BUFFER,
__tpl_wl_egl_surface_dequeue_buffer(tpl_surface_t *surface, uint64_t timeout_ns,
int32_t *release_fence)
{
- TPL_ASSERT(surface);
TPL_ASSERT(surface->backend.data);
TPL_ASSERT(surface->display);
TPL_ASSERT(surface->display->backend.data);
- TPL_OBJECT_CHECK_RETURN(surface, NULL);
- tpl_wl_egl_surface_t *wl_egl_surface =
- (tpl_wl_egl_surface_t *)surface->backend.data;
- tpl_wl_egl_display_t *wl_egl_display =
- (tpl_wl_egl_display_t *)surface->display->backend.data;
+ tpl_wl_egl_surface_t wl_egl_surface(surface->backend.data);
+ tpl_wl_egl_display_t wl_egl_display(surface->display->backend.data);
tpl_wl_egl_buffer_t *wl_egl_buffer = NULL;
tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_NONE;
TPL_ASSERT(surface);
TPL_ASSERT(surface->backend.data);
- tpl_wl_egl_surface_t *wl_egl_surface =
- (tpl_wl_egl_surface_t *)surface->backend.data;
+ tpl_wl_egl_surface_t wl_egl_surface(surface->backend.data);
tpl_wl_egl_buffer_t *wl_egl_buffer = NULL;
tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_NONE;
TPL_ASSERT(tbm_surface);
TPL_OBJECT_CHECK_RETURN(surface, TPL_ERROR_INVALID_PARAMETER);
- tpl_wl_egl_surface_t *wl_egl_surface =
- (tpl_wl_egl_surface_t *) surface->backend.data;
+ tpl_wl_egl_surface_t wl_egl_surface(surface->backend.data);
tpl_wl_egl_buffer_t *wl_egl_buffer = NULL;
tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_NONE;
int bo_name = -1;
static tpl_bool_t
__thread_func_waiting_source_dispatch(tpl_gsource *gsource, uint64_t message)
{
- tpl_wl_egl_buffer_t *wl_egl_buffer =
- (tpl_wl_egl_buffer_t *)tpl_gsource_get_data(gsource);
+ tpl_wl_egl_buffer_t wl_egl_buffer(tpl_gsource_get_data(gsource));
TPL_CHECK_ON_NULL_RETURN_VAL(wl_egl_buffer, TPL_FALSE);
tpl_wl_egl_surface_t *wl_egl_surface = wl_egl_buffer->wl_egl_surface;
unsigned int sequence, unsigned int tv_sec,
unsigned int tv_usec, void *user_data)
{
- tpl_wl_egl_surface_t *wl_egl_surface = (tpl_wl_egl_surface_t *)user_data;
- tpl_wl_egl_buffer_t *wl_egl_buffer = NULL;
+ tpl_wl_egl_surface_t wl_egl_surface(user_data);
TRACE_ASYNC_END((intptr_t)wl_egl_surface, "WAIT_VBLANK");
TPL_LOG_D("[VBLANK_DONE]", "wl_egl_surface(%p)", wl_egl_surface);
tpl_bool_t is_empty = TPL_TRUE;
do {
tpl_gmutex_lock(&wl_egl_surface->vblank->mutex);
- wl_egl_buffer = (tpl_wl_egl_buffer_t *)__tpl_list_pop_front(
- wl_egl_surface->vblank->waiting_buffers,
- NULL);
+ tpl_wl_egl_buffer_t wl_egl_buffer(
+ __tpl_list_pop_front( wl_egl_surface->vblank->waiting_buffers, NULL));
is_empty = __tpl_list_is_empty(wl_egl_surface->vblank->waiting_buffers);
tpl_gmutex_unlock(&wl_egl_surface->vblank->mutex);
__cb_buffer_fenced_release(void *data,
struct zwp_linux_buffer_release_v1 *release, int32_t fence)
{
- tpl_wl_egl_buffer_t *wl_egl_buffer = (tpl_wl_egl_buffer_t *)data;
+ tpl_wl_egl_buffer_t wl_egl_buffer(data);
tbm_surface_h tbm_surface = NULL;
TPL_CHECK_ON_NULL_RETURN(wl_egl_buffer);
__cb_buffer_immediate_release(void *data,
struct zwp_linux_buffer_release_v1 *release)
{
- tpl_wl_egl_buffer_t *wl_egl_buffer = (tpl_wl_egl_buffer_t *)data;
+ tpl_wl_egl_buffer_t wl_egl_buffer(data);
tbm_surface_h tbm_surface = NULL;
TPL_CHECK_ON_NULL_RETURN(wl_egl_buffer);
static void
__cb_wl_buffer_release(void *data, struct wl_proxy *wl_buffer)
{
- tpl_wl_egl_buffer_t *wl_egl_buffer = (tpl_wl_egl_buffer_t *)data;
+ tpl_wl_egl_buffer_t wl_egl_buffer(data);
tbm_surface_h tbm_surface = NULL;
TPL_CHECK_ON_NULL_RETURN(wl_egl_buffer)
_print_buffer_lists(tpl_wl_egl_surface_t *wl_egl_surface)
{
tpl_list_node_t *node = NULL;
- tpl_wl_egl_buffer_t *wl_egl_buffer = NULL;
int buffer_cnt = 0;
int idx = 0;
node = __tpl_list_get_front_node(wl_egl_surface->buffers);
do {
if (!node) break;
- wl_egl_buffer = (tpl_wl_egl_buffer_t *)__tpl_list_node_get_data(node);
+ tpl_wl_egl_buffer_t wl_egl_buffer(__tpl_list_node_get_data(node));
TPL_INFO("[BUFFERS_INFO]",
"[%d/%d] wl_egl_surface(%p), wl_egl_buffer(%p) tbm_surface(%p) bo(%d) | status(%s)",
++idx, buffer_cnt, wl_egl_surface, wl_egl_buffer,
_check_buffer_validate(tpl_wl_egl_surface_t *wl_egl_surface, tbm_surface_h tbm_surface)
{
tpl_list_node_t *node = NULL;
- tpl_wl_egl_buffer_t *wl_egl_buffer = NULL;
tpl_bool_t ret = TPL_FALSE;
/* silent return */
node = __tpl_list_get_front_node(wl_egl_surface->buffers);
do {
if (!node) break;
- wl_egl_buffer = (tpl_wl_egl_buffer_t *)__tpl_list_node_get_data(node);
+ tpl_wl_egl_buffer_t wl_egl_buffer(__tpl_list_node_get_data(node));
if (wl_egl_buffer->tbm_surface == tbm_surface) {
ret = TPL_TRUE;
break;