aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2017-05-18 10:21:59 +0300
committerTapani Pälli <[email protected]>2017-05-19 13:57:52 +0300
commitf347bac30f4045a9583f95a5776484b1a2947183 (patch)
tree77e0b0636e5ba57932393c752799704b44198ff9 /src
parent1f2d0093bf5084f65a923582881dc74153c804a4 (diff)
egl/android: fix segfault within swap_buffers
Function droid_swap_buffers may get called without dri2_surf->buffer set, in these cases we don't have a back buffer set either. Patch fixes segfault seen with 3DMark that uses android.opengl.GLSurfaceView for rendering it's UI. backtrace: #00 pc 00013f88 /system/lib/egl/libGLES_mesa.so (droid_swap_buffers+104) #01 pc 000117b2 /system/lib/egl/libGLES_mesa.so (dri2_swap_buffers+50) #02 pc 000058b2 /system/lib/egl/libGLES_mesa.so (eglSwapBuffers+386) #03 pc 00011329 /system/lib/libEGL.so (eglSwapBuffersWithDamageKHR+553) #04 pc 000118e7 /system/lib/libEGL.so (eglSwapBuffers+55) #05 pc 000754dc /system/lib/libandroid_runtime.so Note, this is v1 as v2 caused dEQP regressions. Fixes: 2acc69d ("EGL/Android: Add EGL_EXT_buffer_age extension") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]> Cc: "17.1" <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/platform_android.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 49cbeb4698e..de24a8f5c49 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -628,7 +628,12 @@ droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
if (dri2_surf->color_buffers[i].age > 0)
dri2_surf->color_buffers[i].age++;
}
- dri2_surf->back->age = 1;
+
+ /* "XXX: we don't use get_back_bo() since it causes regressions in
+ * several dEQP tests.
+ */
+ if (dri2_surf->back)
+ dri2_surf->back->age = 1;
dri2_flush_drawable_for_swapbuffers(disp, draw);