summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonbum Ko <joonbum.ko@samsung.com>2020-07-10 16:03:43 +0900
committerXuelian Bai <xuelian.bai@samsung.com>2021-10-11 10:14:49 +0800
commit8110c9b023792745c4698b2c1ef055eb4728acad (patch)
treedc009082f96251a32f644a9c165382144c66aa1f
parentfc61f5e079c57601fe8b15a1ecfd47f4aafc3b17 (diff)
downloadmesa-8110c9b023792745c4698b2c1ef055eb4728acad.tar.gz
mesa-8110c9b023792745c4698b2c1ef055eb4728acad.tar.bz2
mesa-8110c9b023792745c4698b2c1ef055eb4728acad.zip
Implemented frontbuffer rendering mode.
Change-Id: I9b562a2b70eae9c1334fea0248906f84ba932e9f Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
-rw-r--r--src/egl/drivers/dri2/egl_dri2.h1
-rwxr-xr-xsrc/egl/drivers/dri2/platform_tizen.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index 8ab8eccc655..8dbdf62df0a 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -331,6 +331,7 @@ struct dri2_egl_surface
__DRIimage *dri_image_back;
__DRIimage *dri_image_front;
+ bool is_frontbuffer_mode;
int buffer_count;
bool valid;
#endif
diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c
index 020b7822a06..eeb87ed5fdd 100755
--- a/src/egl/drivers/dri2/platform_tizen.c
+++ b/src/egl/drivers/dri2/platform_tizen.c
@@ -233,6 +233,12 @@ tizen_window_enqueue_buffer_with_damage(_EGLDisplay *disp,
mtx_unlock(&disp->Mutex);
fence_fd = dri2_surf->out_fence_fd;
+
+ if (fence_fd >= 0 && dri2_surf->is_frontbuffer_mode) {
+ close(fence_fd);
+ fence_fd = -1;
+ }
+
dri2_surf->out_fence_fd = -1;
ret = tpl_surface_enqueue_buffer_with_damage_and_sync(dri2_surf->tpl_surface,
@@ -316,6 +322,7 @@ tizen_create_surface(_EGLDisplay *disp, EGLint type,
const __DRIconfig *config;
tpl_surface_type_t tpl_surf_type = TPL_SURFACE_ERROR;
tpl_result_t ret = TPL_ERROR_INVALID_PARAMETER;
+ char *env = getenv("EGL_FRONTBUFFER_ENABLE");
dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) {
@@ -392,6 +399,15 @@ tizen_create_surface(_EGLDisplay *disp, EGLint type,
goto cleanup_tpl_surface;
}
+ dri2_surf->is_frontbuffer_mode = EGL_FALSE;
+ if (env != NULL && atoi(env))
+ {
+ tpl_result_t tpl_result = TPL_ERROR_NONE;
+ tpl_result = tpl_surface_set_frontbuffer_mode(dri2_surf->tpl_surface, TPL_TRUE);
+ if (tpl_result == TPL_ERROR_NONE)
+ dri2_surf->is_frontbuffer_mode = EGL_TRUE;
+ }
+
return &dri2_surf->base;
cleanup_tpl_surface: