[Mesa-dev] [PATCH] radeonsi: always initialize max_forced_staging_uploads

Nicolai Hähnle nhaehnle at gmail.com
Mon Nov 27 12:02:21 UTC 2017


On 24.11.2017 22:32, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> r600_resource is malloc'd.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103808

Could you please explain how this actually caused the mentioned bug(s)? 
I would have thought that it only leads to more forced staging uploads, 
which shouldn't cause rendering corruptions.

In any case, the patch clearly makes sense, so:

Fixes: 4b0dc098b256 ("gallium/u_threaded: don't map big VRAM buffers for 
the first upload directly")
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

> ---
>   src/gallium/drivers/radeon/r600_buffer_common.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
> index 770f4e9..3e476f7 100644
> --- a/src/gallium/drivers/radeon/r600_buffer_common.c
> +++ b/src/gallium/drivers/radeon/r600_buffer_common.c
> @@ -183,20 +183,22 @@ void si_init_resource_fields(struct r600_common_screen *rscreen,
>   		res->domains = RADEON_DOMAIN_VRAM_GTT;
>   		res->flags &= ~RADEON_FLAG_NO_CPU_ACCESS; /* disallowed with VRAM_GTT */
>   	}
>   
>   	if (rscreen->debug_flags & DBG(NO_WC))
>   		res->flags &= ~RADEON_FLAG_GTT_WC;
>   
>   	/* Set expected VRAM and GART usage for the buffer. */
>   	res->vram_usage = 0;
>   	res->gart_usage = 0;
> +	res->max_forced_staging_uploads = 0;
> +	res->b.max_forced_staging_uploads = 0;
>   
>   	if (res->domains & RADEON_DOMAIN_VRAM) {
>   		res->vram_usage = size;
>   
>   		res->max_forced_staging_uploads =
>   		res->b.max_forced_staging_uploads =
>   			rscreen->info.has_dedicated_vram &&
>   			size >= rscreen->info.vram_vis_size / 4 ? 1 : 0;
>   	} else if (res->domains & RADEON_DOMAIN_GTT) {
>   		res->gart_usage = size;
> 


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


More information about the mesa-dev mailing list