anv: use heap size to program generate state heap

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32895>
This commit is contained in:
Lionel Landwerlin 2025-01-06 09:30:55 +02:00 committed by Marge Bot
parent ddf64a7d95
commit 26347b4876
2 changed files with 8 additions and 2 deletions

View file

@ -103,7 +103,10 @@ fill_state_base_addr(struct anv_cmd_buffer *cmd_buffer,
sba->GeneralStateBaseAddress = (struct anv_address) { NULL, 0 };
sba->GeneralStateMOCS = mocs;
sba->GeneralStateBufferSize = 0xfffff;
sba->GeneralStateBufferSize = DIV_ROUND_UP(
device->physical->va.first_2mb.size +
device->physical->va.general_state_pool.size +
device->physical->va.low_heap.size, 4096);
sba->GeneralStateBaseAddressModifyEnable = true;
sba->GeneralStateBufferSizeModifyEnable = true;

View file

@ -248,7 +248,10 @@ init_common_queue_state(struct anv_queue *queue, struct anv_batch *batch)
uint32_t mocs = device->isl_dev.mocs.internal;
anv_batch_emit(batch, GENX(STATE_BASE_ADDRESS), sba) {
sba.GeneralStateBaseAddress = (struct anv_address) { NULL, 0 };
sba.GeneralStateBufferSize = 0xfffff;
sba.GeneralStateBufferSize = DIV_ROUND_UP(
device->physical->va.first_2mb.size +
device->physical->va.general_state_pool.size +
device->physical->va.low_heap.size, 4096);
sba.GeneralStateMOCS = mocs;
sba.GeneralStateBaseAddressModifyEnable = true;
sba.GeneralStateBufferSizeModifyEnable = true;