summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-04-26 12:02:31 +0200
committerMarek Olšák <[email protected]>2012-04-29 14:46:52 +0200
commit0a6120244e66494db070ce875c0a464fbc5b15a1 (patch)
tree400b5129e5ae2edbca42039224ee27a22c835816 /src/gallium/drivers/r600
parent8e90913e9f99ff3296a3c3da36e73cd2d4730269 (diff)
winsys/radeon: simplify buffer map/unmap functions
The idea is not to use pb_map and pb_unmap wrappers, calling straight into the winsys.
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r--src/gallium/drivers/r600/r600_asm.c4
-rw-r--r--src/gallium/drivers/r600/r600_buffer.c4
-rw-r--r--src/gallium/drivers/r600/r600_hw_context.c8
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c4
-rw-r--r--src/gallium/drivers/r600/r600_query.c12
-rw-r--r--src/gallium/drivers/r600/r600_shader.c4
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c4
-rw-r--r--src/gallium/drivers/r600/r600_texture.c16
8 files changed, 28 insertions, 28 deletions
diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index 0ecca363f1c..651933bf37c 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -2810,7 +2810,7 @@ int r600_vertex_elements_build_fetch_shader(struct r600_context *rctx, struct r6
return -ENOMEM;
}
- bytecode = rctx->ws->buffer_map(ve->fetch_shader->buf, rctx->cs, PIPE_TRANSFER_WRITE);
+ bytecode = rctx->ws->buffer_map(ve->fetch_shader->cs_buf, rctx->cs, PIPE_TRANSFER_WRITE);
if (bytecode == NULL) {
r600_bytecode_clear(&bc);
pipe_resource_reference((struct pipe_resource**)&ve->fetch_shader, NULL);
@@ -2825,7 +2825,7 @@ int r600_vertex_elements_build_fetch_shader(struct r600_context *rctx, struct r6
memcpy(bytecode, bc.bytecode, ve->fs_size);
}
- rctx->ws->buffer_unmap(ve->fetch_shader->buf);
+ rctx->ws->buffer_unmap(ve->fetch_shader->cs_buf);
r600_bytecode_clear(&bc);
if (rctx->chip_class >= EVERGREEN)
diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c
index cb3ea214cfe..eec85d1021e 100644
--- a/src/gallium/drivers/r600/r600_buffer.c
+++ b/src/gallium/drivers/r600/r600_buffer.c
@@ -129,7 +129,7 @@ static void *r600_buffer_transfer_map(struct pipe_context *pipe,
if (rbuffer->b.b.user_ptr)
return rbuffer->b.b.user_ptr + transfer->box.x;
- data = rctx->ws->buffer_map(rbuffer->buf, rctx->cs, transfer->usage);
+ data = rctx->ws->buffer_map(rbuffer->cs_buf, rctx->cs, transfer->usage);
if (!data)
return NULL;
@@ -145,7 +145,7 @@ static void r600_buffer_transfer_unmap(struct pipe_context *pipe,
if (rbuffer->b.b.user_ptr)
return;
- rctx->ws->buffer_unmap(rbuffer->buf);
+ rctx->ws->buffer_unmap(rbuffer->cs_buf);
}
static void r600_transfer_destroy(struct pipe_context *ctx,
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c
index febe9bd665e..a0224363fd4 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -75,10 +75,10 @@ void r600_get_backend_mask(struct r600_context *ctx)
va = r600_resource_va(&ctx->screen->screen, (void*)buffer);
/* initialize buffer with zeroes */
- results = ctx->ws->buffer_map(buffer->buf, ctx->cs, PIPE_TRANSFER_WRITE);
+ results = ctx->ws->buffer_map(buffer->cs_buf, ctx->cs, PIPE_TRANSFER_WRITE);
if (results) {
memset(results, 0, ctx->max_db * 4 * 4);
- ctx->ws->buffer_unmap(buffer->buf);
+ ctx->ws->buffer_unmap(buffer->cs_buf);
/* emit EVENT_WRITE for ZPASS_DONE */
cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 2, 0);
@@ -90,14 +90,14 @@ void r600_get_backend_mask(struct r600_context *ctx)
cs->buf[cs->cdw++] = r600_context_bo_reloc(ctx, buffer, RADEON_USAGE_WRITE);
/* analyze results */
- results = ctx->ws->buffer_map(buffer->buf, ctx->cs, PIPE_TRANSFER_READ);
+ results = ctx->ws->buffer_map(buffer->cs_buf, ctx->cs, PIPE_TRANSFER_READ);
if (results) {
for(i = 0; i < ctx->max_db; i++) {
/* at least highest bit will be set if backend is used */
if (results[i*4 + 1])
mask |= (1<<i);
}
- ctx->ws->buffer_unmap(buffer->buf);
+ ctx->ws->buffer_unmap(buffer->cs_buf);
}
}
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 062b94af720..0b67a0143a0 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -52,7 +52,7 @@ static struct r600_fence *r600_create_fence(struct r600_context *rctx)
R600_ERR("r600: failed to create bo for fence objects\n");
goto out;
}
- rscreen->fences.data = rctx->ws->buffer_map(rscreen->fences.bo->buf,
+ rscreen->fences.data = rctx->ws->buffer_map(rscreen->fences.bo->cs_buf,
rctx->cs,
PIPE_TRANSFER_READ_WRITE);
}
@@ -599,7 +599,7 @@ static void r600_destroy_screen(struct pipe_screen* pscreen)
FREE(entry);
}
- rscreen->ws->buffer_unmap(rscreen->fences.bo->buf);
+ rscreen->ws->buffer_unmap(rscreen->fences.bo->cs_buf);
pipe_resource_reference((struct pipe_resource**)&rscreen->fences.bo, NULL);
}
pipe_mutex_destroy(rscreen->fences.mutex);
diff --git a/src/gallium/drivers/r600/r600_query.c b/src/gallium/drivers/r600/r600_query.c
index 9632d18e391..90b7a66d614 100644
--- a/src/gallium/drivers/r600/r600_query.c
+++ b/src/gallium/drivers/r600/r600_query.c
@@ -52,7 +52,7 @@ static struct r600_resource *r600_new_query_buffer(struct r600_context *ctx, uns
switch (type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
case PIPE_QUERY_OCCLUSION_PREDICATE:
- results = ctx->ws->buffer_map(buf->buf, ctx->cs, PIPE_TRANSFER_WRITE);
+ results = ctx->ws->buffer_map(buf->cs_buf, ctx->cs, PIPE_TRANSFER_WRITE);
memset(results, 0, buf_size);
/* Set top bits for unused backends. */
@@ -66,7 +66,7 @@ static struct r600_resource *r600_new_query_buffer(struct r600_context *ctx, uns
}
results += 4 * ctx->max_db;
}
- ctx->ws->buffer_unmap(buf->buf);
+ ctx->ws->buffer_unmap(buf->cs_buf);
break;
case PIPE_QUERY_TIME_ELAPSED:
break;
@@ -74,9 +74,9 @@ static struct r600_resource *r600_new_query_buffer(struct r600_context *ctx, uns
case PIPE_QUERY_PRIMITIVES_GENERATED:
case PIPE_QUERY_SO_STATISTICS:
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
- results = ctx->ws->buffer_map(buf->buf, ctx->cs, PIPE_TRANSFER_WRITE);
+ results = ctx->ws->buffer_map(buf->cs_buf, ctx->cs, PIPE_TRANSFER_WRITE);
memset(results, 0, buf_size);
- ctx->ws->buffer_unmap(buf->buf);
+ ctx->ws->buffer_unmap(buf->cs_buf);
break;
default:
assert(0);
@@ -406,7 +406,7 @@ static boolean r600_get_query_buffer_result(struct r600_context *ctx,
unsigned results_base = 0;
char *map;
- map = ctx->ws->buffer_map(qbuf->buf->buf, ctx->cs,
+ map = ctx->ws->buffer_map(qbuf->buf->cs_buf, ctx->cs,
PIPE_TRANSFER_READ |
(wait ? 0 : PIPE_TRANSFER_DONTBLOCK));
if (!map)
@@ -477,7 +477,7 @@ static boolean r600_get_query_buffer_result(struct r600_context *ctx,
assert(0);
}
- ctx->ws->buffer_unmap(qbuf->buf->buf);
+ ctx->ws->buffer_unmap(qbuf->buf->cs_buf);
return TRUE;
}
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index f00550db6d8..5e22b35ba48 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -71,7 +71,7 @@ static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *s
if (shader->bo == NULL) {
return -ENOMEM;
}
- ptr = (uint32_t*)rctx->ws->buffer_map(shader->bo->buf, rctx->cs, PIPE_TRANSFER_WRITE);
+ ptr = (uint32_t*)rctx->ws->buffer_map(shader->bo->cs_buf, rctx->cs, PIPE_TRANSFER_WRITE);
if (R600_BIG_ENDIAN) {
for (i = 0; i < rshader->bc.ndw; ++i) {
ptr[i] = bswap_32(rshader->bc.bytecode[i]);
@@ -79,7 +79,7 @@ static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *s
} else {
memcpy(ptr, rshader->bc.bytecode, rshader->bc.ndw * sizeof(*ptr));
}
- rctx->ws->buffer_unmap(shader->bo->buf);
+ rctx->ws->buffer_unmap(shader->bo->cs_buf);
}
/* build state */
switch (rshader->processor_type) {
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 75f9cdf89b9..02577ef61a2 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -617,9 +617,9 @@ r600_create_so_target(struct pipe_context *ctx,
t->filled_size = (struct r600_resource*)
pipe_buffer_create(ctx->screen, PIPE_BIND_CUSTOM, PIPE_USAGE_STATIC, 4);
- ptr = rctx->ws->buffer_map(t->filled_size->buf, rctx->cs, PIPE_TRANSFER_WRITE);
+ ptr = rctx->ws->buffer_map(t->filled_size->cs_buf, rctx->cs, PIPE_TRANSFER_WRITE);
memset(ptr, 0, t->filled_size->buf->size);
- rctx->ws->buffer_unmap(t->filled_size->buf);
+ rctx->ws->buffer_unmap(t->filled_size->cs_buf);
return &t->b;
}
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 99cba964a32..4673d86fd02 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -898,20 +898,20 @@ void* r600_texture_transfer_map(struct pipe_context *ctx,
{
struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
- struct pb_buffer *buf;
+ struct radeon_winsys_cs_handle *buf;
enum pipe_format format = transfer->resource->format;
unsigned offset = 0;
char *map;
if (rtransfer->staging) {
- buf = ((struct r600_resource *)rtransfer->staging)->buf;
+ buf = ((struct r600_resource *)rtransfer->staging)->cs_buf;
} else {
struct r600_resource_texture *rtex = (struct r600_resource_texture*)transfer->resource;
if (rtex->flushed_depth_texture)
- buf = ((struct r600_resource *)rtex->flushed_depth_texture)->buf;
+ buf = ((struct r600_resource *)rtex->flushed_depth_texture)->cs_buf;
else
- buf = ((struct r600_resource *)transfer->resource)->buf;
+ buf = ((struct r600_resource *)transfer->resource)->cs_buf;
offset = rtransfer->offset +
transfer->box.y / util_format_get_blockheight(format) * transfer->stride +
@@ -930,17 +930,17 @@ void r600_texture_transfer_unmap(struct pipe_context *ctx,
{
struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
struct r600_context *rctx = (struct r600_context*)ctx;
- struct pb_buffer *buf;
+ struct radeon_winsys_cs_handle *buf;
if (rtransfer->staging) {
- buf = ((struct r600_resource *)rtransfer->staging)->buf;
+ buf = ((struct r600_resource *)rtransfer->staging)->cs_buf;
} else {
struct r600_resource_texture *rtex = (struct r600_resource_texture*)transfer->resource;
if (rtex->flushed_depth_texture) {
- buf = ((struct r600_resource *)rtex->flushed_depth_texture)->buf;
+ buf = ((struct r600_resource *)rtex->flushed_depth_texture)->cs_buf;
} else {
- buf = ((struct r600_resource *)transfer->resource)->buf;
+ buf = ((struct r600_resource *)transfer->resource)->cs_buf;
}
}
rctx->ws->buffer_unmap(buf);