From 6ccab620a0e7364ab6c0d902b3ddf58ee988f7fa Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 23 Dec 2010 19:40:54 +1000 Subject: 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. --- src/gallium/drivers/r300/r300_transfer.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/gallium/drivers/r300/r300_transfer.c') diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c index f2b6b45ef1..b557212887 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); } } -- cgit v1.2.3