mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 10:26:29 +08:00
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:
committed by
sys_ocldev
parent
33ce6910c5
commit
27f9a95af2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user