[Mesa-dev] [PATCH] i915: Check return value of screen->image.loader->getBuffers

Eric Engestrom eric.engestrom at imgtec.com
Fri Aug 26 10:44:05 UTC 2016


On Wed, Aug 24, 2016 at 12:50:33PM +0100, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
> 
> Ported from the i965 commit e7ab358e8186dd8651cf920d4db1500c60ccd2fc.
> 
> Cc: 11.2 12.0 <mesa-stable at lists.freedesktop.org>
> Cc: Tomasz Figa <tfiga at chromium.org>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

> ---
>  src/mesa/drivers/dri/i915/intel_context.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
> index e5a3f00..5607d5b 100644
> --- a/src/mesa/drivers/dri/i915/intel_context.c
> +++ b/src/mesa/drivers/dri/i915/intel_context.c
> @@ -858,6 +858,7 @@ intel_update_image_buffers(struct intel_context *intel, __DRIdrawable *drawable)
>     struct __DRIimageList images;
>     unsigned int format;
>     uint32_t buffer_mask = 0;
> +   int ret;
>  
>     front_rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
>     back_rb = intel_get_renderbuffer(fb, BUFFER_BACK_LEFT);
> @@ -877,12 +878,14 @@ intel_update_image_buffers(struct intel_context *intel, __DRIdrawable *drawable)
>     if (back_rb)
>        buffer_mask |= __DRI_IMAGE_BUFFER_BACK;
>  
> -   (*screen->image.loader->getBuffers) (drawable,
> -                                        driGLFormatToImageFormat(format),
> -                                        &drawable->dri2.stamp,
> -                                        drawable->loaderPrivate,
> -                                        buffer_mask,
> -                                        &images);
> +   ret = screen->image.loader->getBuffers(drawable,
> +                                          driGLFormatToImageFormat(format),
> +                                          &drawable->dri2.stamp,
> +                                          drawable->loaderPrivate,
> +                                          buffer_mask,
> +                                          &images);
> +   if (!ret)
> +      return;
>  
>     if (images.image_mask & __DRI_IMAGE_BUFFER_FRONT) {
>        drawable->w = images.front->width;
> -- 
> 2.9.0


More information about the mesa-dev mailing list