From d2b6f16145dfb0cfcd4fb03831d43b94e37ce820 Mon Sep 17 00:00:00 2001 From: "Zhang, Jianxun" Date: Fri, 12 May 2023 12:32:57 -0700 Subject: [PATCH] anv: Support 1MB AUX mapping (MTL) Replace the hardcoded 64KB granularity with a value provided by AUX module that returns either 64KB(TGL) or 1MB(MTL) of the running system. Signed-off-by: Zhang, Jianxun Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index f6eecdb86cb..1bf5cbd8a59 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -412,12 +412,16 @@ anv_image_init_aux_tt(struct anv_cmd_buffer *cmd_buffer, end_offset_B = MAX2(end_offset_B, slice_end_offset_B); } - /* Aux operates 64K at a time */ - start_offset_B = ROUND_DOWN_TO(start_offset_B, 64 * 1024); - end_offset_B = align64(end_offset_B, 64 * 1024); + struct intel_aux_map_context *ctx = cmd_buffer->device->aux_map_ctx; + /* It depends on what the purpose you use that figure from AUX module, + * alignment, page size of main surface, or actually granularity... + */ + uint64_t main_page_size = intel_aux_map_get_alignment(ctx); + start_offset_B = ROUND_DOWN_TO(start_offset_B, main_page_size); + end_offset_B = align64(end_offset_B, main_page_size); for (uint64_t offset = start_offset_B; - offset < end_offset_B; offset += 64 * 1024) { + offset < end_offset_B; offset += main_page_size) { uint64_t address = base_address + offset; uint64_t aux_entry_addr64, *aux_entry_map;