summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxuelian.bai <xuelian.bai@samsung.com>2021-04-20 23:45:09 +0800
committerXuelian Bai <xuelian.bai@samsung.com>2023-02-21 14:32:53 +0800
commitb1fda227367aa5cefe749f5a71b9a51b97bf6f88 (patch)
tree993538cc29c32c97dcd9a2026f4bee39006bce17
parent5be35a51fbe3a84c14ff1a228f73751e5c3bb28b (diff)
downloadmesa-b1fda227367aa5cefe749f5a71b9a51b97bf6f88.tar.gz
mesa-b1fda227367aa5cefe749f5a71b9a51b97bf6f88.tar.bz2
mesa-b1fda227367aa5cefe749f5a71b9a51b97bf6f88.zip
Fix coredump for swrast
When LIBGL_ALWAYS_SOFTWARE is enabled, coredump will happen because tizen_swap_buffers is called. Change-Id: Ifd048d4f2904064fddf9975aa9d86f6104ee8997 Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
-rwxr-xr-xsrc/egl/drivers/dri2/platform_tizen.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c
index 9cdc86f8140..1b1ee618b87 100755
--- a/src/egl/drivers/dri2/platform_tizen.c
+++ b/src/egl/drivers/dri2/platform_tizen.c
@@ -1327,6 +1327,12 @@ tizen_swrast_put_image2(__DRIdrawable * draw, int op,
}
tbm_surface_unmap(dri2_surf->tbm_surface);
+ tpl_surface_enqueue_buffer_with_damage_and_sync(dri2_surf->tpl_surface,
+ dri2_surf->tbm_surface,
+ 0, NULL, -1);
+ tbm_surface_internal_unref(dri2_surf->tbm_surface);
+ dri2_surf->tbm_surface = NULL;
+ dri2_surf->back = NULL;
}
}
@@ -1509,9 +1515,31 @@ static const __DRIextension *tizen_image_loader_extensions[] = {
static const __DRIextension *tizen_swrast_loader_extensions[] = {
&tizen_swrast_loader_extension.base,
+ &image_lookup_extension.base,
NULL,
};
+static EGLBoolean
+tizen_swrast_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
+{
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
+
+ dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable);
+ return EGL_TRUE;
+}
+
+static const struct dri2_egl_display_vtbl tizen_swrast_display_vtbl = {
+ .authenticate = NULL,
+ .create_window_surface = tizen_create_window_surface,
+ .create_pixmap_surface = tizen_create_pixmap_surface,
+ .create_pbuffer_surface = tizen_create_pbuffer_surface,
+ .destroy_surface = tizen_destroy_surface,
+ .create_image = tizen_create_image_khr,
+ .swap_buffers = tizen_swrast_swap_buffers,
+ .get_dri_drawable = dri2_surface_get_dri_drawable,
+};
+
EGLBoolean
dri2_initialize_tizen(_EGLDisplay *disp)
{
@@ -1691,7 +1719,10 @@ dri2_initialize_tizen(_EGLDisplay *disp)
/* Fill vtbl last to prevent accidentally calling virtual function during
* initialization.
*/
- dri2_dpy->vtbl = &tizen_display_vtbl;
+ if (hw_accel)
+ dri2_dpy->vtbl = &tizen_display_vtbl;
+ else
+ dri2_dpy->vtbl = &tizen_swrast_display_vtbl;
disp->Extensions.EXT_buffer_age = EGL_FALSE;
disp->Extensions.EXT_swap_buffers_with_damage = EGL_FALSE; /*disable partial buffer swap*/