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;
}
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;
}
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);
rbuffer = CALLOC_STRUCT(r600_resource);
if (rbuffer == NULL) {
- r600_bo_reference(rw, &bo, NULL);
+ r600_bo_reference(&bo, NULL);
return NULL;
}
}
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);
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));
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);
}
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);
}
{
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);
}
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);
}
}
- r600_bo_reference(ctx->radeon, &buffer, NULL);
+ r600_bo_reference(&buffer, NULL);
if (mask != 0) {
ctx->backend_mask = mask;
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);
}
}
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);
}
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;
}
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;
/* 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;
}
/* 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;
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);
}
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