summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_transfer.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-12-23 19:40:54 +1000
committerMarek Olšák <maraeo@gmail.com>2011-02-11 01:07:25 +0100
commit6ccab620a0e7364ab6c0d902b3ddf58ee988f7fa (patch)
tree6228427e261efd6187915ab651b78f99d3ff7dd1 /src/gallium/drivers/r300/r300_transfer.c
parentc0beaf6e6d5764531a4cb21d0d0a9a1fd09affee (diff)
downloadexternal_mesa3d-6ccab620a0e7364ab6c0d902b3ddf58ee988f7fa.zip
external_mesa3d-6ccab620a0e7364ab6c0d902b3ddf58ee988f7fa.tar.gz
external_mesa3d-6ccab620a0e7364ab6c0d902b3ddf58ee988f7fa.tar.bz2
r300g: import the last bits of libdrm and cleanup the whole thing
Based on Dave's branch. The majority of this commit is a cleanup, mainly renaming things. There wasn't much code to import, just ioctl calls. Also done: - implemented unsynchronized bo_map (important optimization!) - radeon_bo_is_referenced_by_cs is no longer a refcount hack - dropped the libdrm_radeon dependency I'm surprised that this has resulted in less code in the end.
Diffstat (limited to 'src/gallium/drivers/r300/r300_transfer.c')
-rw-r--r--src/gallium/drivers/r300/r300_transfer.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c
index f2b6b45..b557212 100644
--- a/src/gallium/drivers/r300/r300_transfer.c
+++ b/src/gallium/drivers/r300/r300_transfer.c
@@ -89,14 +89,12 @@ r300_texture_get_transfer(struct pipe_context *ctx,
boolean referenced_cs, referenced_hw, blittable;
referenced_cs =
- r300->rws->cs_is_buffer_referenced(r300->cs,
- tex->cs_buf, R300_REF_CS);
+ r300->rws->cs_is_buffer_referenced(r300->cs, tex->cs_buf);
if (referenced_cs) {
referenced_hw = TRUE;
} else {
referenced_hw =
- r300->rws->cs_is_buffer_referenced(r300->cs,
- tex->cs_buf, R300_REF_HW);
+ r300->rws->buffer_is_busy(tex->buf);
}
blittable = ctx->screen->is_format_supported(
@@ -239,13 +237,12 @@ 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 rws->buffer_map(rws,
- r300transfer->linear_texture->buf,
+ return rws->buffer_map(r300transfer->linear_texture->buf,
r300->cs,
transfer->usage);
} else {
/* Tiling is disabled. */
- map = rws->buffer_map(rws, tex->buf, r300->cs,
+ map = rws->buffer_map(tex->buf, r300->cs,
transfer->usage);
if (!map) {
@@ -266,8 +263,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(rws, r300transfer->linear_texture->buf);
+ rws->buffer_unmap(r300transfer->linear_texture->buf);
} else {
- rws->buffer_unmap(rws, tex->buf);
+ rws->buffer_unmap(tex->buf);
}
}