uint32_t base_layer, uint32_t layer_count)
{
uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
- assert(isl_aux_usage_has_ccs(image->planes[plane].aux_usage));
uint64_t base_address =
anv_address_physical(image->planes[plane].address);
cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_CS_STALL_BIT;
genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer);
+ struct gen_mi_builder b;
+ gen_mi_builder_init(&b, &cmd_buffer->batch);
+
for (uint32_t a = 0; a < layer_count; a++) {
const uint32_t layer = base_layer + a;
offset < end_offset_B; offset += 64 * 1024) {
uint64_t address = base_address + offset;
- uint64_t aux_entry_address, *aux_entry_map;
+ uint64_t aux_entry_addr64, *aux_entry_map;
aux_entry_map = gen_aux_map_get_entry(cmd_buffer->device->aux_map_ctx,
- address, &aux_entry_address);
+ address, &aux_entry_addr64);
+
+ assert(cmd_buffer->device->physical->use_softpin);
+ struct anv_address aux_entry_address = {
+ .bo = NULL,
+ .offset = aux_entry_addr64,
+ };
const uint64_t old_aux_entry = READ_ONCE(*aux_entry_map);
uint64_t new_aux_entry =
- (old_aux_entry & ~GEN_AUX_MAP_FORMAT_BITS_MASK) | format_bits;
+ (old_aux_entry & GEN_AUX_MAP_ADDRESS_MASK) | format_bits;
- /* We're only going to update the top 32 bits */
- assert((uint32_t)old_aux_entry == (uint32_t)new_aux_entry);
+ if (isl_aux_usage_has_ccs(image->planes[plane].aux_usage))
+ new_aux_entry |= GEN_AUX_MAP_ENTRY_VALID_BIT;
- anv_batch_emit(&cmd_buffer->batch, GENX(MI_STORE_DATA_IMM), sdi) {
- sdi.Address = (struct anv_address) {
- .bo = NULL,
- .offset = aux_entry_address + 4,
- };
- sdi.ImmediateData = new_aux_entry >> 32;
- }
+ gen_mi_store(&b, gen_mi_mem64(aux_entry_address),
+ gen_mi_imm(new_aux_entry));
}
}
if (initial_layout == VK_IMAGE_LAYOUT_UNDEFINED ||
initial_layout == VK_IMAGE_LAYOUT_PREINITIALIZED) {
#if GEN_GEN == 12
- if (isl_aux_usage_has_ccs(image->planes[plane].aux_usage) &&
- device->physical->has_implicit_ccs && devinfo->has_aux_map) {
+ if (device->physical->has_implicit_ccs && devinfo->has_aux_map) {
anv_image_init_aux_tt(cmd_buffer, image, aspect,
base_level, level_count,
base_layer, layer_count);