summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-12-01 03:08:16 +0100
committerMarek Olšák <[email protected]>2017-12-06 15:19:02 +0100
commit4038db72d4f28f3eae811173839a926ea4979b5e (patch)
tree7444f90664ed8e65556cfcd07cfbd0246a09ac90 /src
parent7a6643fb4cace23c8aef260fed7f28685d236fd0 (diff)
radeonsi: make const and stream uploaders allocate read-only memory
and anything that clones these uploaders, like u_threaded_context. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 9090e65aaa8..9e45a9f0d1d 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -445,12 +445,15 @@ bool si_common_context_init(struct r600_common_context *rctx,
return false;
rctx->b.stream_uploader = u_upload_create(&rctx->b, 1024 * 1024,
- 0, PIPE_USAGE_STREAM, 0);
+ 0, PIPE_USAGE_STREAM,
+ R600_RESOURCE_FLAG_READ_ONLY);
if (!rctx->b.stream_uploader)
return false;
rctx->b.const_uploader = u_upload_create(&rctx->b, 128 * 1024,
- 0, PIPE_USAGE_DEFAULT, 0);
+ 0, PIPE_USAGE_DEFAULT,
+ sscreen->cpdma_prefetch_writes_memory ?
+ 0 : R600_RESOURCE_FLAG_READ_ONLY);
if (!rctx->b.const_uploader)
return false;