tpl_wayland_egl_thread: Added internal APIs to get surface capabilities. 64/161964/2
authorjoonbum.ko <joonbum.ko@samsung.com>
Tue, 26 Sep 2017 09:53:23 +0000 (18:53 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Tue, 28 Nov 2017 10:29:24 +0000 (19:29 +0900)
Change-Id: Ibefc57b2cffe0be2de82d88ba9bce0a42ae1b9bb
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c
src/tpl_wayland_egl_thread.h

index f38c427..688781c 100644 (file)
@@ -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)
 {
index 0348b1c..e7b311c 100644 (file)
@@ -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,