[Mesa-dev] [PATCH 2/2] radeonsi: cope with missing disassembly

Marek Olšák maraeo at gmail.com
Fri Apr 14 19:18:53 UTC 2017


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Apr 13, 2017 at 8:23 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> For robustness and testing purposes.
> ---
>  src/gallium/drivers/radeonsi/si_state_shaders.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
> index 78c7495..c52ffd9 100644
> --- a/src/gallium/drivers/radeonsi/si_state_shaders.c
> +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
> @@ -106,21 +106,22 @@ static uint32_t *read_chunk(uint32_t *ptr, void **data, unsigned *size)
>
>  /**
>   * Return the shader binary in a buffer. The first 4 bytes contain its size
>   * as integer.
>   */
>  static void *si_get_shader_binary(struct si_shader *shader)
>  {
>         /* There is always a size of data followed by the data itself. */
>         unsigned relocs_size = shader->binary.reloc_count *
>                                sizeof(shader->binary.relocs[0]);
> -       unsigned disasm_size = strlen(shader->binary.disasm_string) + 1;
> +       unsigned disasm_size = shader->binary.disasm_string ?
> +                              strlen(shader->binary.disasm_string) + 1 : 0;
>         unsigned llvm_ir_size = shader->binary.llvm_ir_string ?
>                                 strlen(shader->binary.llvm_ir_string) + 1 : 0;
>         unsigned size =
>                 4 + /* total size */
>                 4 + /* CRC32 of the data below */
>                 align(sizeof(shader->config), 4) +
>                 align(sizeof(shader->info), 4) +
>                 4 + align(shader->binary.code_size, 4) +
>                 4 + align(shader->binary.rodata_size, 4) +
>                 4 + align(relocs_size, 4) +
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list