summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-09-22 02:55:47 +0200
committerMarek Olšák <[email protected]>2013-09-29 15:18:09 +0200
commit2814202ef4d6a429602c3524c2a1001e34d2068f (patch)
tree766e4b6d8ed65e0dc15a069dd775b13d160ed49b /src/gallium/drivers/radeonsi
parente9162672850548310bd29fa6f0f924e4e8767af1 (diff)
r600g,radeonsi: share the async dma interface
r600_texture.c is one step closer to r600g.
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/r600_texture.c20
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c13
2 files changed, 28 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/r600_texture.c b/src/gallium/drivers/radeonsi/r600_texture.c
index 9a2f7101850..69ca892b5f8 100644
--- a/src/gallium/drivers/radeonsi/r600_texture.c
+++ b/src/gallium/drivers/radeonsi/r600_texture.c
@@ -73,6 +73,7 @@ static void r600_copy_region_with_blit(struct pipe_context *pipe,
/* Copy from a full GPU texture to a transfer's staging one. */
static void r600_copy_to_staging_texture(struct pipe_context *ctx, struct r600_transfer *rtransfer)
{
+ struct r600_context *rctx = (struct r600_context*)ctx;
struct pipe_transfer *transfer = (struct pipe_transfer*)rtransfer;
struct pipe_resource *dst = &rtransfer->staging->b.b;
struct pipe_resource *src = transfer->resource;
@@ -83,13 +84,18 @@ static void r600_copy_to_staging_texture(struct pipe_context *ctx, struct r600_t
return;
}
- ctx->resource_copy_region(ctx, dst, 0, 0, 0, 0,
- src, transfer->level, &transfer->box);
+ if (!rctx->b.dma_copy(ctx, dst, 0, 0, 0, 0,
+ src, transfer->level,
+ &transfer->box)) {
+ ctx->resource_copy_region(ctx, dst, 0, 0, 0, 0,
+ src, transfer->level, &transfer->box);
+ }
}
/* Copy from a transfer's staging texture to a full GPU one. */
static void r600_copy_from_staging_texture(struct pipe_context *ctx, struct r600_transfer *rtransfer)
{
+ struct r600_context *rctx = (struct r600_context*)ctx;
struct pipe_transfer *transfer = (struct pipe_transfer*)rtransfer;
struct pipe_resource *dst = transfer->resource;
struct pipe_resource *src = &rtransfer->staging->b.b;
@@ -104,9 +110,13 @@ static void r600_copy_from_staging_texture(struct pipe_context *ctx, struct r600
return;
}
- ctx->resource_copy_region(ctx, dst, transfer->level,
- transfer->box.x, transfer->box.y, transfer->box.z,
- src, 0, &sbox);
+ if (!rctx->b.dma_copy(ctx, dst, transfer->level,
+ transfer->box.x, transfer->box.y, transfer->box.z,
+ src, 0, &sbox)) {
+ ctx->resource_copy_region(ctx, dst, transfer->level,
+ transfer->box.x, transfer->box.y, transfer->box.z,
+ src, 0, &sbox);
+ }
}
static unsigned r600_texture_get_offset(struct r600_texture *rtex, unsigned level,
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 400d947376d..5f60045f77d 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2955,6 +2955,18 @@ static void r600_surface_destroy(struct pipe_context *pipe,
FREE(surface);
}
+static boolean si_dma_copy(struct pipe_context *ctx,
+ struct pipe_resource *dst,
+ unsigned dst_level,
+ unsigned dst_x, unsigned dst_y, unsigned dst_z,
+ struct pipe_resource *src,
+ unsigned src_level,
+ const struct pipe_box *src_box)
+{
+ /* XXX implement this or share evergreen_dma_blit with r600g */
+ return FALSE;
+}
+
void si_init_state_functions(struct r600_context *rctx)
{
int i;
@@ -3018,6 +3030,7 @@ void si_init_state_functions(struct r600_context *rctx)
rctx->b.b.set_polygon_stipple = si_set_polygon_stipple;
rctx->b.b.create_surface = r600_create_surface;
rctx->b.b.surface_destroy = r600_surface_destroy;
+ rctx->b.dma_copy = si_dma_copy;
rctx->b.b.draw_vbo = si_draw_vbo;
}