From: Alyssa Rosenzweig Date: Fri, 27 Mar 2020 18:39:39 +0000 (-0400) Subject: panfrost: Enable PIPE_SHADER_CAP_FP16 on Bifrost X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2a8ef907b528b125ff0827e8ea2588a85022fd6;p=mesa.git panfrost: Enable PIPE_SHADER_CAP_FP16 on Bifrost We don't have fp16 implemented on Midgard yet but on Bifrost we can flip it on now. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 46f33d584a0..0c40ff67c73 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -286,6 +286,7 @@ panfrost_get_shader_param(struct pipe_screen *screen, enum pipe_shader_cap param) { bool is_deqp = pan_debug & PAN_DBG_DEQP; + struct panfrost_device *dev = pan_device(screen); if (shader != PIPE_SHADER_VERTEX && shader != PIPE_SHADER_FRAGMENT && @@ -341,8 +342,10 @@ panfrost_get_shader_param(struct pipe_screen *screen, case PIPE_SHADER_CAP_INTEGERS: return 1; - case PIPE_SHADER_CAP_INT64_ATOMICS: case PIPE_SHADER_CAP_FP16: + return !(dev->quirks & MIDGARD_BROKEN_FP16); + + case PIPE_SHADER_CAP_INT64_ATOMICS: case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED: case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED: case PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED: diff --git a/src/panfrost/include/panfrost-quirks.h b/src/panfrost/include/panfrost-quirks.h index 8b8aa0812cd..afac6d82d2b 100644 --- a/src/panfrost/include/panfrost-quirks.h +++ b/src/panfrost/include/panfrost-quirks.h @@ -39,9 +39,14 @@ #define MIDGARD_SFBD (1 << 1) +/* Whether fp16 is broken in the compiler. Hopefully this quirk will go away + * over time */ + +#define MIDGARD_BROKEN_FP16 (1 << 2) + /* Quirk collections common to particular uarchs */ -#define MIDGARD_QUIRKS (0) +#define MIDGARD_QUIRKS (MIDGARD_BROKEN_FP16) #define BIFROST_QUIRKS (0)