summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_blit.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-12-22 19:33:47 +0100
committerMarek Olšák <[email protected]>2013-01-08 21:58:28 +0100
commita70e5e2b94194da3f4102a9f8e3c8ed5ca6dd8b8 (patch)
tree11dd8c9457d5e2d4051a7cab38b1cf94b3e8d3d0 /src/gallium/drivers/r600/r600_blit.c
parent2d3d0d3a5ae3829260f914462f4e63b2ff4aadbc (diff)
r600g: implement buffer copying using CP DMA for R7xx, Evergreen, Cayman
R6xx doesn't work - the issue seems to be with flushing (sometimes the destination buffer contains garbage). There are no hangs, so we're good. R7xx doesn't seem to have any alignment restriction despite our initial thinking. Everything just works. Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_blit.c')
-rw-r--r--src/gallium/drivers/r600/r600_blit.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index b348aa728b0..c4ce7f7652b 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -503,15 +503,18 @@ static void r600_clear_depth_stencil(struct pipe_context *ctx,
r600_blitter_end(ctx);
}
-void r600_copy_buffer(struct pipe_context *ctx, struct
- pipe_resource *dst, unsigned dstx,
+void r600_copy_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsigned dstx,
struct pipe_resource *src, const struct pipe_box *src_box)
{
struct r600_context *rctx = (struct r600_context*)ctx;
- if (rctx->screen->has_streamout &&
- /* Require dword alignment. */
- dstx % 4 == 0 && src_box->x % 4 == 0 && src_box->width % 4 == 0) {
+ /* CP DMA doesn't work on R600 (flushing seems to be unreliable). */
+ if (rctx->screen->info.drm_minor >= 27 && rctx->chip_class >= R700) {
+ r600_cp_dma_copy_buffer(rctx, dst, dstx, src, src_box->x, src_box->width);
+ }
+ else if (rctx->screen->has_streamout &&
+ /* Require 4-byte alignment. */
+ dstx % 4 == 0 && src_box->x % 4 == 0 && src_box->width % 4 == 0) {
r600_blitter_begin(ctx, R600_COPY_BUFFER);
util_blitter_copy_buffer(rctx->blitter, dst, dstx, src, src_box->x, src_box->width);
r600_blitter_end(ctx);