From e3bcce01d985bc301b0204bc781d82f6bd281cc1 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 13 Aug 2021 23:11:39 +0000 Subject: [PATCH] panfrost: Disable shader-assisted indirect draws Although it is passing all of dEQP-GLES31, it is failing a few KHR-GLES31.* tests. It also has performance issues at the moment. Invert the existing noindirect debug flag to become a indirect debug flag. Set this flag for dEQP-GLES31 CI on G52, to make sure the code doesn't bit rot on the hope someone will pick this up later on. Signed-off-by: Alyssa Rosenzweig Cc: mesa-stable Part-of: (cherry picked from commit a7f7d741377904a6b69f6826b3dd10bd46b945b0) Conflicts: src/gallium/drivers/panfrost/pan_screen.c src/panfrost/lib/pan_util.h --- .pick_status.json | 2 +- src/gallium/drivers/panfrost/ci/gitlab-ci.yml | 2 +- src/gallium/drivers/panfrost/pan_cmdstream.c | 4 ++-- src/gallium/drivers/panfrost/pan_screen.c | 8 +++----- src/panfrost/lib/pan_util.h | 4 +++- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 9745cbf4e8a..571571ee4d1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -805,7 +805,7 @@ "description": "panfrost: Disable shader-assisted indirect draws", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/panfrost/ci/gitlab-ci.yml b/src/gallium/drivers/panfrost/ci/gitlab-ci.yml index 01f91016200..9af4cdd3b0b 100644 --- a/src/gallium/drivers/panfrost/ci/gitlab-ci.yml +++ b/src/gallium/drivers/panfrost/ci/gitlab-ci.yml @@ -154,7 +154,7 @@ panfrost-g52-gles31:arm64: - .lava-meson-g12b-a311d-khadas-vim3 variables: DEQP_VER: gles31 - PAN_MESA_DEBUG: "deqp,sync" + PAN_MESA_DEBUG: "deqp,sync,indirect" DEQP_PARALLEL: 6 DEQP_EXPECTED_RENDERER: G52 diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index d31a7466a9d..88aab01d891 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -3078,8 +3078,8 @@ panfrost_draw_vbo(struct pipe_context *pipe, if (!panfrost_render_condition_check(ctx)) return; - /* Emulate indirect draws when debugging */ - if (dev->debug & PAN_DBG_NOINDIRECT && indirect && indirect->buffer) { + /* Emulate indirect draws unless we're using the experimental path */ + if (!(dev->debug & PAN_DBG_INDIRECT) && indirect && indirect->buffer) { assert(num_draws == 1); util_draw_indirect(pipe, info, indirect); return; diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 4b1fabc1809..6df27b4cdd5 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -67,7 +67,9 @@ static const struct debug_named_value panfrost_debug_options[] = { {"noafbc", PAN_DBG_NO_AFBC, "Disable AFBC support"}, {"nocrc", PAN_DBG_NO_CRC, "Disable transaction elimination"}, {"msaa16", PAN_DBG_MSAA16, "Enable MSAA 8x and 16x support"}, - {"noindirect", PAN_DBG_NOINDIRECT, "Emulate indirect draws on the CPU"}, + {"indirect", PAN_DBG_INDIRECT, "Use experimental compute kernel for indirect draws"}, + {"linear", PAN_DBG_LINEAR, "Force linear textures"}, + {"nocache", PAN_DBG_NO_CACHE, "Disable BO cache"}, DEBUG_NAMED_VALUE_END }; @@ -836,10 +838,6 @@ panfrost_create_screen(int fd, struct renderonly *ro) if (dev->arch == 7) dev->quirks |= MIDGARD_NO_AFBC; - /* XXX: Indirect draws on Midgard need debugging, emulate for now */ - if (dev->arch < 6) - dev->debug |= PAN_DBG_NOINDIRECT; - dev->ro = ro; /* Check if we're loading against a supported GPU model. */ diff --git a/src/panfrost/lib/pan_util.h b/src/panfrost/lib/pan_util.h index 449442dae3d..7caa0e4cfde 100644 --- a/src/panfrost/lib/pan_util.h +++ b/src/panfrost/lib/pan_util.h @@ -43,7 +43,9 @@ #define PAN_DBG_GL3 0x0100 #define PAN_DBG_NO_AFBC 0x0200 #define PAN_DBG_MSAA16 0x0400 -#define PAN_DBG_NOINDIRECT 0x0800 +#define PAN_DBG_INDIRECT 0x0800 +#define PAN_DBG_LINEAR 0x1000 +#define PAN_DBG_NO_CACHE 0x2000 struct panfrost_device;