[Mesa-dev] [PATCH] radeonsi: silence Coverity warning

Marek Olšák maraeo at gmail.com
Tue Jul 12 10:56:38 UTC 2016


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Sun, Jul 10, 2016 at 4:19 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> Coverity's analysis is too weak to understand that
> r600_init_flushed_depth(_, _, NULL) only returns true when
> flushed_depth_texture was assigned a non-NULL value.
> ---
>  src/gallium/drivers/radeonsi/si_blit.c  | 2 ++
>  src/gallium/drivers/radeonsi/si_state.c | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
> index 84567f0..38a19d5 100644
> --- a/src/gallium/drivers/radeonsi/si_blit.c
> +++ b/src/gallium/drivers/radeonsi/si_blit.c
> @@ -342,6 +342,8 @@ si_flush_depth_texture(struct si_context *sctx,
>                 unsigned fully_copied_levels;
>                 unsigned levels = 0;
>
> +               assert(tex->flushed_depth_texture);
> +
>                 if (util_format_is_depth_and_stencil(dst->resource.b.b.format))
>                         copy_planes = PIPE_MASK_Z | PIPE_MASK_S;
>
> diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
> index bdd7ef4..f801ca5 100644
> --- a/src/gallium/drivers/radeonsi/si_state.c
> +++ b/src/gallium/drivers/radeonsi/si_state.c
> @@ -3001,6 +3001,8 @@ si_create_sampler_view_custom(struct pipe_context *ctx,
>                         return NULL;
>                 }
>
> +               assert(tmp->flushed_depth_texture);
> +
>                 /* Override format for the case where the flushed texture
>                  * contains only Z or only S.
>                  */
> --
> 2.7.4
>
> _______________________________________________
> 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