diff --git a/.pick_status.json b/.pick_status.json index fe9bb3f7978..98d267285f6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -564,7 +564,7 @@ "description": "anv: retain ccs image binding address", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "e519e06f4b274fabf9302626c6e63d084372c1ea", "notes": null diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 3cc1fe98afe..6ead10079b2 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -1767,18 +1767,11 @@ anv_image_finish(struct anv_image *image) * mapping. */ for (int p = 0; p < image->n_planes; ++p) { - if (!image->planes[p].aux_tt.mapped) - continue; - - const struct anv_address main_addr = - anv_image_address(image, - &image->planes[p].primary_surface.memory_range); - const struct isl_surf *surf = - &image->planes[p].primary_surface.isl; - - intel_aux_map_del_mapping(device->aux_map_ctx, - anv_address_physical(main_addr), - surf->size_B); + if (image->planes[p].aux_tt.mapped) { + intel_aux_map_del_mapping(device->aux_map_ctx, + image->planes[p].aux_tt.addr, + image->planes[p].aux_tt.size); + } } if (image->from_gralloc) { @@ -2267,6 +2260,8 @@ anv_image_map_aux_tt(struct anv_device *device, anv_address_physical(main_addr), anv_address_physical(aux_addr), surf->size_B, format_bits)) { + image->planes[plane].aux_tt.addr = anv_address_physical(main_addr); + image->planes[plane].aux_tt.size = surf->size_B; image->planes[plane].aux_tt.mapped = true; return true; } diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index f35c7f25586..778d2b2c9cb 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -5019,6 +5019,12 @@ struct anv_image { struct { /** Whether the image has CCS data mapped through AUX-TT. */ bool mapped; + + /** Main address of the mapping. */ + uint64_t addr; + + /** Size of the mapping. */ + uint64_t size; } aux_tt; } planes[3];