From fdcadf611e03f0dc8878fb032b62510c38fe069b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 11 May 2020 13:53:48 -0700 Subject: [PATCH] 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: --- src/gallium/drivers/freedreno/freedreno_gmem.c | 3 +++ src/gallium/drivers/freedreno/freedreno_screen.c | 1 + src/gallium/drivers/freedreno/freedreno_util.h | 1 + 3 files changed, 5 insertions(+) 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, ×tamp); 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; -- 2.30.2