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);
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!");
{
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)",
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.");
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);
}
}
- 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!");
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;
}