freedreno: add "nogrow" debug param
authorRob Clark <robdclark@gmail.com>
Mon, 2 Jan 2017 22:22:13 +0000 (17:22 -0500)
committerRob Clark <robdclark@gmail.com>
Wed, 11 Jan 2017 00:40:00 +0000 (19:40 -0500)
Sometimes it is useful to disable the "growable" cmdstream buffers for
debugging.  (See 419a154d in libdrm)

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_batch.c
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_util.h

index 646c76fb57d3f023e7c07bf90301c72d91e011cd..f5a5c6a3cc933be60d2fbd4621cf0a77923ef3a5 100644 (file)
@@ -48,7 +48,8 @@ batch_init(struct fd_batch *batch)
         * we don't need to grow the ringbuffer.  Performance is likely to
         * suffer, but there is no good alternative.
         */
-       if (fd_device_version(ctx->screen->dev) < FD_VERSION_UNLIMITED_CMDS) {
+       if ((fd_device_version(ctx->screen->dev) < FD_VERSION_UNLIMITED_CMDS) ||
+                       (fd_mesa_debug & FD_DBG_NOGROW)){
                size = 0x100000;
        }
 
index 2fafb52b19058c1787a2f59f66ffc56db49bf18f..2ff89eb0f37cb294949eeedbb8abe2c2df86869a 100644 (file)
@@ -78,6 +78,7 @@ static const struct debug_named_value debug_options[] = {
                {"nir",       FD_DBG_NIR,    "Prefer NIR as native IR"},
                {"reorder",   FD_DBG_REORDER,"Enable reordering for draws/blits"},
                {"bstat",     FD_DBG_BSTAT,  "Print batch stats at context destroy"},
+               {"nogrow",    FD_DBG_NOGROW, "Disable \"growable\" cmdstream buffers, even if kernel supports it"},
                DEBUG_NAMED_VALUE_END
 };
 
index c699f7badff6aa9bba2ecfc833ec279f03ac8a38..08bc5d7ba4a00675ca2ae90a5c7bfc475cf3e437 100644 (file)
@@ -79,6 +79,7 @@ enum adreno_stencil_op fd_stencil_op(unsigned op);
 #define FD_DBG_NIR      0x4000
 #define FD_DBG_REORDER  0x8000
 #define FD_DBG_BSTAT   0x10000
+#define FD_DBG_NOGROW  0x20000
 
 extern int fd_mesa_debug;
 extern bool fd_binning_enabled;