diff options
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_blit.c | 19 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_dma.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 7 |
4 files changed, 24 insertions, 9 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 96d27ec062f..9f95a8a08a7 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -23,6 +23,7 @@ #include "si_pipe.h" #include "util/u_format.h" +#include "util/u_surface.h" enum si_blitter_op /* bitmask */ { @@ -531,13 +532,13 @@ static void si_reset_blittable_to_orig(struct pipe_resource *tex, rtex->mipmap_shift = 0; } -static void si_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 si_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 si_context *sctx = (struct si_context *)ctx; struct r600_texture *rdst = (struct r600_texture*)dst; @@ -770,6 +771,10 @@ static void si_blit(struct pipe_context *ctx, info->src.box.z, info->src.box.z + info->src.box.depth - 1); + if (sctx->screen->b.debug_flags & DBG_FORCE_DMA && + util_try_blit_via_copy_region(ctx, info)) + return; + si_blitter_begin(ctx, SI_BLIT | (info->render_condition_enable ? 0 : SI_DISABLE_RENDER_COND)); util_blitter_blit(sctx->blitter, info); diff --git a/src/gallium/drivers/radeonsi/si_dma.c b/src/gallium/drivers/radeonsi/si_dma.c index c02b01eca6d..c067cd9c124 100644 --- a/src/gallium/drivers/radeonsi/si_dma.c +++ b/src/gallium/drivers/radeonsi/si_dma.c @@ -310,6 +310,6 @@ void si_dma_copy(struct pipe_context *ctx, return; fallback: - ctx->resource_copy_region(ctx, dst, dst_level, dstx, dsty, dstz, - src, src_level, src_box); + si_resource_copy_region(ctx, dst, dst_level, dstx, dsty, dstz, + src, src_level, src_box); } diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 5762ca7702f..4f9c8768152 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -118,6 +118,9 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, void * goto fail; } + if (sscreen->b.debug_flags & DBG_FORCE_DMA) + sctx->b.b.resource_copy_region = sctx->b.dma_copy; + sctx->blitter = util_blitter_create(&sctx->b.b); if (sctx->blitter == NULL) goto fail; diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 55643d6eb7d..6ec8d5dba9d 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -174,6 +174,13 @@ void si_flush_depth_textures(struct si_context *sctx, struct si_textures_info *textures); void si_decompress_color_textures(struct si_context *sctx, struct si_textures_info *textures); +void si_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); /* si_dma.c */ void si_dma_copy(struct pipe_context *ctx, |