fix: kernel access to multiple stateful virtual regions

Related-to: NEO-8350

Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:
John Falkowski
2024-04-25 06:14:39 +00:00
committed by Compute-Runtime-Automation
parent 9df35ac9bb
commit f1c2ea0b69
4 changed files with 16 additions and 33 deletions

View File

@@ -414,8 +414,8 @@ inline void EncodeStoreMMIO<Family>::encode(MI_STORE_REGISTER_MEM *cmdBuffer, ui
template <typename Family>
void EncodeSurfaceState<Family>::encodeBuffer(EncodeSurfaceStateArgs &args) {
auto surfaceState = reinterpret_cast<R_SURFACE_STATE *>(args.outMemory);
auto bufferSize = alignUp(args.size, getSurfaceBaseAddressAlignment());
uint64_t bufferSize = alignUp(args.size, getSurfaceBaseAddressAlignment());
bufferSize = std::min(bufferSize, static_cast<uint64_t>(MemoryConstants::fullStatefulRegion - 1));
SurfaceStateBufferLength length = {0};
length.length = static_cast<uint32_t>(bufferSize - 1);