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 <jianxun.zhang@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23002>
This commit is contained in:
Zhang, Jianxun 2023-05-12 12:32:57 -07:00 committed by Marge Bot
parent a98f246857
commit d2b6f16145

View file

@ -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); end_offset_B = MAX2(end_offset_B, slice_end_offset_B);
} }
/* Aux operates 64K at a time */ struct intel_aux_map_context *ctx = cmd_buffer->device->aux_map_ctx;
start_offset_B = ROUND_DOWN_TO(start_offset_B, 64 * 1024); /* It depends on what the purpose you use that figure from AUX module,
end_offset_B = align64(end_offset_B, 64 * 1024); * 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; 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 address = base_address + offset;
uint64_t aux_entry_addr64, *aux_entry_map; uint64_t aux_entry_addr64, *aux_entry_map;