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

Nicolai Hähnle nhaehnle at gmail.com
Mon Dec 4 11:58:56 UTC 2017


On 01.12.2017 21:19, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> and anything that clones these uploaders, like u_threaded_context.

Bottom/top-of-pipe fences will have to be moved away from using the 
stream_uploader.


> ---
>   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,
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list