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);
}
}
}
-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;
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);
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;
/* 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)
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,
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);
}
{ "no2d", DBG_NO_2D_TILING, "Disable 2D tiling" },
{ "notiling", DBG_NO_TILING, "Disable tiling" },
{ "switch_on_eop", DBG_SWITCH_ON_EOP, "Program WD/IA to switch on end-of-packet." },
+ { "forcedma", DBG_FORCE_DMA, "Use asynchronous DMA for all operations when possible." },
DEBUG_NAMED_VALUE_END /* must be last */
};
#define DBG_NO_2D_TILING (1 << 13)
#define DBG_NO_TILING (1 << 14)
#define DBG_SWITCH_ON_EOP (1 << 15)
-/* The maximum allowed bit is 15. */
+#define DBG_FORCE_DMA (1 << 16)
+/* The maximum allowed bit is 20. */
#define R600_MAP_BUFFER_ALIGNMENT 64
#include "si_pipe.h"
#include "util/u_format.h"
+#include "util/u_surface.h"
enum si_blitter_op /* bitmask */
{
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;
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);
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);
}
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;
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,