From 99e9dca149e2484c9472a0518eee5e2099bdb251 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 2 Jan 2017 17:22:13 -0500 Subject: freedreno: add "nogrow" debug param Sometimes it is useful to disable the "growable" cmdstream buffers for debugging. (See 419a154d in libdrm) Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/freedreno_batch.c | 3 ++- src/gallium/drivers/freedreno/freedreno_screen.c | 1 + src/gallium/drivers/freedreno/freedreno_util.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c b/src/gallium/drivers/freedreno/freedreno_batch.c index 646c76fb57d..f5a5c6a3cc9 100644 --- a/src/gallium/drivers/freedreno/freedreno_batch.c +++ b/src/gallium/drivers/freedreno/freedreno_batch.c @@ -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; } diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index 2fafb52b190..2ff89eb0f37 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -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 }; diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index c699f7badff..08bc5d7ba4a 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -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; -- cgit v1.2.3