From d795eb207ff90e4885a278910fdc87e932242da6 Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Tue, 18 Feb 2020 08:50:39 -0500 Subject: [PATCH] turnip: add option to force use of hw binning For running deqp tests which have small render sizes and don't otherwise get coverage of hw binning / multiple tiles. Signed-off-by: Jonathan Marek Reviewed-by: Eric Anholt Tested-by: Marge Bot Part-of: --- src/freedreno/vulkan/tu_cmd_buffer.c | 13 ++++++++++++- src/freedreno/vulkan/tu_device.c | 1 + src/freedreno/vulkan/tu_private.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index a9543984489..1528bab0035 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -202,11 +202,19 @@ tu_tiling_config_update_tile_layout(struct tu_tiling_config *tiling, .height = align(ra_height, tile_align_h), }; + if (unlikely(dev->physical_device->instance->debug_flags & TU_DEBUG_FORCEBIN)) { + /* start with 2x2 tiles */ + tiling->tile_count.width = 2; + tiling->tile_count.height = 2; + tiling->tile0.extent.width = align(DIV_ROUND_UP(ra_width, 2), tile_align_w); + tiling->tile0.extent.height = align(DIV_ROUND_UP(ra_height, 2), tile_align_h); + } + /* do not exceed max tile width */ while (tiling->tile0.extent.width > max_tile_width) { tiling->tile_count.width++; tiling->tile0.extent.width = - align(ra_width / tiling->tile_count.width, tile_align_w); + align(DIV_ROUND_UP(ra_width, tiling->tile_count.width), tile_align_w); } /* do not exceed gmem size */ @@ -754,6 +762,9 @@ use_hw_binning(struct tu_cmd_buffer *cmd) if (unlikely(cmd->device->physical_device->instance->debug_flags & TU_DEBUG_NOBIN)) return false; + if (unlikely(cmd->device->physical_device->instance->debug_flags & TU_DEBUG_FORCEBIN)) + return true; + return (tiling->tile_count.width * tiling->tile_count.height) > 2; } diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index 6883bcb96bd..9a8288934ca 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -368,6 +368,7 @@ static const struct debug_control tu_debug_options[] = { { "ir3", TU_DEBUG_IR3 }, { "nobin", TU_DEBUG_NOBIN }, { "sysmem", TU_DEBUG_SYSMEM }, + { "forcebin", TU_DEBUG_FORCEBIN }, { NULL, 0 } }; diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h index 30931b0e321..eb3cc5dd684 100644 --- a/src/freedreno/vulkan/tu_private.h +++ b/src/freedreno/vulkan/tu_private.h @@ -338,6 +338,7 @@ enum tu_debug_flags TU_DEBUG_IR3 = 1 << 2, TU_DEBUG_NOBIN = 1 << 3, TU_DEBUG_SYSMEM = 1 << 4, + TU_DEBUG_FORCEBIN = 1 << 5, }; struct tu_instance -- 2.30.2