Make BUFFER allocation lockable on DG1

Related-To: NEO-5733
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski 2021-05-13 19:42:16 +00:00 committed by Compute-Runtime-Automation
parent e605efb88e
commit ed31aaedb8
3 changed files with 16 additions and 0 deletions

View File

@ -108,3 +108,13 @@ DG1TEST_F(HwHelperTestDg1, givenDg1WhenGettingLocalMemoryAccessModeThenReturnCpu
EXPECT_EQ(LocalMemoryAccessMode::Default, hwHelper.getDefaultLocalMemoryAccessMode(*defaultHwInfo));
}
DG1TEST_F(HwHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationDataIsCalledThenIsLockableIsSet) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
AllocationData allocData{};
allocData.flags.useSystemMemory = true;
AllocationProperties allocProperties(0, 1, GraphicsAllocation::AllocationType::BUFFER, {});
allocData.storageInfo.isLockable = false;
hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo);
EXPECT_TRUE(allocData.storageInfo.isLockable);
}

View File

@ -291,6 +291,11 @@ void HwHelperHw<TGLLPFamily>::setExtraAllocationData(AllocationData &allocationD
allocationData.flags.useSystemMemory = true;
}
}
if (IGFX_DG1 == hwInfo.platform.eProductFamily) {
if (properties.allocationType == GraphicsAllocation::AllocationType::BUFFER) {
allocationData.storageInfo.isLockable = true;
}
}
}
template class HwHelperHw<Family>;

View File

@ -12,5 +12,6 @@ struct StorageInfo {
uint32_t getNumBanks() const;
uint32_t getMemoryBanks() const { return 0u; }
bool multiStorage = false;
bool isLockable = false;
};
} // namespace NEO