[Mesa-dev] [PATCH 1/3] freedreno: Fix warnings

Kristian Høgsberg krh at bitplanet.net
Thu Aug 16 01:10:05 UTC 2018


The remaining two patches are stuck in moderation for being too big.
They update the generated headers and adds the a6xx backend. They're
in this branch:

  https://gitlab.freedesktop.org/krh/mesa/commits/wip/a6xx-rebase-3

for reference.

Kristian

On Wed, Aug 15, 2018 at 9:18 AM Kristian H. Kristensen
<krh at bitplanet.net> wrote:
>
> From: "Kristian H. Kristensen" <hoegsberg at chromium.org>
>
> Signed-off-by: Kristian H. Kristensen <hoegsberg at chromium.org>
> ---
>  src/gallium/drivers/freedreno/a5xx/fd5_compute.c   | 2 +-
>  src/gallium/drivers/freedreno/freedreno_resource.c | 8 ++++----
>  src/gallium/drivers/freedreno/ir3/ir3.h            | 8 ++------
>  src/gallium/drivers/freedreno/ir3/ir3_cmdline.c    | 2 +-
>  src/gallium/drivers/freedreno/ir3/ir3_shader.h     | 4 +---
>  5 files changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_compute.c b/src/gallium/drivers/freedreno/a5xx/fd5_compute.c
> index 8e2c228e90..66ed7a4af5 100644
> --- a/src/gallium/drivers/freedreno/a5xx/fd5_compute.c
> +++ b/src/gallium/drivers/freedreno/a5xx/fd5_compute.c
> @@ -181,7 +181,7 @@ static void
>  fd5_launch_grid(struct fd_context *ctx, const struct pipe_grid_info *info)
>  {
>         struct fd5_compute_stateobj *so = ctx->compute;
> -       struct ir3_shader_key key = {0};
> +       struct ir3_shader_key key = {};
>         struct ir3_shader_variant *v;
>         struct fd_ringbuffer *ring = ctx->batch->draw;
>         unsigned i, nglobal = 0;
> diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
> index 3fbf50003e..f882cf5a8b 100644
> --- a/src/gallium/drivers/freedreno/freedreno_resource.c
> +++ b/src/gallium/drivers/freedreno/freedreno_resource.c
> @@ -211,7 +211,7 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc,
>
>         mtx_unlock(&ctx->screen->lock);
>
> -       struct pipe_blit_info blit = {0};
> +       struct pipe_blit_info blit = {};
>         blit.dst.resource = prsc;
>         blit.dst.format   = prsc->format;
>         blit.src.resource = pshadow;
> @@ -305,7 +305,7 @@ static void
>  fd_blit_from_staging(struct fd_context *ctx, struct fd_transfer *trans)
>  {
>         struct pipe_resource *dst = trans->base.resource;
> -       struct pipe_blit_info blit = {0};
> +       struct pipe_blit_info blit = {};
>
>         blit.dst.resource = dst;
>         blit.dst.format   = dst->format;
> @@ -325,7 +325,7 @@ static void
>  fd_blit_to_staging(struct fd_context *ctx, struct fd_transfer *trans)
>  {
>         struct pipe_resource *src = trans->base.resource;
> -       struct pipe_blit_info blit = {0};
> +       struct pipe_blit_info blit = {};
>
>         blit.src.resource = src;
>         blit.src.format   = src->format;
> @@ -372,7 +372,7 @@ flush_resource(struct fd_context *ctx, struct fd_resource *rsc, unsigned usage)
>         fd_batch_reference(&write_batch, rsc->write_batch);
>
>         if (usage & PIPE_TRANSFER_WRITE) {
> -               struct fd_batch *batch, *batches[32] = {0};
> +               struct fd_batch *batch, *batches[32] = {};
>                 uint32_t batch_mask;
>
>                 /* This is a bit awkward, probably a fd_batch_flush_locked()
> diff --git a/src/gallium/drivers/freedreno/ir3/ir3.h b/src/gallium/drivers/freedreno/ir3/ir3.h
> index 8bac91660b..63215cefc9 100644
> --- a/src/gallium/drivers/freedreno/ir3/ir3.h
> +++ b/src/gallium/drivers/freedreno/ir3/ir3.h
> @@ -445,14 +445,12 @@ struct ir3 {
>  #endif
>  };
>
> -typedef struct nir_register nir_register;
> -
>  struct ir3_array {
>         struct list_head node;
>         unsigned length;
>         unsigned id;
>
> -       nir_register *r;
> +       struct nir_register *r;
>
>         /* To avoid array write's from getting DCE'd, keep track of the
>          * most recent write.  Any array access depends on the most
> @@ -470,13 +468,11 @@ struct ir3_array {
>
>  struct ir3_array * ir3_lookup_array(struct ir3 *ir, unsigned id);
>
> -typedef struct nir_block nir_block;
> -
>  struct ir3_block {
>         struct list_head node;
>         struct ir3 *shader;
>
> -       const nir_block *nblock;
> +       const struct nir_block *nblock;
>
>         struct list_head instr_list;  /* list of ir3_instruction */
>
> diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
> index 23d5006352..b41c32d375 100644
> --- a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
> +++ b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
> @@ -379,7 +379,7 @@ int main(int argc, char **argv)
>
>         while (n < argc) {
>                 char *filename = argv[n];
> -               char *ext = rindex(filename, '.');
> +               char *ext = strrchr(filename, '.');
>
>                 if (strcmp(ext, ".tgsi") == 0) {
>                         if (num_files != 0)
> diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.h b/src/gallium/drivers/freedreno/ir3/ir3_shader.h
> index 507e89c473..288e9fa4e7 100644
> --- a/src/gallium/drivers/freedreno/ir3/ir3_shader.h
> +++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.h
> @@ -345,8 +345,6 @@ struct ir3_shader_variant {
>         struct ir3_shader *shader;
>  };
>
> -typedef struct nir_shader nir_shader;
> -
>  struct ir3_shader {
>         enum shader_t type;
>
> @@ -359,7 +357,7 @@ struct ir3_shader {
>
>         struct ir3_compiler *compiler;
>
> -       nir_shader *nir;
> +       struct nir_shader *nir;
>         struct pipe_stream_output_info stream_output;
>
>         struct ir3_shader_variant *variants;
> --
> 2.18.0.865.gffc8e1a3cd6-goog
>


More information about the mesa-dev mailing list