summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_dma.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-03-24 23:30:55 +0100
committerNicolai Hähnle <[email protected]>2017-04-05 10:37:19 +0200
commitaee473eb01abac74d1c10330005ab1378f017ce9 (patch)
treed1396103d1ec6d964956752a3af83417d15670c0 /src/gallium/drivers/radeonsi/si_dma.c
parent0a685ce9a7862752ea523fa74310901171da0c47 (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/si_dma.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_dma.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_dma.c b/src/gallium/drivers/radeonsi/si_dma.c
index 500247fccfd..af639a532e8 100644
--- a/src/gallium/drivers/radeonsi/si_dma.c
+++ b/src/gallium/drivers/radeonsi/si_dma.c
@@ -89,7 +89,8 @@ static void si_dma_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;
}
@@ -233,7 +234,9 @@ static void si_dma_copy(struct pipe_context *ctx,
unsigned src_x, src_y;
unsigned dst_x = dstx, dst_y = dsty, dst_z = dstz;
- if (sctx->b.dma.cs == NULL) {
+ if (sctx->b.dma.cs == NULL ||
+ src->flags & PIPE_RESOURCE_FLAG_SPARSE ||
+ dst->flags & PIPE_RESOURCE_FLAG_SPARSE) {
goto fallback;
}