From 7e43a280793af50e826fb6183670de8e3d427d74 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Sun, 6 Dec 2015 18:37:49 +1100 Subject: gallium/radeon*: Remove useless casts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are unnecessary and are likely just left overs from prior work. Signed-off-by: Edward O'Callaghan Signed-off-by: Marek Olšák --- 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(-) (limited to 'src') diff --git a/src/gallium/drivers/r600/compute_memory_pool.c b/src/gallium/drivers/r600/compute_memory_pool.c index 7c5113e9197..d014b952a3f 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 010d109f7ce..a3e198c6fcf 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 8a90489318e..4468b078898 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 e2947d9e351..88b799d87ee 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 e134b37b95d..a871ea0d5b6 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); -- cgit v1.2.3