[Mesa-dev] [PATCH 1/2] radeonsi/gfx9: don't overallocate shader binaries
Nicolai Hähnle
nhaehnle at gmail.com
Sat Jun 24 09:59:06 UTC 2017
On 22.06.2017 14:34, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> It's not needed. The hw doesn't fetch ahead over page boundaries.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
> ---
> src/gallium/drivers/radeonsi/si_shader.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index 3ca2aa5..108386e 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -4751,26 +4751,20 @@ int si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader)
> (!epilog ? mainb->rodata_size : 0);
> unsigned char *ptr;
>
> assert(!prolog || !prolog->rodata_size);
> assert(!previous_stage || !previous_stage->rodata_size);
> assert(!prolog2 || !prolog2->rodata_size);
> assert((!prolog && !previous_stage && !prolog2 && !epilog) ||
> !mainb->rodata_size);
> assert(!epilog || !epilog->rodata_size);
>
> - /* GFX9 can fetch at most 128 bytes past the end of the shader.
> - * Prevent VM faults.
> - */
> - if (sscreen->b.chip_class >= GFX9)
> - bo_size += 128;
> -
> r600_resource_reference(&shader->bo, NULL);
> shader->bo = (struct r600_resource*)
> pipe_buffer_create(&sscreen->b.b, 0,
> PIPE_USAGE_IMMUTABLE,
> align(bo_size, SI_CPDMA_ALIGNMENT));
> if (!shader->bo)
> return -ENOMEM;
>
> /* Upload. */
> ptr = sscreen->b.ws->buffer_map(shader->bo->buf, NULL,
>
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the mesa-dev
mailing list