From 70377ab6fcdbf48bd1eaa5c18e92d4587c50776e Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 24 Jul 2018 16:11:05 +0900 Subject: platform_tizen: Fixed some build errors for supporting latest upstream code. Change-Id: Ie4c4d957da63d73c82ab41a91ae24ec589ecf4ed Signed-off-by: Joonbum Ko --- docs/egl.html | 2 +- src/egl/drivers/dri2/egl_dri2.c | 5 +++++ src/egl/drivers/dri2/egl_dri2.h | 2 ++ src/egl/drivers/dri2/platform_tizen.c | 21 ++++++++++++++++----- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/docs/egl.html b/docs/egl.html index 2bc8f237272..99058cde1da 100644 --- a/docs/egl.html +++ b/docs/egl.html @@ -87,7 +87,7 @@ the main library to decide the native platform.

The available platforms are x11, drm, wayland, surfaceless, android, -and haiku. +tizen, and haiku. The android platform can either be built as a system component, part of AOSP, using Android.mk files, or cross-compiled using appropriate configure options. diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 45433cd87b1..5cf3092403f 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -121,6 +121,11 @@ dri_is_thread_safe(void *loaderPrivate) return true; #endif +#ifdef HAVE_TIZEN_PLATFORM + if (display->Platform == _EGL_PLATFORM_TIZEN) + return true; +#endif + return true; } diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 4f9f9423a8f..99617a6a9e4 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -323,6 +323,8 @@ struct dri2_egl_surface tbm_surface_h tbm_surface; int age; } color_buffers[3], *back; + + int buffer_count; #endif #if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM) diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c index 4b5b8bd6634..30d12cb4565 100644 --- a/src/egl/drivers/dri2/platform_tizen.c +++ b/src/egl/drivers/dri2/platform_tizen.c @@ -882,10 +882,7 @@ tizen_create_image_from_name(_EGLDisplay *disp, _EGLContext *ctx, return NULL; } - if (!_eglInitImage(&dri2_img->base, disp)) { - free(dri2_img); - return NULL; - } + _eglInitImage(&dri2_img->base, disp); dri2_img->dri_image = dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen, @@ -1250,6 +1247,20 @@ tizen_add_configs(_EGLDriver *drv, _EGLDisplay *dpy) return (count != 0); } +static EGLBoolean tizen_set_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy, + _EGLSurface *surf, EGLint interval) +{ + tpl_result_t res = TPL_ERROR_NONE; + struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf); + + res = tpl_surface_set_post_interval(dri2_surf->tpl_surface, interval); + + if (res != TPL_ERROR_NONE) + return EGL_FALSE; + + return EGL_TRUE; +} + static struct dri2_egl_display_vtbl tizen_display_vtbl = { .authenticate = NULL, .create_window_surface = tizen_create_window_surface, @@ -1257,7 +1268,7 @@ static struct dri2_egl_display_vtbl tizen_display_vtbl = { .create_pbuffer_surface = tizen_create_pbuffer_surface, .destroy_surface = tizen_destroy_surface, .create_image = tizen_create_image_khr, - .swap_interval = dri2_fallback_swap_interval, + .swap_interval = tizen_set_swap_interval, .swap_buffers = tizen_swap_buffers, .swap_buffers_with_damage = tizen_swap_buffers_with_damage, .swap_buffers_region = dri2_fallback_swap_buffers_region, -- cgit v1.2.3