[Mesa-dev] [PATCH 8/8] radeonsi: make const and stream uploaders allocate read-only memory

Marek Olšák maraeo at gmail.com
Fri Dec 1 20:19:40 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

and anything that clones these uploaders, like u_threaded_context.
---
 src/gallium/drivers/radeon/r600_pipe_common.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index d85f9f0..23d8bf7 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -438,26 +438,28 @@ bool si_common_context_init(struct r600_common_context *rctx,
 			return false;
 	}
 
 	rctx->allocator_zeroed_memory =
 		u_suballocator_create(&rctx->b, sscreen->info.gart_page_size,
 				      0, PIPE_USAGE_DEFAULT, 0, true);
 	if (!rctx->allocator_zeroed_memory)
 		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,
+						 R600_RESOURCE_FLAG_READ_ONLY);
 	if (!rctx->b.const_uploader)
 		return false;
 
 	rctx->ctx = rctx->ws->ctx_create(rctx->ws);
 	if (!rctx->ctx)
 		return false;
 
 	if (sscreen->info.num_sdma_rings && !(sscreen->debug_flags & DBG(NO_ASYNC_DMA))) {
 		rctx->dma.cs = rctx->ws->cs_create(rctx->ctx, RING_DMA,
 						   r600_flush_dma_ring,
-- 
2.7.4



More information about the mesa-dev mailing list