radeonsi: don't count fast clears and prefetches into CP DMA stats
authorMarek Olšák <marek.olsak@amd.com>
Sun, 25 Dec 2016 17:34:16 +0000 (18:34 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 6 Jan 2017 20:05:48 +0000 (21:05 +0100)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_cp_dma.c

index 596e32c..1996e66 100644 (file)
@@ -234,7 +234,9 @@ static void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst,
        if (tc_l2_flag)
                rdst->TC_L2_dirty = true;
 
-       sctx->b.num_cp_dma_calls++;
+       /* If it's not a framebuffer fast clear... */
+       if (coher == R600_COHERENCY_SHADER)
+               sctx->b.num_cp_dma_calls++;
 }
 
 /**
@@ -360,7 +362,9 @@ void si_copy_buffer(struct si_context *sctx,
        if (tc_l2_flag)
                r600_resource(dst)->TC_L2_dirty = true;
 
-       sctx->b.num_cp_dma_calls++;
+       /* If it's not a prefetch... */
+       if (dst_offset != src_offset)
+               sctx->b.num_cp_dma_calls++;
 }
 
 void si_init_cp_dma_functions(struct si_context *sctx)