radeonsi: check IB memory usage of CP DMA operations
authorMarek Olšák <marek.olsak@amd.com>
Fri, 29 Jul 2016 14:20:19 +0000 (16:20 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 6 Aug 2016 11:56:14 +0000 (13:56 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_cp_dma.c

index 882458c7b6948ff06689b1dd69abd462d42b4207..7d4edc046cd220860cc8e23ceec83ef08f87e9d7 100644 (file)
@@ -150,6 +150,11 @@ static void si_cp_dma_prepare(struct si_context *sctx, struct pipe_resource *dst
                              struct pipe_resource *src, unsigned byte_count,
                              uint64_t remaining_size, unsigned *flags)
 {
+       /* Count memory usage in so that need_cs_space can take it into account. */
+       r600_context_add_resource_size(&sctx->b.b, dst);
+       if (src)
+               r600_context_add_resource_size(&sctx->b.b, src);
+
        si_need_cs_space(sctx);
 
        /* This must be done after need_cs_space. */