turnip: consider tile_max_h when calculating tiling config
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Fri, 19 Feb 2021 14:41:33 +0000 (16:41 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Feb 2021 15:24:30 +0000 (15:24 +0000)
Otherwise we may get a tile height exceeding the maximum.

Fixes tests:
 dEQP-VK.pipeline.render_to_image.core.2d.huge.height.r8g8b8a8_unorm
 dEQP-VK.pipeline.render_to_image.core.2d.huge.height.r8g8b8a8_unorm_d16_unorm
 dEQP-VK.pipeline.render_to_image.core.2d.huge.height.r8g8b8a8_unorm_s8_uint

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9159>

ci-expects/freedreno/deqp-freedreno-a630-fails.txt
src/freedreno/vulkan/tu_util.c

index 2048026..eb6f905 100644 (file)
@@ -66,7 +66,6 @@ dEQP-VK.pipeline.push_descriptor.compute.binding3_numcalls2_combined_image_sampl
 dEQP-VK.pipeline.push_descriptor.compute.binding3_numcalls2_sampled_image,Crash
 dEQP-VK.pipeline.push_descriptor.compute.binding3_numcalls2_sampler,Crash
 dEQP-VK.pipeline.push_descriptor.compute.binding3_numcalls2_storage_image,Crash
-dEQP-VK.pipeline.render_to_image.core.2d.huge.height.r8g8b8a8_unorm_s8_uint,Crash
 dEQP-VK.rasterization.line_continuity.line-strip,Fail
 dEQP-VK.renderpass2.suballocation.attachment_allocation.input_output.7,Fail
 dEQP-VK.spirv_assembly.instruction.compute.opquantize.infinities,Fail
index 07fc149..a53b9a7 100644 (file)
@@ -85,7 +85,8 @@ tu_tiling_config_update_tile_layout(struct tu_framebuffer *fb,
 {
    const uint32_t tile_align_w = pass->tile_align_w;
    const uint32_t tile_align_h = dev->physical_device->info.tile_align_h;
-   const uint32_t max_tile_width = 1024;
+   const uint32_t max_tile_width = dev->physical_device->info.tile_max_w;
+   const uint32_t max_tile_height = dev->physical_device->info.tile_max_h;
 
    /* start from 1 tile */
    fb->tile_count = (VkExtent2D) {
@@ -112,6 +113,13 @@ tu_tiling_config_update_tile_layout(struct tu_framebuffer *fb,
          util_align_npot(DIV_ROUND_UP(fb->width, fb->tile_count.width), tile_align_w);
    }
 
+   /* do not exceed max tile height */
+   while (fb->tile0.height > max_tile_height) {
+      fb->tile_count.height++;
+      fb->tile0.height =
+         util_align_npot(DIV_ROUND_UP(fb->height, fb->tile_count.height), tile_align_h);
+   }
+
    /* will force to sysmem, don't bother trying to have a valid tile config
     * TODO: just skip all GMEM stuff when sysmem is forced?
     */