[Mesa-dev] [PATCH 2/7] r600g, radeonsi: use current domain for deciding when to do blit-based transfer

Michel Dänzer michel at daenzer.net
Mon Feb 24 18:54:17 PST 2014


On Die, 2014-02-25 at 00:48 +0100, Marek Olšák wrote:
> 
> diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
> index 35ad97b..1966251 100644
> --- a/src/gallium/drivers/radeon/r600_texture.c
> +++ b/src/gallium/drivers/radeon/r600_texture.c
> @@ -910,7 +910,8 @@ static void *r600_texture_transfer_map(struct pipe_context *ctx,
>  
>  	/* Untiled buffers in VRAM, which is slow for CPU reads and writes */
>  	if (!(usage & PIPE_TRANSFER_MAP_DIRECTLY) &&
> -	    (rtex->resource.domains == RADEON_DOMAIN_VRAM)) {
> +	    (rctx->ws->buffer_get_current_domain(rtex->resource.cs_buf) ==
> +	     RADEON_DOMAIN_VRAM)) {
>  		use_staging_texture = TRUE;
>  	}

If rtex is already referenced by the command stream being prepared, the
decision needs to be based on that instead. The ioctl just returns where
the BO happens to be when it's called, which is not necessarily where it
will be when this command stream is executed.


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer



More information about the mesa-dev mailing list