summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_pipe.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-09-11 22:24:38 +0200
committerMarek Olšák <[email protected]>2011-09-30 23:19:52 +0200
commit6101b6d442b06a347c001fe85848d636ab7df260 (patch)
treef345c754e5fb587997f150f3dd4434d88123f592 /src/gallium/drivers/r600/r600_pipe.c
parentba89086e79b22bd9578ea642846108de624c91e9 (diff)
r600g: merge r600_bo with r600_resource
I have moved 'last_flush' and 'binding' from r600_bo to winsys/radeon. The other members are now part of r600_resource. Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_pipe.c')
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index efe1d5213dc..e27522da3f4 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -53,18 +53,19 @@
*/
static struct r600_fence *r600_create_fence(struct r600_pipe_context *ctx)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
struct r600_fence *fence = NULL;
if (!ctx->fences.bo) {
/* Create the shared buffer object */
- ctx->fences.bo = r600_bo(ctx->radeon, 4096, 0, 0, 0);
+ ctx->fences.bo = (struct r600_resource*)
+ pipe_buffer_create(&ctx->screen->screen, PIPE_BIND_CUSTOM,
+ PIPE_USAGE_STAGING, 4096);
if (!ctx->fences.bo) {
R600_ERR("r600: failed to create bo for fence objects\n");
return NULL;
}
- ctx->fences.data = r600_bo_map(ctx->radeon, ctx->fences.bo, rctx->ctx.cs,
- PIPE_TRANSFER_UNSYNCHRONIZED | PIPE_TRANSFER_WRITE);
+ ctx->fences.data = ctx->ws->buffer_map(ctx->fences.bo->buf, ctx->ctx.cs,
+ PIPE_TRANSFER_WRITE);
}
if (!LIST_IS_EMPTY(&ctx->fences.pool)) {
@@ -184,8 +185,8 @@ static void r600_destroy_context(struct pipe_context *context)
FREE(entry);
}
- r600_bo_unmap(rctx->radeon, rctx->fences.bo);
- r600_bo_reference(&rctx->fences.bo, NULL);
+ rctx->ws->buffer_unmap(rctx->fences.bo->buf);
+ pipe_resource_reference((struct pipe_resource**)&rctx->fences.bo, NULL);
}
r600_update_num_contexts(rctx->screen, -1);
@@ -211,6 +212,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
/* Easy accessing of screen/winsys. */
rctx->screen = rscreen;
+ rctx->ws = rscreen->ws;
rctx->radeon = rscreen->radeon;
rctx->family = r600_get_family(rctx->radeon);
rctx->chip_class = r600_get_family_class(rctx->radeon);
@@ -234,7 +236,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
case R600:
case R700:
r600_init_state_functions(rctx);
- if (r600_context_init(&rctx->ctx, rctx->radeon)) {
+ if (r600_context_init(&rctx->ctx, rctx->screen, rctx->radeon)) {
r600_destroy_context(&rctx->context);
return NULL;
}
@@ -244,7 +246,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
case EVERGREEN:
case CAYMAN:
evergreen_init_state_functions(rctx);
- if (evergreen_context_init(&rctx->ctx, rctx->radeon)) {
+ if (evergreen_context_init(&rctx->ctx, rctx->screen, rctx->radeon)) {
r600_destroy_context(&rctx->context);
return NULL;
}