summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-09-06 17:07:50 +0200
committerMarek Olšák <[email protected]>2014-09-12 22:51:28 +0200
commitd13d2fd16132f351ec7c8184f165faeac3b31bb4 (patch)
treede44ad691c0f1dc89ceabe4e48e5e1b1bc3e7dd1 /src/gallium/drivers/r600
parentd7ec3db3499b11bf6f213ad6b0c050b65be3ad30 (diff)
r600g,radeonsi: add debug option which forces DMA for copy_region and blit
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r--src/gallium/drivers/r600/evergreen_state.c2
-rw-r--r--src/gallium/drivers/r600/r600_blit.c18
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c3
-rw-r--r--src/gallium/drivers/r600/r600_pipe.h11
-rw-r--r--src/gallium/drivers/r600/r600_state.c2
5 files changed, 25 insertions, 11 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index e7faeaf4a0b..27a9ad9e396 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -3365,7 +3365,7 @@ static void evergreen_dma_copy(struct pipe_context *ctx,
return;
fallback:
- ctx->resource_copy_region(ctx, dst, dst_level, dstx, dsty, dstz,
+ r600_resource_copy_region(ctx, dst, dst_level, dstx, dsty, dstz,
src, src_level, src_box);
}
diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index f766e37f2b2..1e18d87e6ff 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -565,13 +565,13 @@ static void r600_clear_buffer(struct pipe_context *ctx, struct pipe_resource *ds
}
}
-static void r600_resource_copy_region(struct pipe_context *ctx,
- struct pipe_resource *dst,
- unsigned dst_level,
- unsigned dstx, unsigned dsty, unsigned dstz,
- struct pipe_resource *src,
- unsigned src_level,
- const struct pipe_box *src_box)
+void r600_resource_copy_region(struct pipe_context *ctx,
+ struct pipe_resource *dst,
+ unsigned dst_level,
+ unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src,
+ unsigned src_level,
+ const struct pipe_box *src_box)
{
struct r600_context *rctx = (struct r600_context *)ctx;
struct pipe_surface *dst_view, dst_templ;
@@ -815,6 +815,10 @@ static void r600_blit(struct pipe_context *ctx,
return; /* error */
}
+ if (rctx->screen->b.debug_flags & DBG_FORCE_DMA &&
+ util_try_blit_via_copy_region(ctx, info))
+ return;
+
r600_blitter_begin(ctx, R600_BLIT |
(info->render_condition_enable ? 0 : R600_DISABLE_RENDER_COND));
util_blitter_blit(rctx->blitter, info);
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 73c6e3543af..c6459d81209 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -191,6 +191,9 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
if (!rctx->isa || r600_isa_init(rctx, rctx->isa))
goto fail;
+ if (rscreen->b.debug_flags & DBG_FORCE_DMA)
+ rctx->b.b.resource_copy_region = rctx->b.dma_copy;
+
rctx->blitter = util_blitter_create(&rctx->b.b);
if (rctx->blitter == NULL)
goto fail;
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 8907d41a377..2df168f01b5 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -195,8 +195,8 @@ struct r600_gs_rings_state {
/* This must start from 16. */
/* features */
-#define DBG_LLVM (1 << 17)
-#define DBG_NO_CP_DMA (1 << 18)
+#define DBG_LLVM (1 << 29)
+#define DBG_NO_CP_DMA (1 << 30)
/* shader backend */
#define DBG_NO_SB (1 << 21)
#define DBG_SB_CS (1 << 22)
@@ -551,6 +551,13 @@ void r600_decompress_depth_textures(struct r600_context *rctx,
struct r600_samplerview_state *textures);
void r600_decompress_color_textures(struct r600_context *rctx,
struct r600_samplerview_state *textures);
+void r600_resource_copy_region(struct pipe_context *ctx,
+ struct pipe_resource *dst,
+ unsigned dst_level,
+ unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src,
+ unsigned src_level,
+ const struct pipe_box *src_box);
/* r600_shader.c */
int r600_pipe_shader_create(struct pipe_context *ctx,
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 36f77503141..9ca61718aba 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -2966,7 +2966,7 @@ static void r600_dma_copy(struct pipe_context *ctx,
return;
fallback:
- ctx->resource_copy_region(ctx, dst, dst_level, dstx, dsty, dstz,
+ r600_resource_copy_region(ctx, dst, dst_level, dstx, dsty, dstz,
src, src_level, src_box);
}