r600g: remove an unused parameter from r600_bo_destroy
authorMarek Olšák <maraeo@gmail.com>
Thu, 4 Aug 2011 04:17:39 +0000 (06:17 +0200)
committerMarek Olšák <maraeo@gmail.com>
Tue, 16 Aug 2011 07:15:11 +0000 (09:15 +0200)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/r600.h
src/gallium/drivers/r600/r600_asm.c
src/gallium/drivers/r600/r600_buffer.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/r600_state_common.c
src/gallium/drivers/r600/r600_texture.c
src/gallium/winsys/r600/drm/r600_bo.c
src/gallium/winsys/r600/drm/r600_hw_context.c
src/gallium/winsys/r600/drm/r600_priv.h

index a8626d1d2ec19c2d2d9a3d1648aca91d4f4ec84f..b5d2d74628abd73b86fe82bf72973dec441f00ba 100644 (file)
@@ -107,15 +107,15 @@ void r600_bo_unmap(struct radeon *radeon, struct r600_bo *bo);
 boolean r600_bo_get_winsys_handle(struct radeon *radeon, struct r600_bo *pb_bo,
                                  unsigned stride, struct winsys_handle *whandle);
 
-void r600_bo_destroy(struct radeon *radeon, struct r600_bo *bo);
+void r600_bo_destroy(struct r600_bo *bo);
 
 /* this relies on the pipe_reference being the first member of r600_bo */
-static INLINE void r600_bo_reference(struct radeon *radeon, struct r600_bo **dst, struct r600_bo *src)
+static INLINE void r600_bo_reference(struct r600_bo **dst, struct r600_bo *src)
 {
        struct r600_bo *old = *dst;
 
        if (pipe_reference((struct pipe_reference *)(*dst), (struct pipe_reference *)src)) {
-               r600_bo_destroy(radeon, old);
+               r600_bo_destroy(old);
        }
        *dst = src;
 }
index f5244a723f4bcf2be897def794cacde419ec98b4..6092432e6f2ef8f9893a0865befdb5e54aeaf3d6 100644 (file)
@@ -2234,7 +2234,7 @@ int r600_vertex_elements_build_fetch_shader(struct r600_pipe_context *rctx, stru
        bytecode = r600_bo_map(rctx->radeon, ve->fetch_shader, rctx->ctx.cs, PIPE_TRANSFER_WRITE);
        if (bytecode == NULL) {
                r600_bc_clear(&bc);
-               r600_bo_reference(rctx->radeon, &ve->fetch_shader, NULL);
+               r600_bo_reference(&ve->fetch_shader, NULL);
                return -ENOMEM;
        }
 
index b8c6a4197486f332150fe9dfa1cff7697aebcd77..bc70578dc9f8e29071ca5b027b7707e97452b5e3 100644 (file)
@@ -46,7 +46,7 @@ static void r600_buffer_destroy(struct pipe_screen *screen,
        struct r600_resource_buffer *rbuffer = r600_buffer(buf);
 
        if (rbuffer->r.bo) {
-               r600_bo_reference(rscreen->radeon, &rbuffer->r.bo, NULL);
+               r600_bo_reference(&rbuffer->r.bo, NULL);
        }
        rbuffer->r.bo = NULL;
        util_slab_free(&rscreen->pool_buffers, rbuffer);
@@ -230,7 +230,7 @@ struct pipe_resource *r600_buffer_from_handle(struct pipe_screen *screen,
 
        rbuffer = CALLOC_STRUCT(r600_resource);
        if (rbuffer == NULL) {
-               r600_bo_reference(rw, &bo, NULL);
+               r600_bo_reference(&bo, NULL);
                return NULL;
        }
 
index 1072ea0744d69341d8518b5ccd6897f99ee0c782..4051584f27260fbe795c34237ea47ebdfdc6f67e 100644 (file)
@@ -187,7 +187,7 @@ static void r600_destroy_context(struct pipe_context *context)
                }
 
                r600_bo_unmap(rctx->radeon, rctx->fences.bo);
-               r600_bo_reference(rctx->radeon, &rctx->fences.bo, NULL);
+               r600_bo_reference(&rctx->fences.bo, NULL);
        }
 
        r600_update_num_contexts(rctx->screen, -1);
index 0f226ebd52a9a0da7c0993e26c4ed8b5da56cdb3..f86804eadcfa59f99e7662b4d97aacd7d9a618d5 100644 (file)
@@ -154,9 +154,7 @@ int r600_pipe_shader_create(struct pipe_context *ctx, struct r600_pipe_shader *s
 
 void r600_pipe_shader_destroy(struct pipe_context *ctx, struct r600_pipe_shader *shader)
 {
-       struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
-
-       r600_bo_reference(rctx->radeon, &shader->bo, NULL);
+       r600_bo_reference(&shader->bo, NULL);
        r600_bc_clear(&shader->shader.bc);
 
        memset(&shader->shader,0,sizeof(struct r600_shader));
index 9f3ab89fdf7a89000594ac589a57b1ee7f4d4cf4..2831517fe86db5853d2b81652d7313aa73ce099f 100644 (file)
@@ -150,7 +150,7 @@ void r600_delete_state(struct pipe_context *ctx, void *state)
                rctx->states[rstate->id] = NULL;
        }
        for (int i = 0; i < rstate->nregs; i++) {
-               r600_bo_reference(rctx->radeon, &rstate->regs[i].bo, NULL);
+               r600_bo_reference(&rstate->regs[i].bo, NULL);
        }
        free(rstate);
 }
@@ -181,7 +181,7 @@ void r600_delete_vertex_element(struct pipe_context *ctx, void *state)
        if (rctx->vertex_elements == state)
                rctx->vertex_elements = NULL;
 
-       r600_bo_reference(rctx->radeon, &v->fetch_shader, NULL);
+       r600_bo_reference(&v->fetch_shader, NULL);
        u_vbuf_mgr_destroy_vertex_elements(rctx->vbuf_mgr, v->vmgr_elements);
        FREE(state);
 }
index f9f0d70200876dbb97823c54201861ab263320ae..ed0b2ec28903e8a1e9dc608ca198143386966d2f 100644 (file)
@@ -339,13 +339,12 @@ static void r600_texture_destroy(struct pipe_screen *screen,
 {
        struct r600_resource_texture *rtex = (struct r600_resource_texture*)ptex;
        struct r600_resource *resource = &rtex->resource;
-       struct radeon *radeon = ((struct r600_screen*)screen)->radeon;
 
        if (rtex->flushed_depth_texture)
                pipe_resource_reference((struct pipe_resource **)&rtex->flushed_depth_texture, NULL);
 
        if (resource->bo) {
-               r600_bo_reference(radeon, &resource->bo, NULL);
+               r600_bo_reference(&resource->bo, NULL);
        }
        FREE(rtex);
 }
index b40508665b7b7b5dc7753a9e0ecb1bf6519de128..123f718e664ce02fb82669dfc4a0670f24cb0390 100644 (file)
@@ -119,7 +119,7 @@ void r600_bo_unmap(struct radeon *radeon, struct r600_bo *bo)
        radeon->ws->buffer_unmap(bo->buf);
 }
 
-void r600_bo_destroy(struct radeon *radeon, struct r600_bo *bo)
+void r600_bo_destroy(struct r600_bo *bo)
 {
        pb_reference(&bo->buf, NULL);
        free(bo);
index 38713aad1fec15ae0e32b887f491093c1a99e6b2..f39fc69aee7eda95661cbde5768b05e5355d3ea7 100644 (file)
@@ -103,7 +103,7 @@ void r600_get_backend_mask(struct r600_context *ctx)
                }
        }
 
-       r600_bo_reference(ctx->radeon, &buffer, NULL);
+       r600_bo_reference(&buffer, NULL);
 
        if (mask != 0) {
                ctx->backend_mask = mask;
@@ -738,7 +738,7 @@ static void r600_free_resource_range(struct r600_context *ctx, struct r600_range
                block = range->blocks[i];
                if (block) {
                        for (int k = 1; k <= block->nbo; k++)
-                               r600_bo_reference(ctx->radeon, &block->reloc[k].bo, NULL);
+                               r600_bo_reference(&block->reloc[k].bo, NULL);
                        free(block);
                }
        }
@@ -763,7 +763,7 @@ void r600_context_fini(struct r600_context *ctx)
                                        range->blocks[CTX_BLOCK_ID(offset)] = NULL;
                                }
                                for (int k = 1; k <= block->nbo; k++) {
-                                       r600_bo_reference(ctx->radeon, &block->reloc[k].bo, NULL);
+                                       r600_bo_reference(&block->reloc[k].bo, NULL);
                                }
                                free(block);
                        }
@@ -1068,7 +1068,7 @@ void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_stat
                if (block->pm4_bo_index[id]) {
                        /* find relocation */
                        reloc_id = block->pm4_bo_index[id];
-                       r600_bo_reference(ctx->radeon, &block->reloc[reloc_id].bo, reg->bo);
+                       r600_bo_reference(&block->reloc[reloc_id].bo, reg->bo);
                        /* always force dirty for relocs for now */
                        dirty |= R600_BLOCK_STATUS_DIRTY;
                }
@@ -1106,8 +1106,8 @@ void r600_context_pipe_state_set_resource(struct r600_context *ctx, struct r600_
                if (block->reloc[1].bo)
                        block->reloc[1].bo->binding &= ~BO_BOUND_TEXTURE;
 
-               r600_bo_reference(ctx->radeon, &block->reloc[1].bo, NULL);
-               r600_bo_reference(ctx->radeon, &block->reloc[2].bo, NULL);
+               r600_bo_reference(&block->reloc[1].bo, NULL);
+               r600_bo_reference(&block->reloc[2].bo, NULL);
                LIST_DELINIT(&block->list);
                LIST_DELINIT(&block->enable_list);
                return;
@@ -1141,12 +1141,12 @@ void r600_context_pipe_state_set_resource(struct r600_context *ctx, struct r600_
                        /* VERTEX RESOURCE, we preted there is 2 bo to relocate so
                         * we have single case btw VERTEX & TEXTURE resource
                         */
-                       r600_bo_reference(ctx->radeon, &block->reloc[1].bo, state->bo[0]);
-                       r600_bo_reference(ctx->radeon, &block->reloc[2].bo, NULL);
+                       r600_bo_reference(&block->reloc[1].bo, state->bo[0]);
+                       r600_bo_reference(&block->reloc[2].bo, NULL);
                } else {
                        /* TEXTURE RESOURCE */
-                       r600_bo_reference(ctx->radeon, &block->reloc[1].bo, state->bo[0]);
-                       r600_bo_reference(ctx->radeon, &block->reloc[2].bo, state->bo[1]);
+                       r600_bo_reference(&block->reloc[1].bo, state->bo[0]);
+                       r600_bo_reference(&block->reloc[2].bo, state->bo[1]);
                        state->bo[0]->binding |= BO_BOUND_TEXTURE;
                }
 
@@ -1512,7 +1512,7 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags)
        /* restart */
        for (int i = 0; i < ctx->creloc; i++) {
                ctx->bo[i]->last_flush = 0;
-               r600_bo_reference(ctx->radeon, &ctx->bo[i], NULL);
+               r600_bo_reference(&ctx->bo[i], NULL);
        }
        ctx->creloc = 0;
        ctx->pm4_dirty_cdwords = 0;
@@ -1793,7 +1793,7 @@ struct r600_query *r600_context_query_create(struct r600_context *ctx, unsigned
 
 void r600_context_query_destroy(struct r600_context *ctx, struct r600_query *query)
 {
-       r600_bo_reference(ctx->radeon, &query->buffer, NULL);
+       r600_bo_reference(&query->buffer, NULL);
        LIST_DELINIT(&query->list);
        free(query);
 }
index 82deeb8496e188cf4f621afd90a92131312305ee..df412a081441174b09de6dabd524a64de305c62e 100644 (file)
@@ -105,13 +105,8 @@ static INLINE unsigned r600_context_bo_reloc(struct r600_context *ctx, struct r6
        if (reloc_index >= ctx->creloc)
                ctx->creloc = reloc_index+1;
 
-       r600_bo_reference(ctx->radeon, &ctx->bo[reloc_index], rbo);
+       r600_bo_reference(&ctx->bo[reloc_index], rbo);
        return reloc_index * 4;
 }
 
-/*
- * r600_bo.c
- */
-void r600_bo_destroy(struct radeon *radeon, struct r600_bo *bo);
-
 #endif