anv: Set L3 full way allocation at context init if L3 cfg is NULL

If the platform's default L3 config is NULL, then it now gets
initialized only at context init time, and cmd_buffer_config_l3 will
always return immediately.

Rework:
 * Remove unneeded check on !cfg in cmd_buffer_config_l3 (Jason)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4956>
This commit is contained in:
Jordan Justen
2020-06-12 03:02:02 -07:00
parent e2e0521ecb
commit 633dec7163
2 changed files with 15 additions and 1 deletions

View File

@@ -1804,7 +1804,7 @@ void
genX(cmd_buffer_config_l3)(struct anv_cmd_buffer *cmd_buffer,
const struct gen_l3_config *cfg)
{
assert(cfg);
assert(cfg || GEN_GEN >= 12);
if (cfg == cmd_buffer->state.current_l3_config)
return;

View File

@@ -294,6 +294,20 @@ genX(init_device_state)(struct anv_device *device)
#endif
}
#if GEN_GEN >= 12
const struct gen_l3_config *cfg = gen_get_default_l3_config(&device->info);
if (!cfg) {
/* Platforms with no configs just setup full-way allocation. */
uint32_t l3cr;
anv_pack_struct(&l3cr, GENX(L3ALLOC),
.L3FullWayAllocationEnable = true);
anv_batch_emit(&batch, GENX(MI_LOAD_REGISTER_IMM), lri) {
lri.RegisterOffset = GENX(L3ALLOC_num);
lri.DataDWord = l3cr;
}
}
#endif
anv_batch_emit(&batch, GENX(MI_BATCH_BUFFER_END), bbe);
assert(batch.next <= batch.end);