diff options
author | xuelian.bai <xuelian.bai@samsung.com> | 2021-04-20 23:45:09 +0800 |
---|---|---|
committer | xuelian.bai <xuelian.bai@samsung.com> | 2021-04-22 18:23:47 +0800 |
commit | 6edcf625ce70f058cecc62a2641aed98d5107201 (patch) | |
tree | c2d372550dc26e63a7e485398bf3d7f1ce4be31e | |
parent | 10d03bd0a233945d16d638fdbd4f04eddd85eb70 (diff) | |
download | mesa-sandbox/baixl/devel.tar.gz mesa-sandbox/baixl/devel.tar.bz2 mesa-sandbox/baixl/devel.zip |
Fix coredump for swrastsandbox/baixl/devel
When LIBGL_ALWAYS_SOFTWARE is enabled, coredump will happen because
tizen_swap_buffers is called.
Change-Id: I59e7952c3571da42ab31aacbf1b4dda87be51e04
Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
-rwxr-xr-x | src/egl/drivers/dri2/platform_tizen.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c index 9cdc86f8140..a3ba349a2f6 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; } } @@ -1512,6 +1518,27 @@ static const __DRIextension *tizen_swrast_loader_extensions[] = { 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 +1718,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*/ |