anv: use the new relocated write mi-builder api

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29571>
This commit is contained in:
Lionel Landwerlin
2024-06-06 13:08:48 +03:00
committed by Marge Bot
parent 3e4f6def87
commit d056f36fab
3 changed files with 12 additions and 12 deletions

View File

@@ -1185,7 +1185,7 @@ anv_cmd_buffer_add_secondary(struct anv_cmd_buffer *primary,
list_first_entry(&secondary->batch_bos, struct anv_batch_bo, link);
anv_genX(primary->device->info, batch_emit_secondary_call)(
&primary->batch,
&primary->batch, primary->device,
(struct anv_address) { .bo = first_bbo->bo },
secondary->return_addr);

View File

@@ -230,6 +230,7 @@ void genX(blorp_exec)(struct blorp_batch *batch,
const struct blorp_params *params);
void genX(batch_emit_secondary_call)(struct anv_batch *batch,
struct anv_device *device,
struct anv_address secondary_addr,
struct anv_address secondary_return_addr);

View File

@@ -5844,19 +5844,17 @@ void genX(cmd_emit_timestamp)(struct anv_batch *batch,
}
void genX(batch_emit_secondary_call)(struct anv_batch *batch,
struct anv_device *device,
struct anv_address secondary_addr,
struct anv_address secondary_return_addr)
{
struct mi_builder b;
mi_builder_init(&b, device->info, batch);
mi_builder_set_mocs(&b, anv_mocs_for_address(device, &secondary_return_addr));
/* Emit a write to change the return address of the secondary */
uint64_t *write_return_addr =
anv_batch_emitn(batch,
GENX(MI_STORE_DATA_IMM_length) + 1 /* QWord write */,
GENX(MI_STORE_DATA_IMM),
#if GFX_VER >= 12
.ForceWriteCompletionCheck = true,
#endif
.Address = secondary_return_addr) +
GENX(MI_STORE_DATA_IMM_ImmediateData_start) / 8;
struct mi_reloc_imm_token reloc =
mi_store_relocated_imm(&b, mi_mem64(secondary_return_addr));
#if GFX_VER >= 12
/* Disable prefetcher before jumping into a secondary */
@@ -5876,8 +5874,9 @@ void genX(batch_emit_secondary_call)(struct anv_batch *batch,
/* Replace the return address written by the MI_STORE_DATA_IMM above with
* the primary's current batch address (immediately after the jump).
*/
*write_return_addr =
anv_address_physical(anv_batch_current_address(batch));
mi_relocate_store_imm(reloc,
anv_address_physical(
anv_batch_current_address(batch)));
}
void *