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>2021-10-11 10:16:47 +0800
commitf28db1fb770fc2661db8503005b81fd4070994ff (patch)
tree3f3216e2b0af7da8590ca35ed4698a0f376a3f48
parent8fa74ffca71a0d549eb091c5f664006f0abeeb6b (diff)
downloadmesa-f28db1fb770fc2661db8503005b81fd4070994ff.tar.gz
mesa-f28db1fb770fc2661db8503005b81fd4070994ff.tar.bz2
mesa-f28db1fb770fc2661db8503005b81fd4070994ff.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*/