intel/tests/mi_builder: Set MI_MATH MOCS field

MOCS = 0 is a invalid MOCS index on MTL, 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:15:39 -07:00
committed by Marge Bot
parent a7ab31b96a
commit b0b763d0be
@@ -32,6 +32,7 @@
#include "common/intel_gem.h"
#include "dev/intel_device_info.h"
#include "intel_gem.h"
#include "isl/isl.h"
#include "drm-uapi/i915_drm.h"
#include "genxml/gen_macros.h"
#include "util/macros.h"
@@ -311,7 +312,11 @@ mi_builder_test::SetUp()
memset(data_map, 139, DATA_BO_SIZE);
memset(&canary, 139, sizeof(canary));
struct isl_device isl_dev;
isl_device_init(&isl_dev, &devinfo);
mi_builder_init(&b, &devinfo, this);
const uint32_t mocs = isl_mocs(&isl_dev, 0, false);
mi_builder_set_mocs(&b, mocs);
}
void *