set islockable only for non shareable memory

-Fix gen12 helper to only set islockable on the storage if
the allocation is not shareable.

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
This commit is contained in:
Spruit, Neil R
2022-02-02 19:46:25 +00:00
committed by Compute-Runtime-Automation
parent 593756bee0
commit cbdf324a70
2 changed files with 14 additions and 2 deletions

View File

@ -61,6 +61,18 @@ DG1TEST_F(HwHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationDataIs
allocData.flags.useSystemMemory = true;
AllocationProperties allocProperties(0, 1, GraphicsAllocation::AllocationType::BUFFER, {});
allocData.storageInfo.isLockable = false;
allocProperties.flags.shareable = false;
hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo);
EXPECT_TRUE(allocData.storageInfo.isLockable);
}
DG1TEST_F(HwHelperTestDg1, givenBufferAllocationTypeWhenSetExtraAllocationDataIsCalledWithShareableSetThenIsLockableIsFalse) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
AllocationData allocData{};
allocData.flags.useSystemMemory = true;
AllocationProperties allocProperties(0, 1, GraphicsAllocation::AllocationType::BUFFER, {});
allocData.storageInfo.isLockable = false;
allocProperties.flags.shareable = true;
hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo);
EXPECT_FALSE(allocData.storageInfo.isLockable);
}