[Mesa-dev] [PATCH] gallium/radeon*: Remove useless casts

Marek Olšák maraeo at gmail.com
Sun Dec 6 02:52:43 PST 2015


Pushed, thanks.

Marek

On Sun, Dec 6, 2015 at 8:37 AM, Edward O'Callaghan
<eocallaghan at alterapraxis.com> wrote:
> These are unnecessary and are likely just left overs from prior
> work.
>
> Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
> ---
>  src/gallium/drivers/r600/compute_memory_pool.c | 13 +++++--------
>  src/gallium/drivers/r600/evergreen_compute.c   |  4 ++--
>  src/gallium/drivers/r600/r600_blit.c           |  4 ++--
>  src/gallium/drivers/radeon/r600_texture.c      |  2 +-
>  src/gallium/drivers/radeonsi/si_compute.c      |  2 +-
>  5 files changed, 11 insertions(+), 14 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/compute_memory_pool.c b/src/gallium/drivers/r600/compute_memory_pool.c
> index 2c62a85..93e3ffe 100644
> --- a/src/gallium/drivers/r600/compute_memory_pool.c
> +++ b/src/gallium/drivers/r600/compute_memory_pool.c
> @@ -80,8 +80,8 @@ static void compute_memory_pool_init(struct compute_memory_pool * pool,
>                 initial_size_in_dw);
>
>         pool->size_in_dw = initial_size_in_dw;
> -       pool->bo = (struct r600_resource*)r600_compute_buffer_alloc_vram(pool->screen,
> -                                                       pool->size_in_dw * 4);
> +       pool->bo = r600_compute_buffer_alloc_vram(pool->screen,
> +                                                 pool->size_in_dw * 4);
>  }
>
>  /**
> @@ -202,8 +202,7 @@ int compute_memory_grow_defrag_pool(struct compute_memory_pool *pool,
>         } else {
>                 struct r600_resource *temp = NULL;
>
> -               temp = (struct r600_resource *)r600_compute_buffer_alloc_vram(
> -                                                       pool->screen, new_size_in_dw * 4);
> +               temp = r600_compute_buffer_alloc_vram(pool->screen, new_size_in_dw * 4);
>
>                 if (temp != NULL) {
>                         struct pipe_resource *src = (struct pipe_resource *)pool->bo;
> @@ -234,9 +233,7 @@ int compute_memory_grow_defrag_pool(struct compute_memory_pool *pool,
>                         pool->screen->b.b.resource_destroy(
>                                         (struct pipe_screen *)pool->screen,
>                                         (struct pipe_resource *)pool->bo);
> -                       pool->bo = (struct r600_resource*)r600_compute_buffer_alloc_vram(
> -                                       pool->screen,
> -                                       pool->size_in_dw * 4);
> +                       pool->bo = r600_compute_buffer_alloc_vram(pool->screen, pool->size_in_dw * 4);
>                         compute_memory_shadow(pool, pipe, 0);
>
>                         if (pool->status & POOL_FRAGMENTED) {
> @@ -449,7 +446,7 @@ void compute_memory_demote_item(struct compute_memory_pool *pool,
>         /* We check if the intermediate buffer exists, and if it
>          * doesn't, we create it again */
>         if (item->real_buffer == NULL) {
> -               item->real_buffer = (struct r600_resource*)r600_compute_buffer_alloc_vram(
> +               item->real_buffer = r600_compute_buffer_alloc_vram(
>                                 pool->screen, item->size_in_dw * 4);
>         }
>
> diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
> index 010d109..a3e198c 100644
> --- a/src/gallium/drivers/r600/evergreen_compute.c
> +++ b/src/gallium/drivers/r600/evergreen_compute.c
> @@ -237,7 +237,7 @@ void *evergreen_create_compute_state(
>  #endif
>  #endif
>
> -       shader->ctx = (struct r600_context*)ctx;
> +       shader->ctx = ctx;
>         shader->local_size = cso->req_local_mem;
>         shader->private_size = cso->req_private_mem;
>         shader->input_size = cso->req_input_mem;
> @@ -997,7 +997,7 @@ void *r600_compute_global_transfer_map(
>         }
>         else {
>                 if (item->real_buffer == NULL) {
> -                       item->real_buffer = (struct r600_resource*)
> +                       item->real_buffer =
>                                         r600_compute_buffer_alloc_vram(pool->screen, item->size_in_dw * 4);
>                 }
>         }
> diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
> index 8a90489..4468b07 100644
> --- a/src/gallium/drivers/r600/r600_blit.c
> +++ b/src/gallium/drivers/r600/r600_blit.c
> @@ -553,7 +553,7 @@ static void r600_copy_global_buffer(struct pipe_context *ctx,
>                         src = (struct pipe_resource *)pool->bo;
>                 } else {
>                         if (item->real_buffer == NULL) {
> -                               item->real_buffer = (struct r600_resource*)
> +                               item->real_buffer =
>                                         r600_compute_buffer_alloc_vram(pool->screen,
>                                                                        item->size_in_dw * 4);
>                         }
> @@ -570,7 +570,7 @@ static void r600_copy_global_buffer(struct pipe_context *ctx,
>                         dst = (struct pipe_resource *)pool->bo;
>                 } else {
>                         if (item->real_buffer == NULL) {
> -                               item->real_buffer = (struct r600_resource*)
> +                               item->real_buffer =
>                                         r600_compute_buffer_alloc_vram(pool->screen,
>                                                                        item->size_in_dw * 4);
>                         }
> diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
> index 5da4ba7..6515a82 100644
> --- a/src/gallium/drivers/radeon/r600_texture.c
> +++ b/src/gallium/drivers/radeon/r600_texture.c
> @@ -1081,7 +1081,7 @@ static void *r600_texture_transfer_map(struct pipe_context *ctx,
>                                 r600_copy_region_with_blit(ctx, temp, 0, 0, 0, 0, texture, level, box);
>                                 rctx->blit_decompress_depth(ctx, (struct r600_texture*)temp, staging_depth,
>                                                             0, 0, 0, box->depth, 0, 0);
> -                               pipe_resource_reference((struct pipe_resource**)&temp, NULL);
> +                               pipe_resource_reference(&temp, NULL);
>                         }
>                 }
>                 else {
> diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
> index e134b37..a871ea0 100644
> --- a/src/gallium/drivers/radeonsi/si_compute.c
> +++ b/src/gallium/drivers/radeonsi/si_compute.c
> @@ -76,7 +76,7 @@ static void init_scratch_buffer(struct si_context *sctx, struct si_compute *prog
>         if (scratch_bytes == 0)
>                 return;
>
> -       program->shader.scratch_bo = (struct r600_resource*)
> +       program->shader.scratch_bo =
>                                 si_resource_create_custom(sctx->b.b.screen,
>                                 PIPE_USAGE_DEFAULT,
>                                 scratch_bytes * scratch_waves);
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list