[Mesa-dev] [PATCH 7/8] r300: let .get_name() append LLVM if built with LLVM

Marek Olšák maraeo at gmail.com
Thu Jan 26 20:56:03 UTC 2017


My preference would be not to use static variables in pipe_screen
functions, because all functions needs to be thread-safe, but anyway:

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

Marek

On Thu, Jan 26, 2017 at 7:27 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Provides quick and direct feedback to the user/developer.
>
> Cc: Marek Olšák <marek.olsak at amd.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  src/gallium/drivers/r300/r300_screen.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
> index e5e7535358..12b94723cb 100644
> --- a/src/gallium/drivers/r300/r300_screen.c
> +++ b/src/gallium/drivers/r300/r300_screen.c
> @@ -82,8 +82,16 @@ static const char* chip_families[] = {
>  static const char* r300_get_name(struct pipe_screen* pscreen)
>  {
>      struct r300_screen* r300screen = r300_screen(pscreen);
> +    static char buffer[128];
> +    const char *llvm = "";
>
> -    return chip_families[r300screen->caps.family];
> +#ifdef HAVE_LLVM
> +    llvm = " LLVM";
> +#endif
> +
> +    util_snprintf(buffer, sizeof(buffer), "%s%s",
> +                  chip_families[r300screen->caps.family], llvm);
> +    return buffer;
>  }
>
>  static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
> --
> 2.11.0
>
> _______________________________________________
> 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