From 485ec761082ddfd952f80bb96b5fb5a607349b08 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 6 May 2020 19:48:05 -0400 Subject: [PATCH] panfrost: Guard experimental fp16 behind debug flag Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_screen.c | 4 +++- src/panfrost/encoder/pan_util.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 28ce1c9a8b1..5024a19f243 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -63,6 +63,7 @@ static const struct debug_named_value debug_options[] = { {"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"}, {"gles3", PAN_DBG_GLES3, "Enable experimental GLES3 implementation"}, + {"fp16", PAN_DBG_FP16, "Enable buggy experimental (don't use!) fp16"}, DEBUG_NAMED_VALUE_END }; @@ -289,6 +290,7 @@ panfrost_get_shader_param(struct pipe_screen *screen, enum pipe_shader_cap param) { bool is_deqp = pan_debug & PAN_DBG_DEQP; + bool is_fp16 = pan_debug & PAN_DBG_FP16; struct panfrost_device *dev = pan_device(screen); if (shader != PIPE_SHADER_VERTEX && @@ -346,7 +348,7 @@ panfrost_get_shader_param(struct pipe_screen *screen, return 1; case PIPE_SHADER_CAP_FP16: - return !(dev->quirks & MIDGARD_BROKEN_FP16); + return !(dev->quirks & MIDGARD_BROKEN_FP16) || is_fp16; case PIPE_SHADER_CAP_INT64_ATOMICS: case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED: diff --git a/src/panfrost/encoder/pan_util.h b/src/panfrost/encoder/pan_util.h index 06484ce383b..320a608e36f 100644 --- a/src/panfrost/encoder/pan_util.h +++ b/src/panfrost/encoder/pan_util.h @@ -35,6 +35,7 @@ #define PAN_DBG_SYNC 0x0010 #define PAN_DBG_PRECOMPILE 0x0020 #define PAN_DBG_GLES3 0x0040 +#define PAN_DBG_FP16 0x0080 extern int pan_debug; -- 2.30.2