Mesa (master): turnip: add option to force use of hw binning

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 19 22:42:50 UTC 2020


Module: Mesa
Branch: master
Commit: d795eb207ff90e4885a278910fdc87e932242da6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d795eb207ff90e4885a278910fdc87e932242da6

Author: Jonathan Marek <jonathan at marek.ca>
Date:   Tue Feb 18 08:50:39 2020 -0500

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 <jonathan at marek.ca>
Reviewed-by: Eric Anholt <eric at anholt.net>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3851>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3851>

---

 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



More information about the mesa-commit mailing list