diff --git a/shared/source/xe_hp_core/command_stream_receiver_hw_xe_hp_core.cpp b/shared/source/xe_hp_core/command_stream_receiver_hw_xe_hp_core.cpp index a17243e61c..225e9de39a 100644 --- a/shared/source/xe_hp_core/command_stream_receiver_hw_xe_hp_core.cpp +++ b/shared/source/xe_hp_core/command_stream_receiver_hw_xe_hp_core.cpp @@ -98,7 +98,8 @@ void BlitCommandsHelper::appendExtraMemoryProperties(typename Family::XY auto &hwHelper = HwHelperHw::get(); const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo->platform.eProductFamily); - if (hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, *hwInfo) && hwInfoConfig.getLocalMemoryAccessMode(*hwInfo) == LocalMemoryAccessMode::CpuAccessAllowed) { + if (hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, *hwInfo) && + hwInfoConfig.getLocalMemoryAccessMode(*hwInfo) == LocalMemoryAccessMode::CpuAccessAllowed) { blitCmd.setSourceTargetMemory(XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM); blitCmd.setDestinationTargetMemory(XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM); } diff --git a/shared/test/common/helpers/blit_commands_helper_tests.cpp b/shared/test/common/helpers/blit_commands_helper_tests.cpp index 677f249432..3ce396552f 100644 --- a/shared/test/common/helpers/blit_commands_helper_tests.cpp +++ b/shared/test/common/helpers/blit_commands_helper_tests.cpp @@ -346,6 +346,15 @@ HWTEST_F(BlitTests, givenMemorySizeIsLessThanTwicenMaxWidthWhenFillPatternWithBl } } +HWTEST_F(BlitTests, givenXyCopyBltCommandWhenAppendBlitCommandsMemCopyIsCalledThenNothingChanged) { + using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; + auto bltCmd = FamilyType::cmdInitXyCopyBlt; + auto bltCmdBefore = bltCmd; + BlitProperties properties = {}; + NEO::BlitCommandsHelper::appendBlitCommandsMemCopy(properties, bltCmd, pDevice->getRootDeviceEnvironment()); + EXPECT_EQ(memcmp(&bltCmd, &bltCmdBefore, sizeof(XY_COPY_BLT)), 0); +} + using BlitColor = IsWithinProducts; HWTEST2_F(BlitTests, givenMemoryWhenFillPatternSizeIs4BytesThen32BitMaskISSetCorrectly, BlitColor) { diff --git a/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp b/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp index fa19fcea5e..88dacf3de2 100644 --- a/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp +++ b/shared/test/common/helpers/test_blit_commands_helper_xehp_and_later.cpp @@ -336,7 +336,7 @@ INSTANTIATE_TEST_CASE_P(size_t, 8, 16)); -HWTEST2_F(BlitTests, givenOneBytePerPixelWhenAppendColrDepthThenCorrectDepthIsSet, IsXeHpCore) { +HWTEST2_F(BlitTests, givenOneBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) { using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT; auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt; BlitProperties properties = {}; @@ -345,7 +345,7 @@ HWTEST2_F(BlitTests, givenOneBytePerPixelWhenAppendColrDepthThenCorrectDepthIsSe EXPECT_EQ(bltCmd.getColorDepth(), XY_BLOCK_COPY_BLT::COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR); } -HWTEST2_F(BlitTests, givenTwoBytePerPixelWhenAppendColrDepthThenCorrectDepthIsSet, IsXeHpCore) { +HWTEST2_F(BlitTests, givenTwoBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) { using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT; auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt; BlitProperties properties = {}; @@ -354,7 +354,7 @@ HWTEST2_F(BlitTests, givenTwoBytePerPixelWhenAppendColrDepthThenCorrectDepthIsSe EXPECT_EQ(bltCmd.getColorDepth(), XY_BLOCK_COPY_BLT::COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR); } -HWTEST2_F(BlitTests, givenFourBytePerPixelWhenAppendColrDepthThenCorrectDepthIsSet, IsXeHpCore) { +HWTEST2_F(BlitTests, givenFourBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) { using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT; auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt; BlitProperties properties = {}; @@ -363,7 +363,7 @@ HWTEST2_F(BlitTests, givenFourBytePerPixelWhenAppendColrDepthThenCorrectDepthIsS EXPECT_EQ(bltCmd.getColorDepth(), XY_BLOCK_COPY_BLT::COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR); } -HWTEST2_F(BlitTests, givenEightBytePerPixelWhenAppendColrDepthThenCorrectDepthIsSet, IsXeHpCore) { +HWTEST2_F(BlitTests, givenEightBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) { using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT; auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt; BlitProperties properties = {}; @@ -372,7 +372,7 @@ HWTEST2_F(BlitTests, givenEightBytePerPixelWhenAppendColrDepthThenCorrectDepthIs EXPECT_EQ(bltCmd.getColorDepth(), XY_BLOCK_COPY_BLT::COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR); } -HWTEST2_F(BlitTests, givenSixteenBytePerPixelWhenAppendColrDepthThenCorrectDepthIsSet, IsXeHpCore) { +HWTEST2_F(BlitTests, givenSixteenBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) { using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT; auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt; BlitProperties properties = {}; @@ -381,7 +381,7 @@ HWTEST2_F(BlitTests, givenSixteenBytePerPixelWhenAppendColrDepthThenCorrectDepth EXPECT_EQ(bltCmd.getColorDepth(), XY_BLOCK_COPY_BLT::COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR); } -HWTEST2_F(BlitTests, givenIncorrectBytePerPixelWhenAppendColrDepthThenCorrectDepthIsSet, IsXeHpCore) { +HWTEST2_F(BlitTests, givenIncorrectBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) { using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT; auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt; BlitProperties properties = {}; @@ -610,6 +610,29 @@ HWTEST2_F(BlitTests, givenGmmParamsWhenGetBlitAllocationPropertiesIsCalledThenCo } } +HWTEST2_F(BlitTests, givenA0orA1SteppingAndCpuLocalMemoryAccessWhenCallingAppendExtraMemoryPropertiesThenTargetMemoryIsSet, IsXeHpCore) { + using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT; + DebugManagerStateRestore dbgRestore; + DebugManager.flags.ForceLocalMemoryAccessMode.set(1); + + const auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment(); + auto hwInfoConfig = HwInfoConfig::get(productFamily); + std::array, 3> testParams = { + {{REVISION_A0, XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM}, + {REVISION_A1, XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM}, + {REVISION_B, XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM}}}; + + for (const auto &[revision, expectedTargetMemory] : testParams) { + auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt; + auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo(); + hwInfo->platform.usRevId = hwInfoConfig->getHwRevIdFromStepping(revision, *hwInfo); + + BlitCommandsHelper::appendExtraMemoryProperties(bltCmd, rootDeviceEnvironment); + EXPECT_EQ(bltCmd.getSourceTargetMemory(), expectedTargetMemory); + EXPECT_EQ(bltCmd.getDestinationTargetMemory(), expectedTargetMemory); + } +} + struct MyMockResourecInfo : public GmmResourceInfo { using GmmResourceInfo::resourceInfo; diff --git a/shared/test/common/xe_hpc_core/excludes_xe_hpc_core.cpp b/shared/test/common/xe_hpc_core/excludes_xe_hpc_core.cpp index 606fecd4f0..ad432b8421 100644 --- a/shared/test/common/xe_hpc_core/excludes_xe_hpc_core.cpp +++ b/shared/test/common/xe_hpc_core/excludes_xe_hpc_core.cpp @@ -21,3 +21,4 @@ HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeCmdSizeWhenLarge HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeProgrammingWhenLargeGrfModeChangeIsRequiredThenCorrectCommandsAreAdded_ForceNonCoherentSupportedMatcher, IGFX_XE_HPC_CORE); HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeProgrammingWhenRequiredGRFNumberIsLowerThan128ThenSmallGRFModeIsProgrammed_ForceNonCoherentSupportedMatcher, IGFX_XE_HPC_CORE); HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeProgrammingWhenRequiredGRFNumberIsGreaterThan128ThenLargeGRFModeIsProgrammed_ForceNonCoherentSupportedMatcher, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(BlitTests, givenXyCopyBltCommandWhenAppendBlitCommandsMemCopyIsCalledThenNothingChanged, IGFX_XE_HPC_CORE);