Use appropriate DwordLength in MI_STORE_DATA_IMM command

Change-Id: I2d5a07e511f15e28acd6d0dfe7b84fac6dd8e9a3
Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
Pawel Wilma
2020-09-14 12:43:21 +02:00
committed by sys_ocldev
parent c9efc11f8d
commit b54a5a795a
2 changed files with 41 additions and 1 deletions

View File

@@ -162,10 +162,12 @@ char *FlatBatchBufferHelperHw<GfxFamily>::getIndirectPatchCommands(size_t &indir
for (auto &patchInfoData : patchInfoCopy) {
if (patchInfoData.requiresIndirectPatching()) {
bool is32BitAddress = patchInfoData.patchAddressSize == sizeof(uint32_t);
auto storeDataImmediate = indirectPatchCommandStream.getSpaceForCmd<MI_STORE_DATA_IMM>();
*storeDataImmediate = GfxFamily::cmdInitStoreDataImm;
storeDataImmediate->setAddress(patchInfoData.targetAllocation + patchInfoData.targetAllocationOffset);
storeDataImmediate->setStoreQword(patchInfoData.patchAddressSize != sizeof(uint32_t));
storeDataImmediate->setStoreQword(!is32BitAddress);
storeDataImmediate->setDwordLength(is32BitAddress ? MI_STORE_DATA_IMM::DWORD_LENGTH::DWORD_LENGTH_STORE_DWORD : MI_STORE_DATA_IMM::DWORD_LENGTH::DWORD_LENGTH_STORE_QWORD);
storeDataImmediate->setDataDword0(static_cast<uint32_t>((patchInfoData.sourceAllocation + patchInfoData.sourceAllocationOffset) & 0x0000FFFFFFFFULL));
storeDataImmediate->setDataDword1(static_cast<uint32_t>((patchInfoData.sourceAllocation + patchInfoData.sourceAllocationOffset) >> 32));