panfrost: Enable PIPE_SHADER_CAP_FP16 on Bifrost
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 27 Mar 2020 18:39:39 +0000 (14:39 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 31 Mar 2020 01:12:26 +0000 (01:12 +0000)
We don't have fp16 implemented on Midgard yet but on Bifrost we can flip
it on now.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4382>

src/gallium/drivers/panfrost/pan_screen.c
src/panfrost/include/panfrost-quirks.h

index 46f33d584a0d4e6e88b624513d1c6602d0ac21bd..0c40ff67c7396f5c54b371eabae87d094c665f9f 100644 (file)
@@ -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:
index 8b8aa0812cd620d695cf0ad004686e0a93c6d020..afac6d82d2b66f14cd38e221c7575030226f4040 100644 (file)
 
 #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)