anv: Set MI_MATH MOCS field

MOCS = 0 is a invalid MOCS index, so it is necessary get a valid value
and set to MI_MATH instructions.

So here the mocs index is set with mi_builder_set_mocs(), it can be
always set but it is required when mi_build will emit MI_MATH
instructions.
The mocs index will only be stored and used in gfx12.5+ platforms
so no changes were are required in crocus or hasvk.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22508>
This commit is contained in:
José Roberto de Souza
2023-07-17 14:14:38 -07:00
committed by Marge Bot
parent d0890a0b8b
commit a7ab31b96a
4 changed files with 34 additions and 3 deletions

View File

@@ -1335,6 +1335,13 @@ anv_mocs(const struct anv_device *device,
return isl_mocs(&device->isl_dev, usage, bo && bo->is_external);
}
static inline uint32_t
anv_mocs_for_address(const struct anv_device *device,
struct anv_address *addr)
{
return anv_mocs(device, addr->bo, 0);
}
void anv_device_init_blorp(struct anv_device *device);
void anv_device_finish_blorp(struct anv_device *device);