panfrost: Enable FP16 by default
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 17 Jul 2020 21:04:41 +0000 (17:04 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 17 Jul 2020 23:37:13 +0000 (23:37 +0000)
I see no reason to hide this. The small hit in cycle count is offset in
practice by the increase in thread count. So let's ship it and get some
testing.

If this regresses a workload:

1. Open an issue on the tracker and attach an apitrace.
2. In the meantime set PAN_MESA_DEBUG=nofp16 to override.

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

src/gallium/drivers/panfrost/pan_screen.c
src/panfrost/encoder/pan_util.h

index cd9b41d1d740f8e6453c230b65c76e0fba3f8fcf..a5d264e0b1733069073140db10453aa20c20d2ec 100644 (file)
@@ -62,7 +62,7 @@ static const struct debug_named_value debug_options[] = {
         {"afbc",      PAN_DBG_AFBC,     "Enable non-conformant AFBC impl"},
         {"sync",      PAN_DBG_SYNC,     "Wait for each job's completion and check for any GPU fault"},
         {"precompile", PAN_DBG_PRECOMPILE, "Precompile shaders for shader-db"},
-        {"fp16",     PAN_DBG_FP16,     "Enable buggy experimental (don't use!) fp16"},
+        {"nofp16",     PAN_DBG_NOFP16,     "Disable 16-bit support"},
         {"bifrost",   PAN_DBG_BIFROST, "Enable experimental Mali G31 and G52 support"},
         {"gl3",       PAN_DBG_GL3,      "Enable experimental GL 3.x implementation, up to 3.3"},
         DEBUG_NAMED_VALUE_END
@@ -277,7 +277,7 @@ panfrost_get_shader_param(struct pipe_screen *screen,
 {
         struct panfrost_device *dev = pan_device(screen);
         bool is_deqp = dev->debug & PAN_DBG_DEQP;
-        bool is_fp16 = dev->debug & PAN_DBG_FP16;
+        bool is_nofp16 = dev->debug & PAN_DBG_NOFP16;
         bool is_bifrost = dev->quirks & IS_BIFROST;
 
         if (shader != PIPE_SHADER_VERTEX &&
@@ -335,11 +335,11 @@ panfrost_get_shader_param(struct pipe_screen *screen,
                 return 1;
 
         case PIPE_SHADER_CAP_FP16:
-                return !(dev->quirks & MIDGARD_BROKEN_FP16) || is_fp16;
+        case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+                return !is_nofp16;
 
         case PIPE_SHADER_CAP_FP16_DERIVATIVES:
         case PIPE_SHADER_CAP_INT16:
-        case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
         case PIPE_SHADER_CAP_INT64_ATOMICS:
         case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
         case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
index 5ca5ab6f47479eae3d5dc1f7a2c0fda66d954fec..5f40fc93633a89a8bd70a2f6f6bf0339789b48f8 100644 (file)
@@ -34,7 +34,7 @@
 #define PAN_DBG_AFBC            0x0008
 #define PAN_DBG_SYNC            0x0010
 #define PAN_DBG_PRECOMPILE      0x0020
-#define PAN_DBG_FP16            0x0040
+#define PAN_DBG_NOFP16          0x0040
 #define PAN_DBG_BIFROST         0x0080
 #define PAN_DBG_GL3             0x0100