diff options
author | Nicolai Hähnle <[email protected]> | 2017-03-24 23:30:55 +0100 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2017-04-05 10:37:19 +0200 |
commit | aee473eb01abac74d1c10330005ab1378f017ce9 (patch) | |
tree | d1396103d1ec6d964956752a3af83417d15670c0 /src/gallium/drivers/radeonsi/cik_sdma.c | |
parent | 0a685ce9a7862752ea523fa74310901171da0c47 (diff) |
radeonsi: disable SDMA clears and copies for sparse buffers
VM faults cannot be disabled for SDMA on <= VI.
We could still use SDMA by asking the winsys about which parts of the
buffers are committed. This is left as a potential future improvement.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/cik_sdma.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/cik_sdma.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/cik_sdma.c b/src/gallium/drivers/radeonsi/cik_sdma.c index 38833666a8d..99285a6de17 100644 --- a/src/gallium/drivers/radeonsi/cik_sdma.c +++ b/src/gallium/drivers/radeonsi/cik_sdma.c @@ -80,7 +80,8 @@ static void cik_sdma_clear_buffer(struct pipe_context *ctx, unsigned i, ncopy, csize; struct r600_resource *rdst = r600_resource(dst); - if (!cs || offset % 4 != 0 || size % 4 != 0) { + if (!cs || offset % 4 != 0 || size % 4 != 0 || + dst->flags & PIPE_RESOURCE_FLAG_SPARSE) { ctx->clear_buffer(ctx, dst, offset, size, &clear_value, 4); return; } @@ -526,7 +527,9 @@ static void cik_sdma_copy(struct pipe_context *ctx, { struct si_context *sctx = (struct si_context *)ctx; - if (!sctx->b.dma.cs) + if (!sctx->b.dma.cs || + src->flags & PIPE_RESOURCE_FLAG_SPARSE || + dst->flags & PIPE_RESOURCE_FLAG_SPARSE) goto fallback; if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) { |