Re: [Mesa-dev] [PATCH mesa] i965: Check result of make_surface() for miptree_create

2018-05-22 Thread Eric Engestrom
On Monday, 2018-05-21 11:42:37 -0700, Ian Romanick wrote:
> On 05/17/2018 05:05 AM, Eric Engestrom wrote:
> > From: Andrea Azzarone 
> > 
> > Since make_surface() can fail we need to check the result before 
> > dereferencing it.
> > 
> > Bug: https://github.com/mesa3d/mesa/pull/5
> > Bug: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1760415
> > Reviewed-by: Eric Engestrom 
> > ---
> > Andrea: We don't use github, I only happened to notice your pull request :)
> > Next time you want to send us something, send it here :P
> > ---
> >  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
> > b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > index 67086ee6c0e8d6b6feb0..43687ea77abfe9989882 100644
> > --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> > @@ -718,6 +718,9 @@ miptree_create(struct brw_context *brw,
> >   ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT,
> >   BO_ALLOC_BUSY, 0, NULL);
> >  
> > +  if (!mt)
> > + return NULL;
> > +
> 
> So... I sent this same patch a few months ago, but we decided to not
> land it.
> 
> https://patchwork.freedesktop.org/patch/195626/

Right, I had missed that discussion.
Dropping the patch :)

> 
> 
> >if (needs_separate_stencil(brw, mt, format) &&
> >!make_separate_stencil_surface(brw, mt)) {
> >   intel_miptree_release();
> > 
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH mesa] i965: Check result of make_surface() for miptree_create

2018-05-21 Thread Ian Romanick
On 05/17/2018 05:05 AM, Eric Engestrom wrote:
> From: Andrea Azzarone 
> 
> Since make_surface() can fail we need to check the result before 
> dereferencing it.
> 
> Bug: https://github.com/mesa3d/mesa/pull/5
> Bug: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1760415
> Reviewed-by: Eric Engestrom 
> ---
> Andrea: We don't use github, I only happened to notice your pull request :)
> Next time you want to send us something, send it here :P
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 67086ee6c0e8d6b6feb0..43687ea77abfe9989882 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -718,6 +718,9 @@ miptree_create(struct brw_context *brw,
>   ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT,
>   BO_ALLOC_BUSY, 0, NULL);
>  
> +  if (!mt)
> + return NULL;
> +

So... I sent this same patch a few months ago, but we decided to not
land it.

https://patchwork.freedesktop.org/patch/195626/


>if (needs_separate_stencil(brw, mt, format) &&
>!make_separate_stencil_surface(brw, mt)) {
>   intel_miptree_release();
> 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH mesa] i965: Check result of make_surface() for miptree_create

2018-05-17 Thread Nanley Chery
On Thu, May 17, 2018 at 01:05:13PM +0100, Eric Engestrom wrote:
> From: Andrea Azzarone 
> 
> Since make_surface() can fail we need to check the result before 
> dereferencing it.
> 

This line should be wrapped to 75 characters or less
(see https://www.mesa3d.org/submittingpatches.html).

> Bug: https://github.com/mesa3d/mesa/pull/5
> Bug: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1760415

I'd also add

Fixes: 67b53ee4183 "i965: Represent depth surfaces with isl"

With those changes, this patch is
Reviewed-by: Nanley Chery 

> Reviewed-by: Eric Engestrom 
> ---
> Andrea: We don't use github, I only happened to notice your pull request :)
> Next time you want to send us something, send it here :P
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 67086ee6c0e8d6b6feb0..43687ea77abfe9989882 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -718,6 +718,9 @@ miptree_create(struct brw_context *brw,
>   ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT,
>   BO_ALLOC_BUSY, 0, NULL);
>  
> +  if (!mt)
> + return NULL;
> +
>if (needs_separate_stencil(brw, mt, format) &&
>!make_separate_stencil_surface(brw, mt)) {
>   intel_miptree_release();
> -- 
> Cheers,
>   Eric
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev