[Mesa-dev] [PATCH 01/16] i965/miptree: Set refcount before failing via _release()

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 17 15:00:28 UTC 2017


On 17 July 2017 at 14:34, Topi Pohjolainen <topi.pohjolainen at gmail.com> wrote:
> Otherwise one wraps uint to UINT_MAX via -1.
>
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 6135fda1be..b9a00caad2 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -707,6 +707,8 @@ make_surface(struct brw_context *brw, GLenum target, mesa_format format,
>        return NULL;
>     }
>
> +   mt->refcount = 1;
> +
>     if (target == GL_TEXTURE_CUBE_MAP ||
>         target == GL_TEXTURE_CUBE_MAP_ARRAY)
>        isl_usage_flags |= ISL_SURF_USAGE_CUBE_BIT;
> @@ -751,7 +753,6 @@ make_surface(struct brw_context *brw, GLenum target, mesa_format format,
>     mt->last_level = last_level;
>     mt->target = target;
>     mt->format = format;
> -   mt->refcount = 1;
>     mt->aux_state = NULL;
>
Perhaps move the whole mt->foo = bar; hunk further up? That's a bit
bikeshedy nit, so regardless if you opt for it or not

Fixes: 3cf470f2b6c ("i965: Add isl based miptree creator")
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

-Emil


More information about the mesa-dev mailing list