summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c2
-rw-r--r--src/gallium/drivers/r600/r600_texture.c26
-rw-r--r--src/gallium/winsys/r600/drm/r600_bo.c6
-rw-r--r--src/gallium/winsys/r600/drm/r600_drm.c2
-rw-r--r--src/gallium/winsys/r600/drm/r600_hw_context.c6
5 files changed, 9 insertions, 33 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 65b12de79b1..615f0688eb3 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -62,7 +62,7 @@ static struct r600_fence *r600_create_fence(struct r600_pipe_context *ctx)
R600_ERR("r600: failed to create bo for fence objects\n");
return NULL;
}
- ctx->fences.data = r600_bo_map(ctx->radeon, ctx->fences.bo, PB_USAGE_UNSYNCHRONIZED, NULL);
+ ctx->fences.data = r600_bo_map(ctx->radeon, ctx->fences.bo, PIPE_TRANSFER_UNSYNCHRONIZED, NULL);
}
if (!LIST_IS_EMPTY(&ctx->fences.pool)) {
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 10c32c53a6d..e9e8b277243 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -689,7 +689,6 @@ void* r600_texture_transfer_map(struct pipe_context *ctx,
enum pipe_format format = transfer->resource->format;
struct radeon *radeon = (struct radeon *)ctx->screen->winsys;
unsigned offset = 0;
- unsigned usage = 0;
char *map;
if (rtransfer->staging_texture) {
@@ -707,30 +706,7 @@ void* r600_texture_transfer_map(struct pipe_context *ctx,
transfer->box.x / util_format_get_blockwidth(format) * util_format_get_blocksize(format);
}
- if (transfer->usage & PIPE_TRANSFER_WRITE) {
- usage |= PB_USAGE_CPU_WRITE;
-
- if (transfer->usage & PIPE_TRANSFER_DISCARD) {
- }
-
- if (transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT) {
- }
- }
-
- if (transfer->usage & PIPE_TRANSFER_READ) {
- usage |= PB_USAGE_CPU_READ;
- }
-
- if (transfer->usage & PIPE_TRANSFER_DONTBLOCK) {
- usage |= PB_USAGE_DONTBLOCK;
- }
-
- if (transfer->usage & PIPE_TRANSFER_UNSYNCHRONIZED) {
- usage |= PB_USAGE_UNSYNCHRONIZED;
- }
-
- map = r600_bo_map(radeon, bo, usage, ctx);
- if (!map) {
+ if (!(map = r600_bo_map(radeon, bo, transfer->usage, ctx))) {
return NULL;
}
diff --git a/src/gallium/winsys/r600/drm/r600_bo.c b/src/gallium/winsys/r600/drm/r600_bo.c
index 4098a6e1998..0f5b063cf5a 100644
--- a/src/gallium/winsys/r600/drm/r600_bo.c
+++ b/src/gallium/winsys/r600/drm/r600_bo.c
@@ -126,13 +126,13 @@ void *r600_bo_map(struct radeon *radeon, struct r600_bo *bo, unsigned usage, voi
{
struct pipe_context *pctx = ctx;
- if (usage & PB_USAGE_UNSYNCHRONIZED) {
+ if (usage & PIPE_TRANSFER_UNSYNCHRONIZED) {
radeon_bo_map(radeon, bo->bo);
return (uint8_t *) bo->bo->data + bo->offset;
}
if (p_atomic_read(&bo->bo->reference.count) > 1) {
- if (usage & PB_USAGE_DONTBLOCK) {
+ if (usage & PIPE_TRANSFER_DONTBLOCK) {
return NULL;
}
if (ctx) {
@@ -140,7 +140,7 @@ void *r600_bo_map(struct radeon *radeon, struct r600_bo *bo, unsigned usage, voi
}
}
- if (usage & PB_USAGE_DONTBLOCK) {
+ if (usage & PIPE_TRANSFER_DONTBLOCK) {
uint32_t domain;
if (radeon_bo_busy(radeon, bo->bo, &domain))
diff --git a/src/gallium/winsys/r600/drm/r600_drm.c b/src/gallium/winsys/r600/drm/r600_drm.c
index b5a4d928bf5..ab0afea5bf5 100644
--- a/src/gallium/winsys/r600/drm/r600_drm.c
+++ b/src/gallium/winsys/r600/drm/r600_drm.c
@@ -249,7 +249,7 @@ static int radeon_init_fence(struct radeon *radeon)
if (radeon->fence_bo == NULL) {
return -ENOMEM;
}
- radeon->cfence = r600_bo_map(radeon, radeon->fence_bo, PB_USAGE_UNSYNCHRONIZED, NULL);
+ radeon->cfence = r600_bo_map(radeon, radeon->fence_bo, PIPE_TRANSFER_UNSYNCHRONIZED, NULL);
*radeon->cfence = 0;
return 0;
}
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c
index 365ab1533e1..55f1d4cf07e 100644
--- a/src/gallium/winsys/r600/drm/r600_hw_context.c
+++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
@@ -1704,9 +1704,9 @@ static boolean r600_query_result(struct r600_context *ctx, struct r600_query *qu
u32 *results, *current_result;
if (wait)
- results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_CPU_READ, NULL);
+ results = r600_bo_map(ctx->radeon, query->buffer, PIPE_TRANSFER_READ, NULL);
else
- results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_DONTBLOCK | PB_USAGE_CPU_READ, NULL);
+ results = r600_bo_map(ctx->radeon, query->buffer, PIPE_TRANSFER_DONTBLOCK | PIPE_TRANSFER_READ, NULL);
if (!results)
return FALSE;
@@ -1777,7 +1777,7 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query)
u32 *results;
int i;
- results = r600_bo_map(ctx->radeon, query->buffer, PB_USAGE_CPU_WRITE, NULL);
+ results = r600_bo_map(ctx->radeon, query->buffer, PIPE_TRANSFER_WRITE, NULL);
if (results) {
results = (u32*)((char*)results + query->results_end);
memset(results, 0, query->result_size);