aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2020-05-11 13:53:48 -0700
committerMarge Bot <[email protected]>2020-05-12 21:19:50 +0000
commitfdcadf611e03f0dc8878fb032b62510c38fe069b (patch)
tree23510ad92c09fd181dad1c7c37dd2d4b144341e6 /src
parenta43e9740646a42e3c2d914ad7e0eb20f4113d153 (diff)
freedreno: Add a nohw flag to skip submitting to the kernel.
For some CPU-side-only optimizations, it can be nice to disable rendering so that we can see what the impact is even on cases where the GPU can't quite keep up. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4996>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_gmem.c3
-rw-r--r--src/gallium/drivers/freedreno/freedreno_screen.c1
-rw-r--r--src/gallium/drivers/freedreno/freedreno_util.h1
3 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c
index 78d2a3a7932..73db133ae4a 100644
--- a/src/gallium/drivers/freedreno/freedreno_gmem.c
+++ b/src/gallium/drivers/freedreno/freedreno_gmem.c
@@ -612,6 +612,9 @@ flush_ring(struct fd_batch *batch)
uint32_t timestamp;
int out_fence_fd = -1;
+ if (unlikely(fd_mesa_debug & FD_DBG_NOHW))
+ return;
+
fd_submit_flush(batch->submit, batch->in_fence_fd,
batch->needs_out_fence_fd ? &out_fence_fd : NULL,
&timestamp);
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index b44fee62bd7..fd15e1fe54b 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -90,6 +90,7 @@ static const struct debug_named_value debug_options[] = {
{"notile", FD_DBG_NOTILE, "Disable tiling for all internal buffers"},
{"layout", FD_DBG_LAYOUT, "Dump resource layouts"},
{"nofp16", FD_DBG_NOFP16, "Disable mediump precision lowering"},
+ {"nohw", FD_DBG_NOHW, "Disable submitting commands to the HW"},
DEBUG_NAMED_VALUE_END
};
diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h
index 0557f0ffca2..c2380c86303 100644
--- a/src/gallium/drivers/freedreno/freedreno_util.h
+++ b/src/gallium/drivers/freedreno/freedreno_util.h
@@ -90,6 +90,7 @@ enum fd_debug_flag {
FD_DBG_NOTILE = BITFIELD_BIT(25),
FD_DBG_LAYOUT = BITFIELD_BIT(26),
FD_DBG_NOFP16 = BITFIELD_BIT(27),
+ FD_DBG_NOHW = BITFIELD_BIT(28),
};
extern int fd_mesa_debug;