Refactor: Common helper for Blit and CPU memory transfers

Change-Id: Icc61f82517e75e3066e441494af3bf9a7ffbbeef
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2020-10-09 11:52:00 +02:00
committed by sys_ocldev
parent 33ce6910c5
commit 27f9a95af2
10 changed files with 51 additions and 53 deletions

View File

@@ -908,18 +908,26 @@ HWTEST_F(HwHelperTest, whenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectVal
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.blitterOperationsSupported = true;
MockGraphicsAllocation graphicsAllocation;
graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory);
auto expectedDefaultValue = (helper.getLocalMemoryAccessMode(hwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed);
EXPECT_EQ(expectedDefaultValue, helper.isBlitCopyRequiredForLocalMemory(hwInfo));
EXPECT_EQ(expectedDefaultValue, helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation));
DebugManager.flags.ForceLocalMemoryAccessMode.set(0);
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo));
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation));
DebugManager.flags.ForceLocalMemoryAccessMode.set(1);
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo));
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation));
DebugManager.flags.ForceLocalMemoryAccessMode.set(3);
EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo));
EXPECT_TRUE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation));
hwInfo.capabilityTable.blitterOperationsSupported = false;
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo));
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation));
graphicsAllocation.overrideMemoryPool(MemoryPool::System64KBPages);
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation));
hwInfo.capabilityTable.blitterOperationsSupported = true;
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation));
}
HWTEST_F(HwHelperTest, whenPatchingGlobalBuffersThenDontForceBlitter) {
@@ -954,7 +962,10 @@ HWTEST_F(HwHelperTest, givenVariousDebugKeyValuesWhenGettingLocalMemoryAccessMod
HWTEST2_F(HwHelperTest, givenDefaultHwHelperHwWhenGettingIsBlitCopyRequiredForLocalMemoryThenFalseIsReturned, IsAtMostGen11) {
auto &helper = HwHelper::get(renderCoreFamily);
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(*defaultHwInfo));
MockGraphicsAllocation graphicsAllocation;
graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory);
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(*defaultHwInfo, graphicsAllocation));
}
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, WhenIsFusedEuDispatchEnabledIsCalledThenFalseIsReturned) {