summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_context.h4
-rw-r--r--src/gallium/drivers/r300/r300_cs.h4
-rw-r--r--src/gallium/drivers/r300/r300_emit.c22
-rw-r--r--src/gallium/drivers/r300/r300_query.c4
-rw-r--r--src/gallium/drivers/r300/r300_render.c9
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c9
-rw-r--r--src/gallium/drivers/r300/r300_texture.c4
-rw-r--r--src/gallium/drivers/r300/r300_transfer.c6
8 files changed, 24 insertions, 38 deletions
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index f298d88004b..5c443d144ba 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -295,7 +295,6 @@ struct r300_query {
/* The buffer where query results are stored. */
struct pb_buffer *buf;
- struct radeon_winsys_cs_handle *cs_buf;
};
struct r300_surface {
@@ -303,7 +302,6 @@ struct r300_surface {
/* Winsys buffer backing the texture. */
struct pb_buffer *buf;
- struct radeon_winsys_cs_handle *cs_buf;
enum radeon_bo_domain domain;
@@ -395,7 +393,6 @@ struct r300_resource
/* Winsys buffer backing this resource. */
struct pb_buffer *buf;
- struct radeon_winsys_cs_handle *cs_buf;
enum radeon_bo_domain domain;
/* Constant buffers and SWTCL vertex and index buffers are in user
@@ -460,7 +457,6 @@ struct r300_context {
struct draw_context* draw;
/* Vertex buffer for SW TCL. */
struct pb_buffer *vbo;
- struct radeon_winsys_cs_handle *vbo_cs;
/* Offset and size into the SW TCL VBO. */
size_t draw_vbo_offset;
diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h
index a2d042ca48e..7ae83a8920b 100644
--- a/src/gallium/drivers/r300/r300_cs.h
+++ b/src/gallium/drivers/r300/r300_cs.h
@@ -108,9 +108,9 @@
#define OUT_CS_RELOC(r) do { \
assert((r)); \
- assert((r)->cs_buf); \
+ assert((r)->buf); \
OUT_CS(0xc0001000); /* PKT3_NOP */ \
- OUT_CS(cs_winsys->cs_lookup_buffer(cs_copy, (r)->cs_buf) * 4); \
+ OUT_CS(cs_winsys->cs_lookup_buffer(cs_copy, (r)->buf) * 4); \
} while (0)
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 7610c3ddf5b..9eb9c1755c2 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -1047,9 +1047,9 @@ void r300_emit_vertex_arrays_swtcl(struct r300_context *r300, boolean indexed)
OUT_CS(r300->draw_vbo_offset);
OUT_CS(0);
- assert(r300->vbo_cs);
+ assert(r300->vbo);
OUT_CS(0xc0001000); /* PKT3_NOP */
- OUT_CS(r300->rws->cs_lookup_buffer(r300->cs, r300->vbo_cs) * 4);
+ OUT_CS(r300->rws->cs_lookup_buffer(r300->cs, r300->vbo) * 4);
END_CS;
}
@@ -1320,7 +1320,7 @@ validate:
continue;
tex = r300_resource(fb->cbufs[i]->texture);
assert(tex && tex->buf && "cbuf is marked, but NULL!");
- r300->rws->cs_add_buffer(r300->cs, tex->cs_buf,
+ r300->rws->cs_add_buffer(r300->cs, tex->buf,
RADEON_USAGE_READWRITE,
r300_surface(fb->cbufs[i])->domain,
tex->b.b.nr_samples > 1 ?
@@ -1331,7 +1331,7 @@ validate:
if (fb->zsbuf) {
tex = r300_resource(fb->zsbuf->texture);
assert(tex && tex->buf && "zsbuf is marked, but NULL!");
- r300->rws->cs_add_buffer(r300->cs, tex->cs_buf,
+ r300->rws->cs_add_buffer(r300->cs, tex->buf,
RADEON_USAGE_READWRITE,
r300_surface(fb->zsbuf)->domain,
tex->b.b.nr_samples > 1 ?
@@ -1342,7 +1342,7 @@ validate:
/* The AA resolve buffer. */
if (r300->aa_state.dirty) {
if (aa->dest) {
- r300->rws->cs_add_buffer(r300->cs, aa->dest->cs_buf,
+ r300->rws->cs_add_buffer(r300->cs, aa->dest->buf,
RADEON_USAGE_WRITE,
aa->dest->domain,
RADEON_PRIO_COLOR_BUFFER);
@@ -1356,18 +1356,18 @@ validate:
}
tex = r300_resource(texstate->sampler_views[i]->base.texture);
- r300->rws->cs_add_buffer(r300->cs, tex->cs_buf, RADEON_USAGE_READ,
+ r300->rws->cs_add_buffer(r300->cs, tex->buf, RADEON_USAGE_READ,
tex->domain, RADEON_PRIO_SAMPLER_TEXTURE);
}
}
/* ...occlusion query buffer... */
if (r300->query_current)
- r300->rws->cs_add_buffer(r300->cs, r300->query_current->cs_buf,
+ r300->rws->cs_add_buffer(r300->cs, r300->query_current->buf,
RADEON_USAGE_WRITE, RADEON_DOMAIN_GTT,
RADEON_PRIO_QUERY);
/* ...vertex buffer for SWTCL path... */
- if (r300->vbo_cs)
- r300->rws->cs_add_buffer(r300->cs, r300->vbo_cs,
+ if (r300->vbo)
+ r300->rws->cs_add_buffer(r300->cs, r300->vbo,
RADEON_USAGE_READ, RADEON_DOMAIN_GTT,
RADEON_PRIO_VERTEX_BUFFER);
/* ...vertex buffers for HWTCL path... */
@@ -1382,7 +1382,7 @@ validate:
if (!buf)
continue;
- r300->rws->cs_add_buffer(r300->cs, r300_resource(buf)->cs_buf,
+ r300->rws->cs_add_buffer(r300->cs, r300_resource(buf)->buf,
RADEON_USAGE_READ,
r300_resource(buf)->domain,
RADEON_PRIO_SAMPLER_BUFFER);
@@ -1390,7 +1390,7 @@ validate:
}
/* ...and index buffer for HWTCL path. */
if (index_buffer)
- r300->rws->cs_add_buffer(r300->cs, r300_resource(index_buffer)->cs_buf,
+ r300->rws->cs_add_buffer(r300->cs, r300_resource(index_buffer)->buf,
RADEON_USAGE_READ,
r300_resource(index_buffer)->domain,
RADEON_PRIO_INDEX_BUFFER);
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
index 4dd8156f616..6414e80828e 100644
--- a/src/gallium/drivers/r300/r300_query.c
+++ b/src/gallium/drivers/r300/r300_query.c
@@ -64,8 +64,6 @@ static struct pipe_query *r300_create_query(struct pipe_context *pipe,
FREE(q);
return NULL;
}
- q->cs_buf = r300->rws->buffer_get_cs_handle(q->buf);
-
return (struct pipe_query*)q;
}
@@ -155,7 +153,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
return vresult->b;
}
- map = r300->rws->buffer_map(q->cs_buf, r300->cs,
+ map = r300->rws->buffer_map(q->buf, r300->cs,
PIPE_TRANSFER_READ |
(!wait ? PIPE_TRANSFER_DONTBLOCK : 0));
if (!map)
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 0487b11e775..b482fa140ed 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)->cs_buf,
+ r300_resource(vbuf->buffer)->buf,
r300->cs, PIPE_TRANSFER_READ | PIPE_TRANSFER_UNSYNCHRONIZED);
map[vbi] += (vbuf->buffer_offset / 4) + stride[i] * info->start;
}
@@ -606,7 +606,7 @@ static void r300_draw_elements(struct r300_context *r300,
/* Fallback for misaligned ushort indices. */
if (indexSize == 2 && (start & 1) && indexBuffer) {
/* If we got here, then orgIndexBuffer == indexBuffer. */
- uint16_t *ptr = r300->rws->buffer_map(r300_resource(orgIndexBuffer)->cs_buf,
+ uint16_t *ptr = r300->rws->buffer_map(r300_resource(orgIndexBuffer)->buf,
r300->cs,
PIPE_TRANSFER_READ |
PIPE_TRANSFER_UNSYNCHRONIZED);
@@ -899,7 +899,7 @@ static boolean r300_render_allocate_vertices(struct vbuf_render* render,
if (!r300->vbo || size + r300->draw_vbo_offset > r300->vbo->size) {
pb_reference(&r300->vbo, NULL);
- r300->vbo_cs = NULL;
+ r300->vbo = NULL;
r300render->vbo_ptr = NULL;
r300->vbo = rws->buffer_create(rws,
@@ -909,9 +909,8 @@ static boolean r300_render_allocate_vertices(struct vbuf_render* render,
if (!r300->vbo) {
return FALSE;
}
- r300->vbo_cs = rws->buffer_get_cs_handle(r300->vbo);
r300->draw_vbo_offset = 0;
- r300render->vbo_ptr = rws->buffer_map(r300->vbo_cs, r300->cs,
+ r300render->vbo_ptr = rws->buffer_map(r300->vbo, r300->cs,
PIPE_TRANSFER_WRITE);
}
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index e9395738d52..737a6f5e4f8 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -95,7 +95,7 @@ r300_buffer_transfer_map( struct pipe_context *context,
assert(usage & PIPE_TRANSFER_WRITE);
/* Check if mapping this buffer would cause waiting for the GPU. */
- if (r300->rws->cs_is_buffer_referenced(r300->cs, rbuf->cs_buf, RADEON_USAGE_READWRITE) ||
+ if (r300->rws->cs_is_buffer_referenced(r300->cs, rbuf->buf, RADEON_USAGE_READWRITE) ||
!r300->rws->buffer_wait(rbuf->buf, 0, RADEON_USAGE_READWRITE)) {
unsigned i;
struct pb_buffer *new_buf;
@@ -108,7 +108,6 @@ r300_buffer_transfer_map( struct pipe_context *context,
/* Discard the old buffer. */
pb_reference(&rbuf->buf, NULL);
rbuf->buf = new_buf;
- rbuf->cs_buf = r300->rws->buffer_get_cs_handle(rbuf->buf);
/* We changed the buffer, now we need to bind it where the old one was bound. */
for (i = 0; i < r300->nr_vertex_buffers; i++) {
@@ -127,7 +126,7 @@ r300_buffer_transfer_map( struct pipe_context *context,
usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
}
- map = rws->buffer_map(rbuf->cs_buf, r300->cs, usage);
+ map = rws->buffer_map(rbuf->buf, r300->cs, usage);
if (!map) {
util_slab_free(&r300->pool_transfers, transfer);
@@ -190,9 +189,5 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
FREE(rbuf);
return NULL;
}
-
- rbuf->cs_buf =
- r300screen->rws->buffer_get_cs_handle(rbuf->buf);
-
return &rbuf->b.b;
}
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 5e4d50df27d..e90e741a353 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -1059,8 +1059,6 @@ r300_texture_create_object(struct r300_screen *rscreen,
util_format_is_depth_or_stencil(base->format) ? "depth" : "color");
}
- tex->cs_buf = rws->buffer_get_cs_handle(tex->buf);
-
rws->buffer_set_tiling(tex->buf, NULL,
tex->tex.microtile, tex->tex.macrotile[0],
0, 0, 0, 0, 0, 0, 0,
@@ -1169,7 +1167,7 @@ struct pipe_surface* r300_create_surface_custom(struct pipe_context * ctx,
surface->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer;
surface->buf = tex->buf;
- surface->cs_buf = tex->cs_buf;
+ surface->buf = tex->buf;
/* Prefer VRAM if there are multiple domains to choose from. */
surface->domain = tex->domain;
diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c
index 44303792f51..842e70a6899 100644
--- a/src/gallium/drivers/r300/r300_transfer.c
+++ b/src/gallium/drivers/r300/r300_transfer.c
@@ -115,7 +115,7 @@ r300_texture_transfer_map(struct pipe_context *ctx,
char *map;
referenced_cs =
- r300->rws->cs_is_buffer_referenced(r300->cs, tex->cs_buf, RADEON_USAGE_READWRITE);
+ r300->rws->cs_is_buffer_referenced(r300->cs, tex->buf, RADEON_USAGE_READWRITE);
if (referenced_cs) {
referenced_hw = TRUE;
} else {
@@ -218,7 +218,7 @@ r300_texture_transfer_map(struct pipe_context *ctx,
if (trans->linear_texture) {
/* The detiled texture is of the same size as the region being mapped
* (no offset needed). */
- map = r300->rws->buffer_map(trans->linear_texture->cs_buf,
+ map = r300->rws->buffer_map(trans->linear_texture->buf,
r300->cs, usage);
if (!map) {
pipe_resource_reference(
@@ -230,7 +230,7 @@ r300_texture_transfer_map(struct pipe_context *ctx,
return map;
} else {
/* Tiling is disabled. */
- map = r300->rws->buffer_map(tex->cs_buf, r300->cs, usage);
+ map = r300->rws->buffer_map(tex->buf, r300->cs, usage);
if (!map) {
FREE(trans);
return NULL;