summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
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/r300
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/r300')
-rw-r--r--src/gallium/drivers/r300/r300_query.c4
-rw-r--r--src/gallium/drivers/r300/r300_render.c8
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c10
-rw-r--r--src/gallium/drivers/r300/r300_transfer.c8
4 files changed, 15 insertions, 15 deletions
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
index ac8ef449362..3ea6be7ef57 100644
--- a/src/gallium/drivers/r300/r300_query.c
+++ b/src/gallium/drivers/r300/r300_query.c
@@ -152,7 +152,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
return vresult->b;
}
- map = r300->rws->buffer_map(q->buf, r300->cs,
+ map = r300->rws->buffer_map(q->cs_buf, r300->cs,
PIPE_TRANSFER_READ |
(!wait ? PIPE_TRANSFER_DONTBLOCK : 0));
if (!map)
@@ -166,7 +166,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
map++;
}
- r300->rws->buffer_unmap(q->buf);
+ r300->rws->buffer_unmap(q->cs_buf);
if (q->type == PIPE_QUERY_OCCLUSION_PREDICATE) {
vresult->b = temp != 0;
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 830b0d9d875..99302dc8b0a 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -373,7 +373,7 @@ static void r300_draw_arrays_immediate(struct r300_context *r300,
/* Map the buffer. */
if (!map[vbi]) {
map[vbi] = (uint32_t*)r300->rws->buffer_map(
- r300_resource(vbuf->buffer)->buf,
+ r300_resource(vbuf->buffer)->cs_buf,
r300->cs, PIPE_TRANSFER_READ | PIPE_TRANSFER_UNSYNCHRONIZED);
map[vbi] += (vbuf->buffer_offset / 4) + stride[i] * info->start;
}
@@ -401,7 +401,7 @@ static void r300_draw_arrays_immediate(struct r300_context *r300,
vbi = r300->velems->velem[i].vertex_buffer_index;
if (map[vbi]) {
- r300->rws->buffer_unmap(r300_resource(r300->vertex_buffer[vbi].buffer)->buf);
+ r300->rws->buffer_unmap(r300_resource(r300->vertex_buffer[vbi].buffer)->cs_buf);
map[vbi] = NULL;
}
}
@@ -616,7 +616,7 @@ static void r300_draw_elements(struct r300_context *r300,
if (indexSize == 2 && (start & 1) &&
!indexBuffer->user_ptr) {
/* If we got here, then orgIndexBuffer == indexBuffer. */
- uint16_t *ptr = r300->rws->buffer_map(r300_resource(orgIndexBuffer)->buf,
+ uint16_t *ptr = r300->rws->buffer_map(r300_resource(orgIndexBuffer)->cs_buf,
r300->cs,
PIPE_TRANSFER_READ |
PIPE_TRANSFER_UNSYNCHRONIZED);
@@ -630,7 +630,7 @@ static void r300_draw_elements(struct r300_context *r300,
r300_upload_index_buffer(r300, &indexBuffer, indexSize, &start,
count, (uint8_t*)ptr);
}
- r300->rws->buffer_unmap(r300_resource(orgIndexBuffer)->buf);
+ r300->rws->buffer_unmap(r300_resource(orgIndexBuffer)->cs_buf);
} else {
if (indexBuffer->user_ptr)
r300_upload_index_buffer(r300, &indexBuffer, indexSize,
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index d89ccebbe73..bb2c7c14bd8 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -120,7 +120,7 @@ r300_buffer_transfer_map( struct pipe_context *pipe,
usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
}
- map = rws->buffer_map(rbuf->buf, r300->cs, usage);
+ map = rws->buffer_map(rbuf->cs_buf, r300->cs, usage);
if (map == NULL)
return NULL;
@@ -135,8 +135,8 @@ static void r300_buffer_transfer_unmap( struct pipe_context *pipe,
struct radeon_winsys *rws = r300screen->rws;
struct r300_resource *rbuf = r300_resource(transfer->resource);
- if (rbuf->buf) {
- rws->buffer_unmap(rbuf->buf);
+ if (rbuf->cs_buf) {
+ rws->buffer_unmap(rbuf->cs_buf);
}
}
@@ -160,12 +160,12 @@ static void r300_buffer_transfer_inline_write(struct pipe_context *pipe,
}
assert(rbuf->b.b.user_ptr == NULL);
- map = rws->buffer_map(rbuf->buf, r300->cs,
+ map = rws->buffer_map(rbuf->cs_buf, r300->cs,
PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE | usage);
memcpy(map + box->x, data, box->width);
- rws->buffer_unmap(rbuf->buf);
+ rws->buffer_unmap(rbuf->cs_buf);
}
static const struct u_resource_vtbl r300_buffer_vtbl =
diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c
index 44ff390ca0c..9140bb191cf 100644
--- a/src/gallium/drivers/r300/r300_transfer.c
+++ b/src/gallium/drivers/r300/r300_transfer.c
@@ -235,11 +235,11 @@ void* r300_texture_transfer_map(struct pipe_context *ctx,
if (r300transfer->linear_texture) {
/* The detiled texture is of the same size as the region being mapped
* (no offset needed). */
- return r300->rws->buffer_map(r300transfer->linear_texture->buf,
+ return r300->rws->buffer_map(r300transfer->linear_texture->cs_buf,
r300->cs, transfer->usage);
} else {
/* Tiling is disabled. */
- map = r300->rws->buffer_map(tex->buf, r300->cs, transfer->usage);
+ map = r300->rws->buffer_map(tex->cs_buf, r300->cs, transfer->usage);
if (!map) {
return NULL;
@@ -259,8 +259,8 @@ void r300_texture_transfer_unmap(struct pipe_context *ctx,
struct r300_resource *tex = r300_resource(transfer->resource);
if (r300transfer->linear_texture) {
- rws->buffer_unmap(r300transfer->linear_texture->buf);
+ rws->buffer_unmap(r300transfer->linear_texture->cs_buf);
} else {
- rws->buffer_unmap(tex->buf);
+ rws->buffer_unmap(tex->cs_buf);
}
}