[Mesa-dev] [PATCH] egl/drm: do not crash when swapping buffers without any rendering
Tapani
tapani.palli at intel.com
Wed Oct 22 00:03:55 PDT 2014
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
(This is a fix for https://bugs.freedesktop.org/show_bug.cgi?id=83445)
On 10/14/2014 12:48 PM, Lionel Landwerlin wrote:
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
> src/egl/drivers/dri2/platform_drm.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
> index 70bd7d4..f6b9c3a 100644
> --- a/src/egl/drivers/dri2/platform_drm.c
> +++ b/src/egl/drivers/dri2/platform_drm.c
> @@ -418,6 +418,14 @@ dri2_drm_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
> for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++)
> if (dri2_surf->color_buffers[i].age > 0)
> dri2_surf->color_buffers[i].age++;
> +
> + /* Make sure we have a back buffer in case we're swapping without
> + * ever rendering. */
> + if (get_back_bo(dri2_surf) < 0) {
> + _eglError(EGL_BAD_ALLOC, "dri2_swap_buffers");
> + return EGL_FALSE;
> + }
> +
> dri2_surf->current = dri2_surf->back;
> dri2_surf->current->age = 1;
> dri2_surf->back = NULL;
More information about the mesa-dev
mailing list