From 7d3df28ba5c336a6965c87f17db1568cd2a61cd6 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Tue, 26 Sep 2017 18:53:23 +0900 Subject: [PATCH] tpl_wayland_egl_thread: Added internal APIs to get surface capabilities. Change-Id: Ibefc57b2cffe0be2de82d88ba9bce0a42ae1b9bb Signed-off-by: joonbum.ko --- src/tpl_wayland_egl_thread.c | 38 ++++++++++++++++++++++++++++++++++++++ src/tpl_wayland_egl_thread.h | 9 +++++++++ 2 files changed, 47 insertions(+) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index f38c427..688781c 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1015,6 +1015,44 @@ twe_display_unlock(twe_display_h display) TPL_OBJECT_UNLOCK(&disp_source->obj); } +tpl_result_t +twe_display_get_buffer_count(twe_display_h display, + int *min, int *max) +{ + twe_wl_disp_source *disp_source = (twe_wl_disp_source *)display; + if (!disp_source || g_source_is_destroyed(&disp_source->gsource)) { + TPL_ERR("Invalid parameter. display(%p)", display); + return TPL_ERROR_INVALID_PARAMETER; + } + + if (min) *min = disp_source->surface_capabilities.min_buffer; + if (max) *max = disp_source->surface_capabilities.max_buffer; + + return TPL_ERROR_NONE; +} + +tpl_result_t +twe_display_get_present_mode(twe_display_h display, + int *present_modes) +{ + twe_wl_disp_source *disp_source = (twe_wl_disp_source *)display; + if (!disp_source || g_source_is_destroyed(&disp_source->gsource)) { + TPL_ERR("Invalid parameter. display(%p)", display); + return TPL_ERROR_INVALID_PARAMETER; + } + + if (present_modes) { + *present_modes = TPL_DISPLAY_PRESENT_MODE_MAILBOX | + TPL_DISPLAY_PRESENT_MODE_IMMEDIATE | + TPL_DISPLAY_PRESENT_MODE_FIFO | + TPL_DISPLAY_PRESENT_MODE_FIFO_RELAXED | + disp_source->surface_capabilities.present_modes; + } + + return TPL_ERROR_NONE; +} + + static void __cb_destroy_callback(void *private) { diff --git a/src/tpl_wayland_egl_thread.h b/src/tpl_wayland_egl_thread.h index 0348b1c..e7b311c 100644 --- a/src/tpl_wayland_egl_thread.h +++ b/src/tpl_wayland_egl_thread.h @@ -30,6 +30,15 @@ twe_display_lock(twe_display_h display); void twe_display_unlock(twe_display_h display); +tpl_result_t +twe_display_get_buffer_count(twe_display_h display, + int *min, + int *max); + +tpl_result_t +twe_display_get_present_mode(twe_display_h display, + int *present_modes); + twe_surface_h twe_surface_add(twe_thread* thread, twe_display_h twe_display, -- 2.7.4