freedreno: Add a nohw flag to skip submitting to the kernel.
authorEric Anholt <eric@anholt.net>
Mon, 11 May 2020 20:53:48 +0000 (13:53 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 12 May 2020 21:19:50 +0000 (21:19 +0000)
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>

src/gallium/drivers/freedreno/freedreno_gmem.c
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_util.h

index 78d2a3a79329c4ff236a7de2ac727c0ed2d30a8b..73db133ae4a4308beb33a10c6e4b219e108b0498 100644 (file)
@@ -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);
index b44fee62bd7dd4f908a5ff216163b9c130e25d96..fd15e1fe54bc289682e718bd2dfead950900f9f0 100644 (file)
@@ -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
 };
 
index 0557f0ffca2fde2535e7604e6411b6369f3d5e14..c2380c863036d86fe44f5444a985a77141fa8a41 100644 (file)
@@ -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;