From 14a0004232683db25c392f5b4eb6fc2cdf47642f Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Fri, 19 Feb 2021 16:41:33 +0200 Subject: [PATCH] turnip: consider tile_max_h when calculating tiling config 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 Part-of: --- ci-expects/freedreno/deqp-freedreno-a630-fails.txt | 1 - src/freedreno/vulkan/tu_util.c | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ci-expects/freedreno/deqp-freedreno-a630-fails.txt b/ci-expects/freedreno/deqp-freedreno-a630-fails.txt index 204802657ff..eb6f905a3ca 100644 --- a/ci-expects/freedreno/deqp-freedreno-a630-fails.txt +++ b/ci-expects/freedreno/deqp-freedreno-a630-fails.txt @@ -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 diff --git a/src/freedreno/vulkan/tu_util.c b/src/freedreno/vulkan/tu_util.c index 07fc149c0d3..a53b9a7e731 100644 --- a/src/freedreno/vulkan/tu_util.c +++ b/src/freedreno/vulkan/tu_util.c @@ -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? */