[Mesa-dev] [PATCH 23/32] i965/miptree: Add a return for updating of winsys

Pohjolainen, Topi topi.pohjolainen at gmail.com
Wed Jan 4 07:46:36 UTC 2017


On Mon, Jan 02, 2017 at 06:37:14PM -0800, Ben Widawsky wrote:
> There is nothing particularly useful to do currently if the update
> fails, but there is no point carrying on either. As a result, this has a
> behavior change.
> 
> v2: Make the return type a bool (Topi)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

> 
> Cc: Topi Pohjolainen <topi.pohjolainen at intel.com>
> Signed-off-by: Ben Widawsky <benjamin.widawsky at intel.com>
> Acked-by: Daniel Stone <daniels at collabora.com>
> ---
>  src/mesa/drivers/dri/i965/brw_context.c       | 14 ++++++++------
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c |  6 +++---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.h |  2 +-
>  3 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> index 4ca77c789b..7e350c4e47 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -1652,9 +1652,10 @@ intel_process_dri2_buffer(struct brw_context *brw,
>        return;
>     }
>  
> -   intel_update_winsys_renderbuffer_miptree(brw, rb, bo,
> -                                            drawable->w, drawable->h,
> -                                            buffer->pitch);
> +   if (!intel_update_winsys_renderbuffer_miptree(brw, rb, bo,
> +                                                 drawable->w, drawable->h,
> +                                                 buffer->pitch))
> +      return;
>  
>     if (_mesa_is_front_buffer_drawing(fb) &&
>         (buffer->attachment == __DRI_BUFFER_FRONT_LEFT ||
> @@ -1710,9 +1711,10 @@ intel_update_image_buffer(struct brw_context *intel,
>     if (last_mt && last_mt->bo == buffer->bo)
>        return;
>  
> -   intel_update_winsys_renderbuffer_miptree(intel, rb, buffer->bo,
> -                                            buffer->width, buffer->height,
> -                                            buffer->pitch);
> +   if (!intel_update_winsys_renderbuffer_miptree(intel, rb, buffer->bo,
> +                                                 buffer->width, buffer->height,
> +                                                 buffer->pitch))
> +      return;
>  
>     if (_mesa_is_front_buffer_drawing(fb) &&
>         buffer_type == __DRI_IMAGE_BUFFER_FRONT &&
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index dce8ce3350..a6cc64365d 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -916,7 +916,7 @@ intel_miptree_create_for_image(struct brw_context *intel,
>   * that will contain the actual rendering (which is lazily resolved to
>   * irb->singlesample_mt).
>   */
> -void
> +bool
>  intel_update_winsys_renderbuffer_miptree(struct brw_context *intel,
>                                           struct intel_renderbuffer *irb,
>                                           drm_intel_bo *bo,
> @@ -982,12 +982,12 @@ intel_update_winsys_renderbuffer_miptree(struct brw_context *intel,
>           irb->mt = multisample_mt;
>        }
>     }
> -   return;
> +   return true;
>  
>  fail:
>     intel_miptree_release(&irb->singlesample_mt);
>     intel_miptree_release(&irb->mt);
> -   return;
> +   return false;
>  }
>  
>  struct intel_mipmap_tree*
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> index cf8f1a7687..9b4c85e509 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> @@ -730,7 +730,7 @@ intel_miptree_create_for_image(struct brw_context *intel,
>                                 uint32_t pitch,
>                                 uint32_t layout_flags);
>  
> -void
> +bool
>  intel_update_winsys_renderbuffer_miptree(struct brw_context *intel,
>                                           struct intel_renderbuffer *irb,
>                                           drm_intel_bo *bo,
> -- 
> 2.11.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list