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>2024-01-18 09:31:55 +0800
commitac8a21b3f79ef34b37fd2c071df8467b11a83e51 (patch)
tree6860a686f3ed4814b5bc36819a08bb4ce1754979
parent8a981d6bcf672c85d4f0bc6bb4aef50b584ed32d (diff)
downloadmesa-ac8a21b3f79ef34b37fd2c071df8467b11a83e51.tar.gz
mesa-ac8a21b3f79ef34b37fd2c071df8467b11a83e51.tar.bz2
mesa-ac8a21b3f79ef34b37fd2c071df8467b11a83e51.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 286781bd0f0..30ac4a252a9 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*/