From cf544115eeab656ee02b0d20723457ee60c88304 Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Mon, 28 Nov 2022 17:48:41 +0000 Subject: [PATCH] HwInfoConfigTests cleanup Related-To: NEO-6853 Signed-off-by: Kamil Kopryk Use HwInfoConfigTest fixture --- .../test/unit_test/gen11/icllp/CMakeLists.txt | 5 +- .../gen11/icllp/excludes_gen11_icllp.cpp | 6 +- .../unit_test/gen12lp/adlp/CMakeLists.txt | 5 +- .../unit_test/gen12lp/adlp/excludes_adlp.cpp | 2 +- .../gen12lp/dg1/excludes_gen12lp_dg1.cpp | 12 +- .../gen12lp/rkl/excludes_gen12lp_rkl.cpp | 4 +- .../gen12lp/tgllp/excludes_gen12lp_tgllp.cpp | 8 +- .../gen9/cfl/test_hw_info_config_cfl.cpp | 2 +- .../gen9/kbl/test_hw_info_config_kbl.cpp | 2 +- .../gen9/skl/test_hw_info_config_skl.cpp | 2 +- shared/test/unit_test/helpers/CMakeLists.txt | 1 - .../helpers/compiler_hw_info_config_tests.cpp | 53 ++ .../unit_test/helpers/hw_helper_tests.cpp | 30 ++ .../unit_test/helpers/test_hw_info_config.cpp | 229 --------- .../os_interface/hw_info_config_tests.cpp | 453 +++++++++++------- .../linux/hw_info_config_linux_tests.cpp | 154 +++--- .../windows/hw_info_config_win_tests.cpp | 25 +- .../xe_hpc_core/excludes_xe_hpc_core.cpp | 24 +- .../pvc/excludes_xe_hpc_core_pvc.cpp | 2 +- .../pvc/linux/hw_info_config_tests_pvc.cpp | 2 +- .../dg2/excludes_xe_hpg_core_dg2.cpp | 26 +- .../xe_hpg_core/excludes_xe_hpg_core.cpp | 8 +- 22 files changed, 506 insertions(+), 549 deletions(-) delete mode 100644 shared/test/unit_test/helpers/test_hw_info_config.cpp diff --git a/shared/test/unit_test/gen11/icllp/CMakeLists.txt b/shared/test/unit_test/gen11/icllp/CMakeLists.txt index 5bf1ef1cc2..be95b80017 100644 --- a/shared/test/unit_test/gen11/icllp/CMakeLists.txt +++ b/shared/test/unit_test/gen11/icllp/CMakeLists.txt @@ -5,7 +5,10 @@ # if(TESTS_ICLLP) - set(NEO_SHARED_tests_gen11_icllp ${CMAKE_CURRENT_SOURCE_DIR}/excludes_gen11_icllp.cpp) + set(IGDRCL_SRCS_tests_gen11_icllp_excludes ${CMAKE_CURRENT_SOURCE_DIR}/excludes_gen11_icllp.cpp) + set_property(GLOBAL APPEND PROPERTY IGDRCL_SRCS_tests_excludes ${IGDRCL_SRCS_tests_gen11_icllp_excludes}) + + set(NEO_SHARED_tests_gen11_icllp ${IGDRCL_SRCS_tests_gen11_icllp_excludes}) target_sources(neo_shared_tests PRIVATE ${NEO_SHARED_tests_gen11_icllp} diff --git a/shared/test/unit_test/gen11/icllp/excludes_gen11_icllp.cpp b/shared/test/unit_test/gen11/icllp/excludes_gen11_icllp.cpp index f608ca6821..e2bdb191e3 100644 --- a/shared/test/unit_test/gen11/icllp/excludes_gen11_icllp.cpp +++ b/shared/test/unit_test/gen11/icllp/excludes_gen11_icllp.cpp @@ -7,6 +7,6 @@ #include "shared/test/common/test_macros/hw_test_base.h" -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfAdditionalMediaSamplerProgrammingIsRequiredThenFalseIsReturned, IGFX_ICELAKE_LP) -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfInitialFlagsProgrammingIsRequiredThenFalseIsReturned, IGFX_ICELAKE_LP) -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfReturnedCmdSizeForMediaSamplerAdjustmentIsRequiredThenFalseIsReturned, IGFX_ICELAKE_LP) +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfAdditionalMediaSamplerProgrammingIsRequiredThenFalseIsReturned, IGFX_ICELAKE_LP) +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfInitialFlagsProgrammingIsRequiredThenFalseIsReturned, IGFX_ICELAKE_LP) +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfReturnedCmdSizeForMediaSamplerAdjustmentIsRequiredThenFalseIsReturned, IGFX_ICELAKE_LP) diff --git a/shared/test/unit_test/gen12lp/adlp/CMakeLists.txt b/shared/test/unit_test/gen12lp/adlp/CMakeLists.txt index 4ac548fd7a..7f8078d2e2 100644 --- a/shared/test/unit_test/gen12lp/adlp/CMakeLists.txt +++ b/shared/test/unit_test/gen12lp/adlp/CMakeLists.txt @@ -5,10 +5,13 @@ # if(TESTS_ADLP) + set(IGDRCL_SRCS_tests_gen12lp_adlp_excludes ${CMAKE_CURRENT_SOURCE_DIR}/excludes_adlp.cpp) + set_property(GLOBAL APPEND PROPERTY IGDRCL_SRCS_tests_excludes ${IGDRCL_SRCS_tests_gen12lp_adlp_excludes}) + target_sources(neo_shared_tests PRIVATE + ${IGDRCL_SRCS_tests_gen12lp_adlp_excludes} ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_hw_tests_adlp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/excludes_adlp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/preamble_helper_tests_adlp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_adlp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_adlp.cpp diff --git a/shared/test/unit_test/gen12lp/adlp/excludes_adlp.cpp b/shared/test/unit_test/gen12lp/adlp/excludes_adlp.cpp index 3f61b68044..0a13195070 100644 --- a/shared/test/unit_test/gen12lp/adlp/excludes_adlp.cpp +++ b/shared/test/unit_test/gen12lp/adlp/excludes_adlp.cpp @@ -7,5 +7,5 @@ #include "shared/test/common/test_macros/hw_test_base.h" -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsSystolicModeConfigurabledThenFalseIsReturned, IGFX_ALDERLAKE_P); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsSystolicModeConfigurabledThenFalseIsReturned, IGFX_ALDERLAKE_P); HWTEST_EXCLUDE_PRODUCT(PreambleTest, WhenIsSystolicModeConfigurableThenReturnFalse, IGFX_ALDERLAKE_P); diff --git a/shared/test/unit_test/gen12lp/dg1/excludes_gen12lp_dg1.cpp b/shared/test/unit_test/gen12lp/dg1/excludes_gen12lp_dg1.cpp index b990eb51cb..19c3e38ceb 100644 --- a/shared/test/unit_test/gen12lp/dg1/excludes_gen12lp_dg1.cpp +++ b/shared/test/unit_test/gen12lp/dg1/excludes_gen12lp_dg1.cpp @@ -7,9 +7,9 @@ #include "shared/test/common/test_macros/hw_test_base.h" -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPipeControlWAIsRequiredThenFalseIsReturned, IGFX_DG1); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfImagePitchAlignmentWAIsRequiredThenFalseIsReturned, IGFX_DG1); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfForceEmuInt32DivRemSPWAIsRequiredThenFalseIsReturned, IGFX_DG1); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIf3DPipelineSelectWAIsRequiredThenFalseIsReturned, IGFX_DG1); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfStorageInfoAdjustmentIsRequiredThenFalseIsReturned, IGFX_DG1); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenOverrideGfxPartitionLayoutForWslThenReturnFalse, IGFX_DG1); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPipeControlWAIsRequiredThenFalseIsReturned, IGFX_DG1); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfImagePitchAlignmentWAIsRequiredThenFalseIsReturned, IGFX_DG1); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfForceEmuInt32DivRemSPWAIsRequiredThenFalseIsReturned, IGFX_DG1); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIf3DPipelineSelectWAIsRequiredThenFalseIsReturned, IGFX_DG1); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfStorageInfoAdjustmentIsRequiredThenFalseIsReturned, IGFX_DG1); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenOverrideGfxPartitionLayoutForWslThenReturnFalse, IGFX_DG1); diff --git a/shared/test/unit_test/gen12lp/rkl/excludes_gen12lp_rkl.cpp b/shared/test/unit_test/gen12lp/rkl/excludes_gen12lp_rkl.cpp index 3d0d6a6c5b..2a34c85689 100644 --- a/shared/test/unit_test/gen12lp/rkl/excludes_gen12lp_rkl.cpp +++ b/shared/test/unit_test/gen12lp/rkl/excludes_gen12lp_rkl.cpp @@ -7,6 +7,6 @@ #include "shared/test/common/test_macros/hw_test_base.h" -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfForceEmuInt32DivRemSPWAIsRequiredThenFalseIsReturned, IGFX_ROCKETLAKE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIf3DPipelineSelectWAIsRequiredThenFalseIsReturned, IGFX_ROCKETLAKE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfForceEmuInt32DivRemSPWAIsRequiredThenFalseIsReturned, IGFX_ROCKETLAKE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIf3DPipelineSelectWAIsRequiredThenFalseIsReturned, IGFX_ROCKETLAKE); HWTEST_EXCLUDE_PRODUCT(AubCenterTests, whenCreatingAubManagerThenCorrectProductFamilyIsPassed, IGFX_ROCKETLAKE); diff --git a/shared/test/unit_test/gen12lp/tgllp/excludes_gen12lp_tgllp.cpp b/shared/test/unit_test/gen12lp/tgllp/excludes_gen12lp_tgllp.cpp index f990dda571..c20081a666 100644 --- a/shared/test/unit_test/gen12lp/tgllp/excludes_gen12lp_tgllp.cpp +++ b/shared/test/unit_test/gen12lp/tgllp/excludes_gen12lp_tgllp.cpp @@ -7,7 +7,7 @@ #include "shared/test/common/test_macros/hw_test_base.h" -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPipeControlWAIsRequiredThenFalseIsReturned, IGFX_TIGERLAKE_LP); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfImagePitchAlignmentWAIsRequiredThenFalseIsReturned, IGFX_TIGERLAKE_LP); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfForceEmuInt32DivRemSPWAIsRequiredThenFalseIsReturned, IGFX_TIGERLAKE_LP); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIf3DPipelineSelectWAIsRequiredThenFalseIsReturned, IGFX_TIGERLAKE_LP); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPipeControlWAIsRequiredThenFalseIsReturned, IGFX_TIGERLAKE_LP); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfImagePitchAlignmentWAIsRequiredThenFalseIsReturned, IGFX_TIGERLAKE_LP); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfForceEmuInt32DivRemSPWAIsRequiredThenFalseIsReturned, IGFX_TIGERLAKE_LP); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIf3DPipelineSelectWAIsRequiredThenFalseIsReturned, IGFX_TIGERLAKE_LP); diff --git a/shared/test/unit_test/gen9/cfl/test_hw_info_config_cfl.cpp b/shared/test/unit_test/gen9/cfl/test_hw_info_config_cfl.cpp index 531e262c96..4e1cbdcce8 100644 --- a/shared/test/unit_test/gen9/cfl/test_hw_info_config_cfl.cpp +++ b/shared/test/unit_test/gen9/cfl/test_hw_info_config_cfl.cpp @@ -20,7 +20,7 @@ using namespace NEO; using CflProductHelper = HwInfoConfigTest; -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenGettingDefaultRevisionIdThenZeroIsReturned, IGFX_COFFEELAKE) +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenGettingDefaultRevisionIdThenZeroIsReturned, IGFX_COFFEELAKE) CFLTEST_F(CflProductHelper, whenGettingDefaultRevisionIdThen9IsReturned) { EXPECT_EQ(9u, productHelper->getDefaultRevisionId()); } diff --git a/shared/test/unit_test/gen9/kbl/test_hw_info_config_kbl.cpp b/shared/test/unit_test/gen9/kbl/test_hw_info_config_kbl.cpp index bc2ed3e288..270aa2fb8a 100644 --- a/shared/test/unit_test/gen9/kbl/test_hw_info_config_kbl.cpp +++ b/shared/test/unit_test/gen9/kbl/test_hw_info_config_kbl.cpp @@ -18,7 +18,7 @@ using namespace NEO; using KblProductHelper = HwInfoConfigTest; -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenGettingDefaultRevisionIdThenZeroIsReturned, IGFX_KABYLAKE) +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenGettingDefaultRevisionIdThenZeroIsReturned, IGFX_KABYLAKE) KBLTEST_F(KblProductHelper, whenGettingDefaultRevisionIdThen9IsReturned) { EXPECT_EQ(9u, productHelper->getDefaultRevisionId()); } diff --git a/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp b/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp index f31a28a596..1490078fc0 100644 --- a/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp +++ b/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp @@ -18,7 +18,7 @@ using namespace NEO; using SklProductHelper = HwInfoConfigTest; -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenGettingDefaultRevisionIdThenZeroIsReturned, IGFX_SKYLAKE) +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenGettingDefaultRevisionIdThenZeroIsReturned, IGFX_SKYLAKE) SKLTEST_F(SklProductHelper, whenGettingDefaultRevisionIdThen9IsReturned) { EXPECT_EQ(9u, productHelper->getDefaultRevisionId()); } diff --git a/shared/test/unit_test/helpers/CMakeLists.txt b/shared/test/unit_test/helpers/CMakeLists.txt index 8c0de38d6a..8449c50ad7 100644 --- a/shared/test/unit_test/helpers/CMakeLists.txt +++ b/shared/test/unit_test/helpers/CMakeLists.txt @@ -46,7 +46,6 @@ target_sources(neo_shared_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/string_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/string_to_hash_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_debug_variables.inl - ${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config.cpp ${CMAKE_CURRENT_SOURCE_DIR}/timestamp_packet_tests.cpp ) diff --git a/shared/test/unit_test/helpers/compiler_hw_info_config_tests.cpp b/shared/test/unit_test/helpers/compiler_hw_info_config_tests.cpp index cedcb5b545..3d6cfc7341 100644 --- a/shared/test/unit_test/helpers/compiler_hw_info_config_tests.cpp +++ b/shared/test/unit_test/helpers/compiler_hw_info_config_tests.cpp @@ -44,3 +44,56 @@ HWTEST2_F(CompilerHwInfoConfigFixture, GivenXeHpcAndLaterWhenIsForceToStatelessR DebugManager.flags.DisableForceToStateless.set(true); EXPECT_FALSE(compilerHwInfoConfig.isForceToStatelessRequired()); } + +HWTEST2_F(CompilerHwInfoConfigFixture, givenAotConfigWhenSetHwInfoRevisionIdThenCorrectValueIsSet, IsAtMostDg2) { + auto hwInfo = *defaultHwInfo; + auto &productHelper = getHelper(); + auto productConfig = productHelper.getProductConfigFromHwInfo(*defaultHwInfo); + AheadOfTimeConfig aotConfig = {0}; + aotConfig.ProductConfig = productConfig; + CompilerHwInfoConfig::get(hwInfo.platform.eProductFamily)->setProductConfigForHwInfo(hwInfo, aotConfig); + EXPECT_EQ(hwInfo.platform.usRevId, aotConfig.ProductConfigID.Revision); +} + +HWTEST2_F(CompilerHwInfoConfigFixture, givenAtMostXeHPWhenGetCachingPolicyOptionsThenReturnNullptr, IsAtMostXeHpCore) { + auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); + EXPECT_EQ(compilerHwInfoConfig->getCachingPolicyOptions(false), nullptr); + EXPECT_EQ(compilerHwInfoConfig->getCachingPolicyOptions(true), nullptr); +} + +HWTEST2_F(CompilerHwInfoConfigFixture, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteByPassPolicyOption, IsAtLeastXeHpgCore) { + auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); + const char *expectedStr = "-cl-store-cache-default=2 -cl-load-cache-default=4"; + EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr))); + EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr))); +} + +HWTEST2_F(CompilerHwInfoConfigFixture, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteBackPolicyOption, IsAtLeastXeHpgCore) { + DebugManagerStateRestore restorer; + DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2); + + auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); + const char *expectedStr = "-cl-store-cache-default=7 -cl-load-cache-default=4"; + EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr))); + EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr))); +} + +HWTEST2_F(CompilerHwInfoConfigFixture, givenAtLeastXeHpgCoreAndDebugFlagSetForceAllResourcesUncachedWhenGetCachingPolicyOptionsThenReturnUncachedPolicyOption, IsAtLeastXeHpgCore) { + DebugManagerStateRestore restorer; + DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2); + DebugManager.flags.ForceAllResourcesUncached.set(true); + + auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); + const char *expectedStr = "-cl-store-cache-default=1 -cl-load-cache-default=1"; + EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr))); + EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr))); +} + +HWTEST2_F(CompilerHwInfoConfigFixture, givenCachePolicyWithoutCorrespondingBuildOptionWhenGetCachingPolicyOptionsThenReturnNullptr, IsAtLeastXeHpgCore) { + DebugManagerStateRestore restorer; + DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(5); + + auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); + EXPECT_EQ(nullptr, compilerHwInfoConfig->getCachingPolicyOptions(false)); + EXPECT_EQ(nullptr, compilerHwInfoConfig->getCachingPolicyOptions(true)); +} diff --git a/shared/test/unit_test/helpers/hw_helper_tests.cpp b/shared/test/unit_test/helpers/hw_helper_tests.cpp index 142eeeacfb..7dc01a6d52 100644 --- a/shared/test/unit_test/helpers/hw_helper_tests.cpp +++ b/shared/test/unit_test/helpers/hw_helper_tests.cpp @@ -1329,6 +1329,36 @@ HWTEST_F(HwHelperTest, givenHwHelperWhenPassingComputeEngineTypeThenItsNotCopyOn EXPECT_FALSE(EngineHelper::isCopyOnlyEngineType(EngineGroupType::Compute)); } +HWTEST2_F(HwHelperTest, givenHwHelperWhenCallCopyThroughLockedPtrEnabledThenReturnFalse, IsNotXeHpgOrXeHpcCore) { + HwHelper &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); + EXPECT_FALSE(hwHelper.copyThroughLockedPtrEnabled(*defaultHwInfo)); +} + +HWTEST2_F(HwHelperTest, givenHwHelperWhenCallGetAmountOfAllocationsToFillThenReturnFalse, IsNotXeHpcCore) { + HwHelper &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); + EXPECT_EQ(hwHelper.getAmountOfAllocationsToFill(), 0u); +} + +HWTEST_F(HwHelperTest, givenHwHelperWhenFlagSetAndCallCopyThroughLockedPtrEnabledThenReturnCorrectValue) { + DebugManagerStateRestore restorer; + HwHelper &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); + DebugManager.flags.ExperimentalCopyThroughLock.set(0); + EXPECT_FALSE(hwHelper.copyThroughLockedPtrEnabled(*defaultHwInfo)); + + DebugManager.flags.ExperimentalCopyThroughLock.set(1); + EXPECT_TRUE(hwHelper.copyThroughLockedPtrEnabled(*defaultHwInfo)); +} + +HWTEST_F(HwHelperTest, givenHwHelperWhenFlagSetAndCallGetAmountOfAllocationsToFillThenReturnCorrectValue) { + DebugManagerStateRestore restorer; + HwHelper &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); + DebugManager.flags.SetAmountOfReusableAllocations.set(0); + EXPECT_EQ(hwHelper.getAmountOfAllocationsToFill(), 0u); + + DebugManager.flags.SetAmountOfReusableAllocations.set(1); + EXPECT_EQ(hwHelper.getAmountOfAllocationsToFill(), 1u); +} + using LogicalStateHelperTest = ::testing::Test; HWTEST_F(LogicalStateHelperTest, whenCreatingLogicalStateHelperThenReturnNullptr) { diff --git a/shared/test/unit_test/helpers/test_hw_info_config.cpp b/shared/test/unit_test/helpers/test_hw_info_config.cpp deleted file mode 100644 index 2b85a18ec0..0000000000 --- a/shared/test/unit_test/helpers/test_hw_info_config.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (C) 2022 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/helpers/compiler_hw_info_config.h" -#include "shared/source/helpers/hw_helper.h" -#include "shared/source/os_interface/hw_info_config.h" -#include "shared/test/common/helpers/debug_manager_state_restore.h" -#include "shared/test/common/test_macros/test.h" -#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" - -#include "platforms.h" - -using namespace NEO; - -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsAdjustProgrammableIdPreferredSlmSizeRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isAdjustProgrammableIdPreferredSlmSizeRequired(*defaultHwInfo)); -} - -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsComputeDispatchAllWalkerEnableInCfeStateRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isComputeDispatchAllWalkerEnableInCfeStateRequired(*defaultHwInfo)); -} - -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsComputeDispatchAllWalkerEnableInComputeWalkerRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isComputeDispatchAllWalkerEnableInComputeWalkerRequired(*defaultHwInfo)); -} - -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsGlobalFenceInCommandStreamRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isGlobalFenceInCommandStreamRequired(*defaultHwInfo)); -} - -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsSystolicModeConfigurabledThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isSystolicModeConfigurable(*defaultHwInfo)); -} - -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenGetThreadEuRatioForScratchThen8IsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_EQ(8u, hwInfoConfig.getThreadEuRatioForScratch(*defaultHwInfo)); -} - -HWTEST_F(HwInfoConfigTest, givenDefaultSettingWhenIsGrfNumReportedIsCalledThenScmSupportProductValueIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_EQ(hwInfoConfig.getScmPropertyLargeGrfModeSupport(), hwInfoConfig.isGrfNumReportedWithScm()); -} - -HWTEST_F(HwInfoConfigTest, givenForceGrfNumProgrammingWithScmFlagSetWhenIsGrfNumReportedWithScmIsQueriedThenCorrectValueIsReturned) { - DebugManagerStateRestore restorer; - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - - DebugManager.flags.ForceGrfNumProgrammingWithScm.set(0); - EXPECT_FALSE(hwInfoConfig.isGrfNumReportedWithScm()); - - DebugManager.flags.ForceGrfNumProgrammingWithScm.set(1); - EXPECT_TRUE(hwInfoConfig.isGrfNumReportedWithScm()); -} - -HWTEST_F(HwInfoConfigTest, givenDefaultSettingWhenIsThreadArbitrationPolicyReportedIsCalledThenScmSupportProductValueReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_EQ(hwInfoConfig.getScmPropertyThreadArbitrationPolicySupport(), hwInfoConfig.isThreadArbitrationPolicyReportedWithScm()); -} - -HWTEST_F(HwInfoConfigTest, givenForceThreadArbitrationPolicyProgrammingWithScmFlagSetWhenIsThreadArbitrationPolicyReportedWithScmIsQueriedThenCorrectValueIsReturned) { - DebugManagerStateRestore restorer; - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - - DebugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(0); - EXPECT_FALSE(hwInfoConfig.isThreadArbitrationPolicyReportedWithScm()); - - DebugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(1); - EXPECT_TRUE(hwInfoConfig.isThreadArbitrationPolicyReportedWithScm()); -} - -HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenIsImplicitScalingSupportedThenExpectFalse, IsNotXeHpOrXeHpcCore) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isImplicitScalingSupported(*defaultHwInfo)); -} - -HWTEST2_F(HwInfoConfigTest, givenAotConfigWhenSetHwInfoRevisionIdThenCorrectValueIsSet, IsAtMostDg2) { - auto hwInfo = *defaultHwInfo; - const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - auto productConfig = hwInfoConfig.getProductConfigFromHwInfo(*defaultHwInfo); - AheadOfTimeConfig aotConfig = {0}; - aotConfig.ProductConfig = productConfig; - CompilerHwInfoConfig::get(hwInfo.platform.eProductFamily)->setProductConfigForHwInfo(hwInfo, aotConfig); - EXPECT_EQ(hwInfo.platform.usRevId, aotConfig.ProductConfigID.Revision); -} - -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsAdjustWalkOrderAvailableCallThenFalseReturn) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isAdjustWalkOrderAvailable(*defaultHwInfo)); -} - -HWTEST2_F(HwInfoConfigTest, givenAtMostXeHPWhenGetCachingPolicyOptionsThenReturnNullptr, IsAtMostXeHpCore) { - auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_EQ(compilerHwInfoConfig->getCachingPolicyOptions(false), nullptr); - EXPECT_EQ(compilerHwInfoConfig->getCachingPolicyOptions(true), nullptr); -} - -HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteByPassPolicyOption, IsAtLeastXeHpgCore) { - auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - const char *expectedStr = "-cl-store-cache-default=2 -cl-load-cache-default=4"; - EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr))); - EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr))); -} - -HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteBackPolicyOption, IsAtLeastXeHpgCore) { - DebugManagerStateRestore restorer; - DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2); - - auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - const char *expectedStr = "-cl-store-cache-default=7 -cl-load-cache-default=4"; - EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr))); - EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr))); -} - -HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndDebugFlagSetForceAllResourcesUncachedWhenGetCachingPolicyOptionsThenReturnUncachedPolicyOption, IsAtLeastXeHpgCore) { - DebugManagerStateRestore restorer; - DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2); - DebugManager.flags.ForceAllResourcesUncached.set(true); - - auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - const char *expectedStr = "-cl-store-cache-default=1 -cl-load-cache-default=1"; - EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr))); - EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr))); -} - -HWTEST2_F(HwInfoConfigTest, givenCachePolicyWithoutCorrespondingBuildOptionWhenGetCachingPolicyOptionsThenReturnNullptr, IsAtLeastXeHpgCore) { - DebugManagerStateRestore restorer; - DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(5); - - auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_EQ(nullptr, compilerHwInfoConfig->getCachingPolicyOptions(false)); - EXPECT_EQ(nullptr, compilerHwInfoConfig->getCachingPolicyOptions(true)); -} - -HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigAndDebugFlagWhenGetL1CachePolicyThenReturnCorrectPolicy, IsAtLeastXeHpgCore) { - DebugManagerStateRestore restorer; - auto hwInfo = *defaultHwInfo; - auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily); - - DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(0); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(false)); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(true)); - - DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, hwInfoConfig->getL1CachePolicy(false)); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, hwInfoConfig->getL1CachePolicy(true)); - - DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(3); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, hwInfoConfig->getL1CachePolicy(false)); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, hwInfoConfig->getL1CachePolicy(true)); - - DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(4); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, hwInfoConfig->getL1CachePolicy(false)); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, hwInfoConfig->getL1CachePolicy(true)); - - DebugManager.flags.ForceAllResourcesUncached.set(true); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, hwInfoConfig->getL1CachePolicy(false)); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, hwInfoConfig->getL1CachePolicy(true)); -} - -HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenGetL1CachePolicyThenReturnWriteByPass, IsAtLeastXeHpgCore) { - auto hwInfo = *defaultHwInfo; - auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily); - - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(false)); - EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(true)); -} - -HWTEST2_F(HwInfoConfigTest, givenPlatformWithUnsupportedL1CachePoliciesWhenGetL1CachePolicyThenReturnZero, IsAtMostXeHpCore) { - auto hwInfo = *defaultHwInfo; - auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily); - - EXPECT_EQ(0u, hwInfoConfig->getL1CachePolicy(false)); - EXPECT_EQ(0u, hwInfoConfig->getL1CachePolicy(true)); -} - -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsPrefetcherDisablingInDirectSubmissionRequiredThenTrueIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); - EXPECT_TRUE(hwInfoConfig.isPrefetcherDisablingInDirectSubmissionRequired()); -} - -HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenIsStatefulAddressingModeSupportedThenReturnTrue, HasStatefulSupport) { - const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); - EXPECT_TRUE(hwInfoConfig.isStatefulAddressingModeSupported()); -} - -HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenIsPlatformQueryNotSupportedThenReturnFalse, IsAtMostDg2) { - const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); - EXPECT_FALSE(hwInfoConfig.isPlatformQuerySupported()); -} - -HWTEST2_F(HwInfoConfigTest, givenHwHelperWhenCallCopyThroughLockedPtrEnabledThenReturnFalse, IsNotXeHpgOrXeHpcCore) { - HwHelper &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); - EXPECT_FALSE(hwHelper.copyThroughLockedPtrEnabled(*defaultHwInfo)); -} - -HWTEST_F(HwInfoConfigTest, givenHwHelperWhenFlagSetAndCallCopyThroughLockedPtrEnabledThenReturnCorrectValue) { - DebugManagerStateRestore restorer; - HwHelper &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); - DebugManager.flags.ExperimentalCopyThroughLock.set(0); - EXPECT_FALSE(hwHelper.copyThroughLockedPtrEnabled(*defaultHwInfo)); - - DebugManager.flags.ExperimentalCopyThroughLock.set(1); - EXPECT_TRUE(hwHelper.copyThroughLockedPtrEnabled(*defaultHwInfo)); -} - -HWTEST2_F(HwInfoConfigTest, givenHwHelperWhenCallGetAmountOfAllocationsToFillThenReturnFalse, IsNotXeHpcCore) { - HwHelper &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); - EXPECT_EQ(hwHelper.getAmountOfAllocationsToFill(), 0u); -} - -HWTEST_F(HwInfoConfigTest, givenHwHelperWhenFlagSetAndCallGetAmountOfAllocationsToFillThenReturnCorrectValue) { - DebugManagerStateRestore restorer; - HwHelper &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); - DebugManager.flags.SetAmountOfReusableAllocations.set(0); - EXPECT_EQ(hwHelper.getAmountOfAllocationsToFill(), 0u); - - DebugManager.flags.SetAmountOfReusableAllocations.set(1); - EXPECT_EQ(hwHelper.getAmountOfAllocationsToFill(), 1u); -} \ No newline at end of file diff --git a/shared/test/unit_test/os_interface/hw_info_config_tests.cpp b/shared/test/unit_test/os_interface/hw_info_config_tests.cpp index 801302ffb7..fba871c284 100644 --- a/shared/test/unit_test/os_interface/hw_info_config_tests.cpp +++ b/shared/test/unit_test/os_interface/hw_info_config_tests.cpp @@ -22,67 +22,64 @@ #include "gtest/gtest.h" using namespace NEO; -using ProductHelperTest = Test; +using ProductHelperTest = HwInfoConfigTest; HwInfoConfigTest::HwInfoConfigTest() { executionEnvironment = std::make_unique(); productHelper = &executionEnvironment->rootDeviceEnvironments[0]->getHelper(); } + HwInfoConfigTest::~HwInfoConfigTest() = default; + void HwInfoConfigTest::SetUp() { pInHwInfo = *defaultHwInfo; testPlatform = &pInHwInfo.platform; } -HWTEST_F(HwInfoConfigTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThenReturnCorrectValue) { +HWTEST_F(ProductHelperTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThenReturnCorrectValue) { DebugManagerStateRestore restore; - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - DebugManager.flags.EnableHostUsmSupport.set(0); - EXPECT_EQ(0u, hwInfoConfig->getHostMemCapabilities(&pInHwInfo)); + EXPECT_EQ(0u, productHelper->getHostMemCapabilities(&pInHwInfo)); DebugManager.flags.EnableHostUsmSupport.set(1); - EXPECT_NE(0u, hwInfoConfig->getHostMemCapabilities(&pInHwInfo)); + EXPECT_NE(0u, productHelper->getHostMemCapabilities(&pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, whenGettingDefaultRevisionIdThenZeroIsReturned) { +HWTEST_F(ProductHelperTest, whenGettingDefaultRevisionIdThenZeroIsReturned) { EXPECT_EQ(0u, productHelper->getDefaultRevisionId()); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenGettingSharedSystemMemCapabilitiesThenCorrectValueIsReturned) { +HWTEST_F(ProductHelperTest, givenProductHelperWhenGettingSharedSystemMemCapabilitiesThenCorrectValueIsReturned) { DebugManagerStateRestore restore; - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_EQ(0u, hwInfoConfig->getSharedSystemMemCapabilities(&pInHwInfo)); + EXPECT_EQ(0u, productHelper->getSharedSystemMemCapabilities(&pInHwInfo)); for (auto enable : {-1, 0, 1}) { DebugManager.flags.EnableSharedSystemUsmSupport.set(enable); if (enable > 0) { auto caps = UNIFIED_SHARED_MEMORY_ACCESS | UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS | UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS | UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS; - EXPECT_EQ(caps, hwInfoConfig->getSharedSystemMemCapabilities(&pInHwInfo)); + EXPECT_EQ(caps, productHelper->getSharedSystemMemCapabilities(&pInHwInfo)); } else { - EXPECT_EQ(0u, hwInfoConfig->getSharedSystemMemCapabilities(&pInHwInfo)); + EXPECT_EQ(0u, productHelper->getSharedSystemMemCapabilities(&pInHwInfo)); } } } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfIsBlitSplitEnqueueWARequiredThenReturnFalse) { - auto hwInfoConfig = HwInfoConfig::get(productFamily); - EXPECT_FALSE(hwInfoConfig->isBlitSplitEnqueueWARequired(pInHwInfo)); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfIsBlitSplitEnqueueWARequiredThenReturnFalse) { + + EXPECT_FALSE(productHelper->isBlitSplitEnqueueWARequired(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenGettingMemoryCapabilitiesThenCorrectValueIsReturned) { +HWTEST_F(ProductHelperTest, givenProductHelperWhenGettingMemoryCapabilitiesThenCorrectValueIsReturned) { DebugManagerStateRestore restore; - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - for (auto capabilityBitmask : {0, 0b0001, 0b0010, 0b0100, 0b1000, 0b1111}) { DebugManager.flags.EnableUsmConcurrentAccessSupport.set(capabilityBitmask); std::bitset<4> capabilityBitset(capabilityBitmask); - auto hostMemCapabilities = hwInfoConfig->getHostMemCapabilities(&pInHwInfo); + auto hostMemCapabilities = productHelper->getHostMemCapabilities(&pInHwInfo); if (hostMemCapabilities > 0) { if (capabilityBitset.test(static_cast(UsmAccessCapabilities::Host))) { EXPECT_TRUE(UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS & hostMemCapabilities); @@ -90,7 +87,7 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenGettingMemoryCapabilitiesThenCor } } - auto deviceMemCapabilities = hwInfoConfig->getDeviceMemCapabilities(); + auto deviceMemCapabilities = productHelper->getDeviceMemCapabilities(); if (deviceMemCapabilities > 0) { if (capabilityBitset.test(static_cast(UsmAccessCapabilities::Device))) { EXPECT_TRUE(UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS & deviceMemCapabilities); @@ -98,7 +95,7 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenGettingMemoryCapabilitiesThenCor } } - auto singleDeviceSharedMemCapabilities = hwInfoConfig->getSingleDeviceSharedMemCapabilities(); + auto singleDeviceSharedMemCapabilities = productHelper->getSingleDeviceSharedMemCapabilities(); if (singleDeviceSharedMemCapabilities > 0) { if (capabilityBitset.test(static_cast(UsmAccessCapabilities::SharedSingleDevice))) { EXPECT_TRUE(UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS & singleDeviceSharedMemCapabilities); @@ -106,7 +103,7 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenGettingMemoryCapabilitiesThenCor } } - auto crossDeviceSharedMemCapabilities = hwInfoConfig->getCrossDeviceSharedMemCapabilities(); + auto crossDeviceSharedMemCapabilities = productHelper->getCrossDeviceSharedMemCapabilities(); if (crossDeviceSharedMemCapabilities > 0) { if (capabilityBitset.test(static_cast(UsmAccessCapabilities::SharedCrossDevice))) { EXPECT_TRUE(UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS & crossDeviceSharedMemCapabilities); @@ -114,7 +111,7 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenGettingMemoryCapabilitiesThenCor } } - auto sharedSystemMemCapabilities = hwInfoConfig->getSharedSystemMemCapabilities(&pInHwInfo); + auto sharedSystemMemCapabilities = productHelper->getSharedSystemMemCapabilities(&pInHwInfo); if (sharedSystemMemCapabilities > 0) { if (capabilityBitset.test(static_cast(UsmAccessCapabilities::SharedSystemCrossDevice))) { EXPECT_TRUE(UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS & sharedSystemMemCapabilities); @@ -124,7 +121,7 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenGettingMemoryCapabilitiesThenCor } } -TEST_F(HwInfoConfigTest, WhenParsingHwInfoConfigThenCorrectValuesAreReturned) { +TEST_F(ProductHelperTest, WhenParsingHwInfoConfigThenCorrectValuesAreReturned) { uint64_t hwInfoConfig = 0x0; bool success = parseHwInfoConfigString("1x1x1", hwInfoConfig); @@ -188,7 +185,7 @@ TEST_F(HwInfoConfigTest, WhenParsingHwInfoConfigThenCorrectValuesAreReturned) { } } -TEST_F(HwInfoConfigTest, givenInvalidHwInfoWhenParsingHwInfoConfigThenErrorIsReturned) { +TEST_F(ProductHelperTest, givenInvalidHwInfoWhenParsingHwInfoConfigThenErrorIsReturned) { uint64_t hwInfoConfig = 0x0; bool success = parseHwInfoConfigString("1", hwInfoConfig); EXPECT_FALSE(success); @@ -212,48 +209,47 @@ TEST_F(HwInfoConfigTest, givenInvalidHwInfoWhenParsingHwInfoConfigThenErrorIsRet EXPECT_FALSE(success); } -HWTEST_F(HwInfoConfigTest, whenOverrideGfxPartitionLayoutForWslThenReturnFalse) { - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig->overrideGfxPartitionLayoutForWsl()); +HWTEST_F(ProductHelperTest, whenOverrideGfxPartitionLayoutForWslThenReturnFalse) { + + EXPECT_FALSE(productHelper->overrideGfxPartitionLayoutForWsl()); } -HWTEST_F(HwInfoConfigTest, givenHardwareInfoWhenCallingIsAdditionalStateBaseAddressWARequiredThenFalseIsReturned) { - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - bool ret = hwInfoConfig->isAdditionalStateBaseAddressWARequired(pInHwInfo); +HWTEST_F(ProductHelperTest, givenHardwareInfoWhenCallingIsAdditionalStateBaseAddressWARequiredThenFalseIsReturned) { + + bool ret = productHelper->isAdditionalStateBaseAddressWARequired(pInHwInfo); EXPECT_FALSE(ret); } -HWTEST_F(HwInfoConfigTest, givenHardwareInfoWhenCallingIsMaxThreadsForWorkgroupWARequiredThenFalseIsReturned) { - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - bool ret = hwInfoConfig->isMaxThreadsForWorkgroupWARequired(pInHwInfo); +HWTEST_F(ProductHelperTest, givenHardwareInfoWhenCallingIsMaxThreadsForWorkgroupWARequiredThenFalseIsReturned) { + + bool ret = productHelper->isMaxThreadsForWorkgroupWARequired(pInHwInfo); EXPECT_FALSE(ret); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedForPageTableManagerSupportThenReturnCorrectValue) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_EQ(hwInfoConfig.isPageTableManagerSupported(pInHwInfo), UnitTestHelper::isPageTableManagerSupported(pInHwInfo)); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedForPageTableManagerSupportThenReturnCorrectValue) { + + EXPECT_EQ(productHelper->isPageTableManagerSupported(pInHwInfo), UnitTestHelper::isPageTableManagerSupported(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); +HWTEST_F(ProductHelperTest, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect) { for (uint32_t testValue = 0; testValue < 0x10; testValue++) { - auto hwRevIdFromStepping = hwInfoConfig.getHwRevIdFromStepping(testValue, pInHwInfo); + auto hwRevIdFromStepping = productHelper->getHwRevIdFromStepping(testValue, pInHwInfo); if (hwRevIdFromStepping != CommonConstants::invalidStepping) { pInHwInfo.platform.usRevId = hwRevIdFromStepping; - EXPECT_EQ(testValue, hwInfoConfig.getSteppingFromHwRevId(pInHwInfo)); + EXPECT_EQ(testValue, productHelper->getSteppingFromHwRevId(pInHwInfo)); } pInHwInfo.platform.usRevId = testValue; - auto steppingFromHwRevId = hwInfoConfig.getSteppingFromHwRevId(pInHwInfo); + auto steppingFromHwRevId = productHelper->getSteppingFromHwRevId(pInHwInfo); if (steppingFromHwRevId != CommonConstants::invalidStepping) { - EXPECT_EQ(testValue, hwInfoConfig.getHwRevIdFromStepping(steppingFromHwRevId, pInHwInfo)); + EXPECT_EQ(testValue, productHelper->getHwRevIdFromStepping(steppingFromHwRevId, pInHwInfo)); } } } -HWTEST_F(HwInfoConfigTest, givenVariousValuesWhenGettingAubStreamSteppingFromHwRevIdThenReturnValuesAreCorrect) { +HWTEST_F(ProductHelperTest, givenVariousValuesWhenGettingAubStreamSteppingFromHwRevIdThenReturnValuesAreCorrect) { MockHwInfoConfigHw mockHwInfoConfig; mockHwInfoConfig.returnedStepping = REVISION_A0; EXPECT_EQ(AubMemDump::SteppingValues::A, mockHwInfoConfig.getAubStreamSteppingFromHwRevId(pInHwInfo)); @@ -273,163 +269,159 @@ HWTEST_F(HwInfoConfigTest, givenVariousValuesWhenGettingAubStreamSteppingFromHwR EXPECT_EQ(AubMemDump::SteppingValues::A, mockHwInfoConfig.getAubStreamSteppingFromHwRevId(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedForDefaultEngineTypeAdjustmentThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isDefaultEngineTypeAdjustmentRequired(pInHwInfo)); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedForDefaultEngineTypeAdjustmentThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isDefaultEngineTypeAdjustmentRequired(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, whenCallingGetDeviceMemoryNameThenDdrIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - auto deviceMemoryName = hwInfoConfig.getDeviceMemoryName(); +HWTEST_F(ProductHelperTest, whenCallingGetDeviceMemoryNameThenDdrIsReturned) { + + auto deviceMemoryName = productHelper->getDeviceMemoryName(); EXPECT_TRUE(hasSubstr(deviceMemoryName, std::string("DDR"))); } -HWCMDTEST_F(IGFX_GEN8_CORE, HwInfoConfigTest, givenHwInfoConfigWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isDisableOverdispatchAvailable(pInHwInfo)); +HWCMDTEST_F(IGFX_GEN8_CORE, ProductHelperTest, givenProductHelperWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { + + EXPECT_FALSE(productHelper->isDisableOverdispatchAvailable(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_TRUE(hwInfoConfig.allowCompression(pInHwInfo)); +HWTEST_F(ProductHelperTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned) { + + EXPECT_TRUE(productHelper->allowCompression(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, WhenAllowStatelessCompressionIsCalledThenReturnCorrectValue) { +HWTEST_F(ProductHelperTest, WhenAllowStatelessCompressionIsCalledThenReturnCorrectValue) { DebugManagerStateRestore restore; - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.allowStatelessCompression(pInHwInfo)); + EXPECT_FALSE(productHelper->allowStatelessCompression(pInHwInfo)); for (auto enable : {-1, 0, 1}) { DebugManager.flags.EnableStatelessCompression.set(enable); if (enable > 0) { - EXPECT_TRUE(hwInfoConfig.allowStatelessCompression(pInHwInfo)); + EXPECT_TRUE(productHelper->allowStatelessCompression(pInHwInfo)); } else { - EXPECT_FALSE(hwInfoConfig.allowStatelessCompression(pInHwInfo)); + EXPECT_FALSE(productHelper->allowStatelessCompression(pInHwInfo)); } } } -HWTEST_F(HwInfoConfigTest, givenVariousDebugKeyValuesWhenGettingLocalMemoryAccessModeThenCorrectValueIsReturned) { +HWTEST_F(ProductHelperTest, givenVariousDebugKeyValuesWhenGettingLocalMemoryAccessModeThenCorrectValueIsReturned) { + DebugManagerStateRestore restore{}; + struct MockHwInfoConfig : HwInfoConfigHw { using HwInfoConfig::getDefaultLocalMemoryAccessMode; }; - - DebugManagerStateRestore restore{}; auto mockHwInfoConfig = static_cast(*HwInfoConfig::get(productFamily)); - const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); EXPECT_EQ(mockHwInfoConfig.getDefaultLocalMemoryAccessMode(pInHwInfo), mockHwInfoConfig.getLocalMemoryAccessMode(pInHwInfo)); DebugManager.flags.ForceLocalMemoryAccessMode.set(0); - EXPECT_EQ(LocalMemoryAccessMode::Default, hwInfoConfig.getLocalMemoryAccessMode(pInHwInfo)); + EXPECT_EQ(LocalMemoryAccessMode::Default, productHelper->getLocalMemoryAccessMode(pInHwInfo)); DebugManager.flags.ForceLocalMemoryAccessMode.set(1); - EXPECT_EQ(LocalMemoryAccessMode::CpuAccessAllowed, hwInfoConfig.getLocalMemoryAccessMode(pInHwInfo)); + EXPECT_EQ(LocalMemoryAccessMode::CpuAccessAllowed, productHelper->getLocalMemoryAccessMode(pInHwInfo)); DebugManager.flags.ForceLocalMemoryAccessMode.set(3); - EXPECT_EQ(LocalMemoryAccessMode::CpuAccessDisallowed, hwInfoConfig.getLocalMemoryAccessMode(pInHwInfo)); + EXPECT_EQ(LocalMemoryAccessMode::CpuAccessDisallowed, productHelper->getLocalMemoryAccessMode(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfAllocationSizeAdjustmentIsRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isAllocationSizeAdjustmentRequired(pInHwInfo)); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfAllocationSizeAdjustmentIsRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isAllocationSizeAdjustmentRequired(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPrefetchDisablingIsRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isPrefetchDisablingRequired(pInHwInfo)); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfPrefetchDisablingIsRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isPrefetchDisablingRequired(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenFalseIsReturned) { + auto isRcs = false; - const auto &[isBasicWARequired, isExtendedWARequired] = hwInfoConfig.isPipeControlPriorToNonPipelinedStateCommandsWARequired(pInHwInfo, isRcs); + const auto &[isBasicWARequired, isExtendedWARequired] = productHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired(pInHwInfo, isRcs); EXPECT_FALSE(isExtendedWARequired); EXPECT_FALSE(isBasicWARequired); } -HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfHeapInLocalMemThenFalseIsReturned, IsAtMostGen12lp) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.heapInLocalMem(pInHwInfo)); +HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfHeapInLocalMemThenFalseIsReturned, IsAtMostGen12lp) { + + EXPECT_FALSE(productHelper->heapInLocalMem(pInHwInfo)); } -HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenSettingCapabilityCoherencyFlagThenFlagIsSet, IsAtMostGen11) { - auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); +HWTEST2_F(ProductHelperTest, givenProductHelperWhenSettingCapabilityCoherencyFlagThenFlagIsSet, IsAtMostGen11) { bool coherency = false; - hwInfoConfig.setCapabilityCoherencyFlag(pInHwInfo, coherency); + productHelper->setCapabilityCoherencyFlag(pInHwInfo, coherency); EXPECT_TRUE(coherency); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfAdditionalMediaSamplerProgrammingIsRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isAdditionalMediaSamplerProgrammingRequired()); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfAdditionalMediaSamplerProgrammingIsRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isAdditionalMediaSamplerProgrammingRequired()); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfInitialFlagsProgrammingIsRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isInitialFlagsProgrammingRequired()); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfInitialFlagsProgrammingIsRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isInitialFlagsProgrammingRequired()); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfReturnedCmdSizeForMediaSamplerAdjustmentIsRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isReturnedCmdSizeForMediaSamplerAdjustmentRequired()); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfReturnedCmdSizeForMediaSamplerAdjustmentIsRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isReturnedCmdSizeForMediaSamplerAdjustmentRequired()); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfExtraParametersAreInvalidThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.extraParametersInvalid(pInHwInfo)); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfExtraParametersAreInvalidThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->extraParametersInvalid(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPipeControlWAIsRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.pipeControlWARequired(pInHwInfo)); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfPipeControlWAIsRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->pipeControlWARequired(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfImagePitchAlignmentWAIsRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.imagePitchAlignmentWARequired(pInHwInfo)); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfImagePitchAlignmentWAIsRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->imagePitchAlignmentWARequired(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfForceEmuInt32DivRemSPWAIsRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isForceEmuInt32DivRemSPWARequired(pInHwInfo)); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfForceEmuInt32DivRemSPWAIsRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isForceEmuInt32DivRemSPWARequired(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIf3DPipelineSelectWAIsRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.is3DPipelineSelectWARequired()); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIf3DPipelineSelectWAIsRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->is3DPipelineSelectWARequired()); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfStorageInfoAdjustmentIsRequiredThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isStorageInfoAdjustmentRequired()); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfStorageInfoAdjustmentIsRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isStorageInfoAdjustmentRequired()); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfBlitterForImagesIsSupportedThenFalseIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); - EXPECT_FALSE(hwInfoConfig.isBlitterForImagesSupported()); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfBlitterForImagesIsSupportedThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isBlitterForImagesSupported()); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_TRUE(hwInfoConfig.isTile64With3DSurfaceOnBCSSupported(pInHwInfo)); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned) { + + EXPECT_TRUE(productHelper->isTile64With3DSurfaceOnBCSSupported(pInHwInfo)); } -HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPatIndexProgrammingSupportedThenReturnFalse) { - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - EXPECT_FALSE(hwInfoConfig.isVmBindPatIndexProgrammingSupported()); +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfPatIndexProgrammingSupportedThenReturnFalse) { + + EXPECT_FALSE(productHelper->isVmBindPatIndexProgrammingSupported()); } HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfIsTimestampWaitSupportedForEventsThenFalseIsReturned, IsNotXeHpgOrXeHpcCore) { - const auto &productHelper = getHelper(); - EXPECT_FALSE(productHelper.isTimestampWaitSupportedForEvents()); + + EXPECT_FALSE(productHelper->isTimestampWaitSupportedForEvents()); } -HWTEST_F(HwInfoConfigTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { +HWTEST_F(ProductHelperTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { DebugManagerStateRestore restore{}; - const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); pInHwInfo.capabilityTable.blitterOperationsSupported = true; MockGraphicsAllocation graphicsAllocation; @@ -437,29 +429,29 @@ HWTEST_F(HwInfoConfigTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredF EXPECT_TRUE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); - auto expectedDefaultValue = (hwInfoConfig.getLocalMemoryAccessMode(pInHwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed); - EXPECT_EQ(expectedDefaultValue, hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + auto expectedDefaultValue = (productHelper->getLocalMemoryAccessMode(pInHwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed); + EXPECT_EQ(expectedDefaultValue, productHelper->isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); DebugManager.flags.ForceLocalMemoryAccessMode.set(0); - EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); DebugManager.flags.ForceLocalMemoryAccessMode.set(1); - EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); DebugManager.flags.ForceLocalMemoryAccessMode.set(3); - EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); pInHwInfo.capabilityTable.blitterOperationsSupported = false; - EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); graphicsAllocation.overrideMemoryPool(MemoryPool::System64KBPages); - EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); pInHwInfo.capabilityTable.blitterOperationsSupported = true; - EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); } -HWTEST_F(HwInfoConfigTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { +HWTEST_F(ProductHelperTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { DebugManagerStateRestore restore{}; HardwareInfo hwInfo = pInHwInfo; - auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + hwInfo.capabilityTable.blitterOperationsSupported = true; MockGraphicsAllocation graphicsAllocation; @@ -476,89 +468,194 @@ HWTEST_F(HwInfoConfigTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequir mockGmm.resourceParams.Flags.Info.NotLockable = true; graphicsAllocation.setDefaultGmm(&mockGmm); - EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); DebugManager.flags.ForceLocalMemoryAccessMode.set(0); - EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); DebugManager.flags.ForceLocalMemoryAccessMode.set(1); - EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); DebugManager.flags.ForceLocalMemoryAccessMode.set(3); - EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); hwInfo.capabilityTable.blitterOperationsSupported = false; - EXPECT_TRUE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); graphicsAllocation.overrideMemoryPool(MemoryPool::System64KBPages); - EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); hwInfo.capabilityTable.blitterOperationsSupported = true; - EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); + EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(hwInfo, graphicsAllocation)); } -HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenGettingIsBlitCopyRequiredForLocalMemoryThenFalseIsReturned, IsAtMostGen11) { - auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); +HWTEST2_F(ProductHelperTest, givenProductHelperWhenGettingIsBlitCopyRequiredForLocalMemoryThenFalseIsReturned, IsAtMostGen11) { + MockGraphicsAllocation graphicsAllocation; graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); graphicsAllocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); - EXPECT_FALSE(hwInfoConfig.isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); + EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(pInHwInfo, graphicsAllocation)); } -HWTEST_F(HwInfoConfigTest, givenSamplerStateWhenAdjustSamplerStateThenNothingIsChanged) { +HWTEST_F(ProductHelperTest, givenSamplerStateWhenAdjustSamplerStateThenNothingIsChanged) { using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE; - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); auto state = FamilyType::cmdInitSamplerState; auto initialState = state; - hwInfoConfig->adjustSamplerState(&state, pInHwInfo); + productHelper->adjustSamplerState(&state, pInHwInfo); EXPECT_EQ(0, memcmp(&initialState, &state, sizeof(SAMPLER_STATE))); } -HWTEST_F(HwInfoConfigTest, WhenFillingScmPropertiesSupportThenExpectUseCorrectGetters) { +HWTEST_F(ProductHelperTest, WhenFillingScmPropertiesSupportThenExpectUseCorrectGetters) { StateComputeModePropertiesSupport scmPropertiesSupport = {}; - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); + productHelper->fillScmPropertiesSupportStructure(scmPropertiesSupport); - hwInfoConfig->fillScmPropertiesSupportStructure(scmPropertiesSupport); - - EXPECT_EQ(hwInfoConfig->isThreadArbitrationPolicyReportedWithScm(), scmPropertiesSupport.threadArbitrationPolicy); - EXPECT_EQ(hwInfoConfig->getScmPropertyCoherencyRequiredSupport(), scmPropertiesSupport.coherencyRequired); - EXPECT_EQ(hwInfoConfig->getScmPropertyZPassAsyncComputeThreadLimitSupport(), scmPropertiesSupport.zPassAsyncComputeThreadLimit); - EXPECT_EQ(hwInfoConfig->getScmPropertyPixelAsyncComputeThreadLimitSupport(), scmPropertiesSupport.pixelAsyncComputeThreadLimit); - EXPECT_EQ(hwInfoConfig->isGrfNumReportedWithScm(), scmPropertiesSupport.largeGrfMode); - EXPECT_EQ(hwInfoConfig->getScmPropertyDevicePreemptionModeSupport(), scmPropertiesSupport.devicePreemptionMode); + EXPECT_EQ(productHelper->isThreadArbitrationPolicyReportedWithScm(), scmPropertiesSupport.threadArbitrationPolicy); + EXPECT_EQ(productHelper->getScmPropertyCoherencyRequiredSupport(), scmPropertiesSupport.coherencyRequired); + EXPECT_EQ(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport(), scmPropertiesSupport.zPassAsyncComputeThreadLimit); + EXPECT_EQ(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport(), scmPropertiesSupport.pixelAsyncComputeThreadLimit); + EXPECT_EQ(productHelper->isGrfNumReportedWithScm(), scmPropertiesSupport.largeGrfMode); + EXPECT_EQ(productHelper->getScmPropertyDevicePreemptionModeSupport(), scmPropertiesSupport.devicePreemptionMode); } -HWTEST_F(HwInfoConfigTest, WhenFillingFrontEndPropertiesSupportThenExpectUseCorrectGetters) { +HWTEST_F(ProductHelperTest, WhenFillingFrontEndPropertiesSupportThenExpectUseCorrectGetters) { FrontEndPropertiesSupport frontEndPropertiesSupport = {}; - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - - hwInfoConfig->fillFrontEndPropertiesSupportStructure(frontEndPropertiesSupport, pInHwInfo); - EXPECT_EQ(hwInfoConfig->isComputeDispatchAllWalkerEnableInCfeStateRequired(pInHwInfo), frontEndPropertiesSupport.computeDispatchAllWalker); - EXPECT_EQ(hwInfoConfig->getFrontEndPropertyDisableEuFusionSupport(), frontEndPropertiesSupport.disableEuFusion); - EXPECT_EQ(hwInfoConfig->isDisableOverdispatchAvailable(pInHwInfo), frontEndPropertiesSupport.disableOverdispatch); - EXPECT_EQ(hwInfoConfig->getFrontEndPropertySingleSliceDispatchCcsModeSupport(), frontEndPropertiesSupport.singleSliceDispatchCcsMode); + productHelper->fillFrontEndPropertiesSupportStructure(frontEndPropertiesSupport, pInHwInfo); + EXPECT_EQ(productHelper->isComputeDispatchAllWalkerEnableInCfeStateRequired(pInHwInfo), frontEndPropertiesSupport.computeDispatchAllWalker); + EXPECT_EQ(productHelper->getFrontEndPropertyDisableEuFusionSupport(), frontEndPropertiesSupport.disableEuFusion); + EXPECT_EQ(productHelper->isDisableOverdispatchAvailable(pInHwInfo), frontEndPropertiesSupport.disableOverdispatch); + EXPECT_EQ(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport(), frontEndPropertiesSupport.singleSliceDispatchCcsMode); } -HWTEST_F(HwInfoConfigTest, WhenFillingPipelineSelectPropertiesSupportThenExpectUseCorrectGetters) { +HWTEST_F(ProductHelperTest, WhenFillingPipelineSelectPropertiesSupportThenExpectUseCorrectGetters) { PipelineSelectPropertiesSupport pipelineSelectPropertiesSupport = {}; - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - - hwInfoConfig->fillPipelineSelectPropertiesSupportStructure(pipelineSelectPropertiesSupport, pInHwInfo); - EXPECT_EQ(hwInfoConfig->getPipelineSelectPropertyModeSelectedSupport(), pipelineSelectPropertiesSupport.modeSelected); - EXPECT_EQ(hwInfoConfig->getPipelineSelectPropertyMediaSamplerDopClockGateSupport(), pipelineSelectPropertiesSupport.mediaSamplerDopClockGate); - EXPECT_EQ(hwInfoConfig->isSystolicModeConfigurable(pInHwInfo), pipelineSelectPropertiesSupport.systolicMode); + productHelper->fillPipelineSelectPropertiesSupportStructure(pipelineSelectPropertiesSupport, pInHwInfo); + EXPECT_EQ(productHelper->getPipelineSelectPropertyModeSelectedSupport(), pipelineSelectPropertiesSupport.modeSelected); + EXPECT_EQ(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport(), pipelineSelectPropertiesSupport.mediaSamplerDopClockGate); + EXPECT_EQ(productHelper->isSystolicModeConfigurable(pInHwInfo), pipelineSelectPropertiesSupport.systolicMode); } -HWTEST_F(HwInfoConfigTest, WhenFillingStateBaseAddressPropertiesSupportThenExpectUseCorrectGetters) { +HWTEST_F(ProductHelperTest, WhenFillingStateBaseAddressPropertiesSupportThenExpectUseCorrectGetters) { StateBaseAddressPropertiesSupport stateBaseAddressPropertiesSupport = {}; - auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily); - - hwInfoConfig->fillStateBaseAddressPropertiesSupportStructure(stateBaseAddressPropertiesSupport, pInHwInfo); - EXPECT_EQ(hwInfoConfig->getStateBaseAddressPropertyGlobalAtomicsSupport(), stateBaseAddressPropertiesSupport.globalAtomics); - EXPECT_EQ(hwInfoConfig->getStateBaseAddressPropertyStatelessMocsSupport(), stateBaseAddressPropertiesSupport.statelessMocs); - EXPECT_EQ(hwInfoConfig->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport(), stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress); + productHelper->fillStateBaseAddressPropertiesSupportStructure(stateBaseAddressPropertiesSupport, pInHwInfo); + EXPECT_EQ(productHelper->getStateBaseAddressPropertyGlobalAtomicsSupport(), stateBaseAddressPropertiesSupport.globalAtomics); + EXPECT_EQ(productHelper->getStateBaseAddressPropertyStatelessMocsSupport(), stateBaseAddressPropertiesSupport.statelessMocs); + EXPECT_EQ(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport(), stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress); +} + +HWTEST_F(ProductHelperTest, givenProductHelperWhenIsAdjustProgrammableIdPreferredSlmSizeRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isAdjustProgrammableIdPreferredSlmSizeRequired(*defaultHwInfo)); +} + +HWTEST_F(ProductHelperTest, givenProductHelperWhenIsComputeDispatchAllWalkerEnableInCfeStateRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isComputeDispatchAllWalkerEnableInCfeStateRequired(*defaultHwInfo)); +} + +HWTEST_F(ProductHelperTest, givenProductHelperWhenIsComputeDispatchAllWalkerEnableInComputeWalkerRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isComputeDispatchAllWalkerEnableInComputeWalkerRequired(*defaultHwInfo)); +} + +HWTEST_F(ProductHelperTest, givenProductHelperWhenIsGlobalFenceInCommandStreamRequiredThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isGlobalFenceInCommandStreamRequired(*defaultHwInfo)); +} + +HWTEST_F(ProductHelperTest, givenProductHelperWhenIsSystolicModeConfigurabledThenFalseIsReturned) { + + EXPECT_FALSE(productHelper->isSystolicModeConfigurable(*defaultHwInfo)); +} + +HWTEST_F(ProductHelperTest, givenProductHelperWhenGetThreadEuRatioForScratchThen8IsReturned) { + + EXPECT_EQ(8u, productHelper->getThreadEuRatioForScratch(*defaultHwInfo)); +} + +HWTEST_F(ProductHelperTest, givenDefaultSettingWhenIsGrfNumReportedIsCalledThenScmSupportProductValueIsReturned) { + + EXPECT_EQ(productHelper->getScmPropertyLargeGrfModeSupport(), productHelper->isGrfNumReportedWithScm()); +} + +HWTEST_F(ProductHelperTest, givenForceGrfNumProgrammingWithScmFlagSetWhenIsGrfNumReportedWithScmIsQueriedThenCorrectValueIsReturned) { + DebugManagerStateRestore restorer; + + DebugManager.flags.ForceGrfNumProgrammingWithScm.set(0); + EXPECT_FALSE(productHelper->isGrfNumReportedWithScm()); + + DebugManager.flags.ForceGrfNumProgrammingWithScm.set(1); + EXPECT_TRUE(productHelper->isGrfNumReportedWithScm()); +} + +HWTEST_F(ProductHelperTest, givenDefaultSettingWhenIsThreadArbitrationPolicyReportedIsCalledThenScmSupportProductValueReturned) { + + EXPECT_EQ(productHelper->getScmPropertyThreadArbitrationPolicySupport(), productHelper->isThreadArbitrationPolicyReportedWithScm()); +} + +HWTEST_F(ProductHelperTest, givenForceThreadArbitrationPolicyProgrammingWithScmFlagSetWhenIsThreadArbitrationPolicyReportedWithScmIsQueriedThenCorrectValueIsReturned) { + DebugManagerStateRestore restorer; + + DebugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(0); + EXPECT_FALSE(productHelper->isThreadArbitrationPolicyReportedWithScm()); + + DebugManager.flags.ForceThreadArbitrationPolicyProgrammingWithScm.set(1); + EXPECT_TRUE(productHelper->isThreadArbitrationPolicyReportedWithScm()); +} + +HWTEST_F(ProductHelperTest, givenProductHelperWhenIsAdjustWalkOrderAvailableCallThenFalseReturn) { + EXPECT_FALSE(productHelper->isAdjustWalkOrderAvailable(*defaultHwInfo)); +} + +HWTEST_F(ProductHelperTest, givenProductHelperWhenIsPrefetcherDisablingInDirectSubmissionRequiredThenTrueIsReturned) { + EXPECT_TRUE(productHelper->isPrefetcherDisablingInDirectSubmissionRequired()); +} + +HWTEST2_F(ProductHelperTest, givenProductHelperWhenIsImplicitScalingSupportedThenExpectFalse, IsNotXeHpOrXeHpcCore) { + EXPECT_FALSE(productHelper->isImplicitScalingSupported(*defaultHwInfo)); +} + +HWTEST2_F(ProductHelperTest, givenProductHelperAndDebugFlagWhenGetL1CachePolicyThenReturnCorrectPolicy, IsAtLeastXeHpgCore) { + DebugManagerStateRestore restorer; + + DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(0); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, productHelper->getL1CachePolicy(false)); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, productHelper->getL1CachePolicy(true)); + + DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, productHelper->getL1CachePolicy(false)); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, productHelper->getL1CachePolicy(true)); + + DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(3); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, productHelper->getL1CachePolicy(false)); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, productHelper->getL1CachePolicy(true)); + + DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(4); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, productHelper->getL1CachePolicy(false)); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, productHelper->getL1CachePolicy(true)); + + DebugManager.flags.ForceAllResourcesUncached.set(true); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, productHelper->getL1CachePolicy(false)); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, productHelper->getL1CachePolicy(true)); +} + +HWTEST2_F(ProductHelperTest, givenProductHelperWhenGetL1CachePolicyThenReturnWriteByPass, IsAtLeastXeHpgCore) { + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, productHelper->getL1CachePolicy(false)); + EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, productHelper->getL1CachePolicy(true)); +} + +HWTEST2_F(ProductHelperTest, givenPlatformWithUnsupportedL1CachePoliciesWhenGetL1CachePolicyThenReturnZero, IsAtMostXeHpCore) { + EXPECT_EQ(0u, productHelper->getL1CachePolicy(false)); + EXPECT_EQ(0u, productHelper->getL1CachePolicy(true)); +} + +HWTEST2_F(ProductHelperTest, givenProductHelperWhenIsStatefulAddressingModeSupportedThenReturnTrue, HasStatefulSupport) { + EXPECT_TRUE(productHelper->isStatefulAddressingModeSupported()); +} + +HWTEST2_F(ProductHelperTest, givenProductHelperWhenIsPlatformQueryNotSupportedThenReturnFalse, IsAtMostDg2) { + EXPECT_FALSE(productHelper->isPlatformQuerySupported()); } diff --git a/shared/test/unit_test/os_interface/linux/hw_info_config_linux_tests.cpp b/shared/test/unit_test/os_interface/linux/hw_info_config_linux_tests.cpp index 667b814ac0..ac16c9b045 100644 --- a/shared/test/unit_test/os_interface/linux/hw_info_config_linux_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/hw_info_config_linux_tests.cpp @@ -20,85 +20,85 @@ using namespace NEO; -struct HwInfoConfigTestLinuxDummy : HwInfoConfigTestLinux { +struct ProductHelperTestLinux : HwInfoConfigTestLinux { void SetUp() override { HwInfoConfigTestLinux::SetUp(); testPlatform->eRenderCoreFamily = defaultHwInfo->platform.eRenderCoreFamily; - hwInfoConfigFactoryBackup = &hwConfig; + hwInfoConfigFactoryBackup = &productHelper; } void TearDown() override { HwInfoConfigTestLinux::TearDown(); } VariableBackup hwInfoConfigFactoryBackup{&NEO::hwInfoConfigFactory[static_cast(IGFX_UNKNOWN)]}; - MockHwInfoConfigHw hwConfig; + MockHwInfoConfigHw productHelper; }; -TEST_F(HwInfoConfigTestLinuxDummy, GivenDummyConfigWhenConfiguringHwInfoThenSucceeds) { - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); +TEST_F(ProductHelperTestLinux, GivenDummyConfigWhenConfiguringHwInfoThenSucceeds) { + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); } -HWTEST2_F(HwInfoConfigTestLinuxDummy, givenDebugFlagSetWhenEnablingBlitterOperationsSupportThenIgnore, IsAtMostGen11) { +HWTEST2_F(ProductHelperTestLinux, givenDebugFlagSetWhenEnablingBlitterOperationsSupportThenIgnore, IsAtMostGen11) { DebugManagerStateRestore restore{}; HardwareInfo hardwareInfo = *defaultHwInfo; DebugManager.flags.EnableBlitterOperationsSupport.set(1); - hwConfig.configureHardwareCustom(&hardwareInfo, nullptr); + productHelper.configureHardwareCustom(&hardwareInfo, nullptr); EXPECT_FALSE(hardwareInfo.capabilityTable.blitterOperationsSupported); } -HWTEST2_F(HwInfoConfigTestLinuxDummy, givenUnsupportedChipsetUniqueUUIDWhenGettingUuidThenReturnFalse, IsAtMostGen11) { +HWTEST2_F(ProductHelperTestLinux, givenUnsupportedChipsetUniqueUUIDWhenGettingUuidThenReturnFalse, IsAtMostGen11) { HardwareInfo hardwareInfo = *defaultHwInfo; auto hwInfoConfig = HwInfoConfig::get(hardwareInfo.platform.eProductFamily); std::array id; EXPECT_FALSE(hwInfoConfig->getUuid(nullptr, id)); } -TEST_F(HwInfoConfigTestLinuxDummy, GivenDummyConfigThenEdramIsDetected) { - hwConfig.use128MbEdram = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); +TEST_F(ProductHelperTestLinux, GivenDummyConfigThenEdramIsDetected) { + productHelper.use128MbEdram = true; + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrEDram); } -TEST_F(HwInfoConfigTestLinuxDummy, givenEnabledPlatformCoherencyWhenConfiguringHwInfoThenIgnoreAndSetAsDisabled) { - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); +TEST_F(ProductHelperTestLinux, givenEnabledPlatformCoherencyWhenConfiguringHwInfoThenIgnoreAndSetAsDisabled) { + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_FALSE(outHwInfo.capabilityTable.ftrSupportsCoherency); } -TEST_F(HwInfoConfigTestLinuxDummy, givenDisabledPlatformCoherencyWhenConfiguringHwInfoThenSetValidCapability) { - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); +TEST_F(ProductHelperTestLinux, givenDisabledPlatformCoherencyWhenConfiguringHwInfoThenSetValidCapability) { + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_FALSE(outHwInfo.capabilityTable.ftrSupportsCoherency); } -TEST_F(HwInfoConfigTestLinuxDummy, GivenFailGetEuCountWhenConfiguringHwInfoThenFails) { +TEST_F(ProductHelperTestLinux, GivenFailGetEuCountWhenConfiguringHwInfoThenFails) { drm->storedRetValForEUVal = -4; drm->failRetTopology = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(-4, ret); } -TEST_F(HwInfoConfigTestLinuxDummy, GivenFailGetSsCountWhenConfiguringHwInfoThenFails) { +TEST_F(ProductHelperTestLinux, GivenFailGetSsCountWhenConfiguringHwInfoThenFails) { drm->storedRetValForSSVal = -5; drm->failRetTopology = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(-5, ret); } -TEST_F(HwInfoConfigTestLinuxDummy, whenFailGettingTopologyThenFallbackToEuCountIoctl) { +TEST_F(ProductHelperTestLinux, whenFailGettingTopologyThenFallbackToEuCountIoctl) { drm->failRetTopology = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_NE(-1, ret); } -TEST_F(HwInfoConfigTestLinuxDummy, givenInvalidTopologyDataWhenConfiguringThenReturnError) { +TEST_F(ProductHelperTestLinux, givenInvalidTopologyDataWhenConfiguringThenReturnError) { auto storedSVal = drm->storedSVal; auto storedSSVal = drm->storedSSVal; auto storedEUVal = drm->storedEUVal; @@ -134,62 +134,62 @@ TEST_F(HwInfoConfigTestLinuxDummy, givenInvalidTopologyDataWhenConfiguringThenRe } } -TEST_F(HwInfoConfigTestLinuxDummy, GivenFailingCustomConfigWhenConfiguringHwInfoThenFails) { - hwConfig.failOnConfigureHardwareCustom = true; +TEST_F(ProductHelperTestLinux, GivenFailingCustomConfigWhenConfiguringHwInfoThenFails) { + productHelper.failOnConfigureHardwareCustom = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(-1, ret); } -TEST_F(HwInfoConfigTestLinuxDummy, whenConfigureHwInfoIsCalledThenAreNonPersistentContextsSupportedReturnsTrue) { - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); +TEST_F(ProductHelperTestLinux, whenConfigureHwInfoIsCalledThenAreNonPersistentContextsSupportedReturnsTrue) { + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_TRUE(drm->areNonPersistentContextsSupported()); } -TEST_F(HwInfoConfigTestLinuxDummy, whenConfigureHwInfoIsCalledAndPersitentContextIsUnsupportedThenAreNonPersistentContextsSupportedReturnsFalse) { +TEST_F(ProductHelperTestLinux, whenConfigureHwInfoIsCalledAndPersitentContextIsUnsupportedThenAreNonPersistentContextsSupportedReturnsFalse) { drm->storedPersistentContextsSupport = 0; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_FALSE(drm->areNonPersistentContextsSupported()); } -HWTEST_F(HwInfoConfigTestLinuxDummy, GivenPreemptionDrmEnabledMidThreadOnWhenConfiguringHwInfoThenPreemptionIsSupported) { +HWTEST_F(ProductHelperTestLinux, GivenPreemptionDrmEnabledMidThreadOnWhenConfiguringHwInfoThenPreemptionIsSupported) { pInHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread; drm->storedPreemptionSupport = I915_SCHEDULER_CAP_ENABLED | I915_SCHEDULER_CAP_PRIORITY | I915_SCHEDULER_CAP_PREEMPTION; - hwConfig.enableMidThreadPreemption = true; + productHelper.enableMidThreadPreemption = true; UnitTestHelper::setExtraMidThreadPreemptionFlag(pInHwInfo, true); - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_EQ(PreemptionMode::MidThread, outHwInfo.capabilityTable.defaultPreemptionMode); EXPECT_TRUE(drm->isPreemptionSupported()); } -TEST_F(HwInfoConfigTestLinuxDummy, GivenPreemptionDrmEnabledThreadGroupOnWhenConfiguringHwInfoThenPreemptionIsSupported) { +TEST_F(ProductHelperTestLinux, GivenPreemptionDrmEnabledThreadGroupOnWhenConfiguringHwInfoThenPreemptionIsSupported) { pInHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread; drm->storedPreemptionSupport = I915_SCHEDULER_CAP_ENABLED | I915_SCHEDULER_CAP_PRIORITY | I915_SCHEDULER_CAP_PREEMPTION; - hwConfig.enableThreadGroupPreemption = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + productHelper.enableThreadGroupPreemption = true; + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_EQ(PreemptionMode::ThreadGroup, outHwInfo.capabilityTable.defaultPreemptionMode); EXPECT_TRUE(drm->isPreemptionSupported()); } -TEST_F(HwInfoConfigTestLinuxDummy, givenDebugFlagSetWhenConfiguringHwInfoThenPrintGetParamIoctlsOutput) { +TEST_F(ProductHelperTestLinux, givenDebugFlagSetWhenConfiguringHwInfoThenPrintGetParamIoctlsOutput) { DebugManagerStateRestore restore; DebugManager.flags.PrintIoctlEntries.set(true); testing::internal::CaptureStdout(); // start capturing - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); std::array expectedStrings = {{"DRM_IOCTL_I915_GETPARAM: param: I915_PARAM_HAS_SCHEDULER, output value: 7, retCode: 0" @@ -205,143 +205,143 @@ TEST_F(HwInfoConfigTestLinuxDummy, givenDebugFlagSetWhenConfiguringHwInfoThenPri EXPECT_EQ(std::string::npos, output.find("UNKNOWN")); } -TEST_F(HwInfoConfigTestLinuxDummy, GivenPreemptionDrmEnabledMidBatchOnWhenConfiguringHwInfoThenPreemptionIsSupported) { +TEST_F(ProductHelperTestLinux, GivenPreemptionDrmEnabledMidBatchOnWhenConfiguringHwInfoThenPreemptionIsSupported) { pInHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread; drm->storedPreemptionSupport = I915_SCHEDULER_CAP_ENABLED | I915_SCHEDULER_CAP_PRIORITY | I915_SCHEDULER_CAP_PREEMPTION; - hwConfig.enableMidBatchPreemption = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + productHelper.enableMidBatchPreemption = true; + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_EQ(PreemptionMode::MidBatch, outHwInfo.capabilityTable.defaultPreemptionMode); EXPECT_TRUE(drm->isPreemptionSupported()); } -TEST_F(HwInfoConfigTestLinuxDummy, WhenConfiguringHwInfoThenPreemptionIsSupportedPreemptionDrmEnabledNoPreemptionWhenConfiguringHwInfoThenPreemptionIsNotSupported) { +TEST_F(ProductHelperTestLinux, WhenConfiguringHwInfoThenPreemptionIsSupportedPreemptionDrmEnabledNoPreemptionWhenConfiguringHwInfoThenPreemptionIsNotSupported) { pInHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread; drm->storedPreemptionSupport = I915_SCHEDULER_CAP_ENABLED | I915_SCHEDULER_CAP_PRIORITY | I915_SCHEDULER_CAP_PREEMPTION; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_EQ(PreemptionMode::Disabled, outHwInfo.capabilityTable.defaultPreemptionMode); EXPECT_TRUE(drm->isPreemptionSupported()); } -TEST_F(HwInfoConfigTestLinuxDummy, GivenPreemptionDrmDisabledAllPreemptionWhenConfiguringHwInfoThenPreemptionIsNotSupported) { +TEST_F(ProductHelperTestLinux, GivenPreemptionDrmDisabledAllPreemptionWhenConfiguringHwInfoThenPreemptionIsNotSupported) { pInHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread; drm->storedPreemptionSupport = 0; - hwConfig.enableMidThreadPreemption = true; - hwConfig.enableMidBatchPreemption = true; - hwConfig.enableThreadGroupPreemption = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); - hwConfig.enableMidThreadPreemption = true; + productHelper.enableMidThreadPreemption = true; + productHelper.enableMidBatchPreemption = true; + productHelper.enableThreadGroupPreemption = true; + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + productHelper.enableMidThreadPreemption = true; EXPECT_EQ(0, ret); EXPECT_EQ(PreemptionMode::Disabled, outHwInfo.capabilityTable.defaultPreemptionMode); EXPECT_FALSE(drm->isPreemptionSupported()); } -TEST_F(HwInfoConfigTestLinuxDummy, GivenPreemptionDrmEnabledAllPreemptionDriverThreadGroupWhenConfiguringHwInfoThenPreemptionIsSupported) { +TEST_F(ProductHelperTestLinux, GivenPreemptionDrmEnabledAllPreemptionDriverThreadGroupWhenConfiguringHwInfoThenPreemptionIsSupported) { pInHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::ThreadGroup; drm->storedPreemptionSupport = I915_SCHEDULER_CAP_ENABLED | I915_SCHEDULER_CAP_PRIORITY | I915_SCHEDULER_CAP_PREEMPTION; - hwConfig.enableMidBatchPreemption = true; - hwConfig.enableThreadGroupPreemption = true; - hwConfig.enableMidThreadPreemption = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + productHelper.enableMidBatchPreemption = true; + productHelper.enableThreadGroupPreemption = true; + productHelper.enableMidThreadPreemption = true; + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_EQ(PreemptionMode::ThreadGroup, outHwInfo.capabilityTable.defaultPreemptionMode); EXPECT_TRUE(drm->isPreemptionSupported()); } -TEST_F(HwInfoConfigTestLinuxDummy, GivenPreemptionDrmEnabledAllPreemptionDriverMidBatchWhenConfiguringHwInfoThenPreemptionIsSupported) { +TEST_F(ProductHelperTestLinux, GivenPreemptionDrmEnabledAllPreemptionDriverMidBatchWhenConfiguringHwInfoThenPreemptionIsSupported) { pInHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::MidBatch; drm->storedPreemptionSupport = I915_SCHEDULER_CAP_ENABLED | I915_SCHEDULER_CAP_PRIORITY | I915_SCHEDULER_CAP_PREEMPTION; - hwConfig.enableMidBatchPreemption = true; - hwConfig.enableThreadGroupPreemption = true; - hwConfig.enableMidThreadPreemption = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + productHelper.enableMidBatchPreemption = true; + productHelper.enableThreadGroupPreemption = true; + productHelper.enableMidThreadPreemption = true; + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_EQ(PreemptionMode::MidBatch, outHwInfo.capabilityTable.defaultPreemptionMode); EXPECT_TRUE(drm->isPreemptionSupported()); } -TEST_F(HwInfoConfigTestLinuxDummy, GivenConfigPreemptionDrmEnabledAllPreemptionDriverDisabledWhenConfiguringHwInfoThenPreemptionIsSupported) { +TEST_F(ProductHelperTestLinux, GivenConfigPreemptionDrmEnabledAllPreemptionDriverDisabledWhenConfiguringHwInfoThenPreemptionIsSupported) { pInHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::Disabled; drm->storedPreemptionSupport = I915_SCHEDULER_CAP_ENABLED | I915_SCHEDULER_CAP_PRIORITY | I915_SCHEDULER_CAP_PREEMPTION; - hwConfig.enableMidBatchPreemption = true; - hwConfig.enableThreadGroupPreemption = true; - hwConfig.enableMidThreadPreemption = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + productHelper.enableMidBatchPreemption = true; + productHelper.enableThreadGroupPreemption = true; + productHelper.enableMidThreadPreemption = true; + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_EQ(PreemptionMode::Disabled, outHwInfo.capabilityTable.defaultPreemptionMode); EXPECT_TRUE(drm->isPreemptionSupported()); } -TEST_F(HwInfoConfigTestLinuxDummy, givenPlatformEnabledFtrCompressionWhenInitializingThenFlagsAreSet) { +TEST_F(ProductHelperTestLinux, givenPlatformEnabledFtrCompressionWhenInitializingThenFlagsAreSet) { pInHwInfo.capabilityTable.ftrRenderCompressedImages = true; pInHwInfo.capabilityTable.ftrRenderCompressedBuffers = true; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedImages); EXPECT_TRUE(outHwInfo.capabilityTable.ftrRenderCompressedBuffers); } -TEST_F(HwInfoConfigTestLinuxDummy, givenPointerToHwInfoWhenConfigureHwInfoCalledThenRequiedSurfaceSizeIsSettedProperly) { +TEST_F(ProductHelperTestLinux, givenPointerToHwInfoWhenConfigureHwInfoCalledThenRequiedSurfaceSizeIsSettedProperly) { EXPECT_EQ(MemoryConstants::pageSize, pInHwInfo.capabilityTable.requiredPreemptionSurfaceSize); - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); auto expectedSize = static_cast(outHwInfo.gtSystemInfo.CsrSizeInMb * MemoryConstants::megaByte); HwHelper::get(outHwInfo.platform.eRenderCoreFamily).adjustPreemptionSurfaceSize(expectedSize); EXPECT_EQ(expectedSize, outHwInfo.capabilityTable.requiredPreemptionSurfaceSize); } -TEST_F(HwInfoConfigTestLinuxDummy, givenInstrumentationForHardwareIsEnabledOrDisabledWhenConfiguringHwInfoThenOverrideItUsingHaveInstrumentation) { +TEST_F(ProductHelperTestLinux, givenInstrumentationForHardwareIsEnabledOrDisabledWhenConfiguringHwInfoThenOverrideItUsingHaveInstrumentation) { int ret; pInHwInfo.capabilityTable.instrumentationEnabled = false; - ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); ASSERT_EQ(0, ret); EXPECT_FALSE(outHwInfo.capabilityTable.instrumentationEnabled); pInHwInfo.capabilityTable.instrumentationEnabled = true; - ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); ASSERT_EQ(0, ret); EXPECT_TRUE(outHwInfo.capabilityTable.instrumentationEnabled); } -TEST_F(HwInfoConfigTestLinuxDummy, givenGttSizeReturnedWhenInitializingHwInfoThenSetSvmFtr) { +TEST_F(ProductHelperTestLinux, givenGttSizeReturnedWhenInitializingHwInfoThenSetSvmFtr) { drm->storedGTTSize = MemoryConstants::max64BitAppAddress; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_FALSE(outHwInfo.capabilityTable.ftrSvm); drm->storedGTTSize = MemoryConstants::max64BitAppAddress + 1; - ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_TRUE(outHwInfo.capabilityTable.ftrSvm); } -TEST_F(HwInfoConfigTestLinuxDummy, givenGttSizeReturnedWhenInitializingHwInfoThenSetGpuAddressSpace) { +TEST_F(ProductHelperTestLinux, givenGttSizeReturnedWhenInitializingHwInfoThenSetGpuAddressSpace) { drm->storedGTTSize = maxNBitValue(40) + 1; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_EQ(drm->storedGTTSize - 1, outHwInfo.capabilityTable.gpuAddressSpace); } -TEST_F(HwInfoConfigTestLinuxDummy, givenFailingGttSizeIoctlWhenInitializingHwInfoThenSetDefaultValues) { +TEST_F(ProductHelperTestLinux, givenFailingGttSizeIoctlWhenInitializingHwInfoThenSetDefaultValues) { drm->storedRetValForGetGttSize = -1; - int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); + int ret = productHelper.configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); EXPECT_EQ(0, ret); EXPECT_TRUE(outHwInfo.capabilityTable.ftrSvm); diff --git a/shared/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp b/shared/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp index 7a81d4eb46..7d6963e49f 100644 --- a/shared/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp @@ -48,48 +48,49 @@ HelperType &HwInfoConfigTestWindows::getHelper() const { template ProductHelper &HwInfoConfigTestWindows::getHelper() const; template CoreHelper &HwInfoConfigTestWindows::getHelper() const; -TEST_F(HwInfoConfigTestWindows, givenCorrectParametersWhenConfiguringHwInfoThenReturnSuccess) { +using ProductHelperTestWindows = HwInfoConfigTestWindows; - int ret = hwConfig.configureHwInfoWddm(&pInHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); +TEST_F(ProductHelperTestWindows, givenCorrectParametersWhenConfiguringHwInfoThenReturnSuccess) { + + int ret = productHelper->configureHwInfoWddm(&pInHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); EXPECT_EQ(0, ret); } -TEST_F(HwInfoConfigTestWindows, givenCorrectParametersWhenConfiguringHwInfoThenSetFtrSvmCorrectly) { +TEST_F(ProductHelperTestWindows, givenCorrectParametersWhenConfiguringHwInfoThenSetFtrSvmCorrectly) { auto ftrSvm = outHwInfo.featureTable.flags.ftrSVM; - int ret = hwConfig.configureHwInfoWddm(&pInHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); + int ret = productHelper->configureHwInfoWddm(&pInHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); ASSERT_EQ(0, ret); EXPECT_EQ(outHwInfo.capabilityTable.ftrSvm, ftrSvm); } -TEST_F(HwInfoConfigTestWindows, givenInstrumentationForHardwareIsEnabledOrDisabledWhenConfiguringHwInfoThenOverrideItUsingHaveInstrumentation) { +TEST_F(ProductHelperTestWindows, givenInstrumentationForHardwareIsEnabledOrDisabledWhenConfiguringHwInfoThenOverrideItUsingHaveInstrumentation) { int ret; outHwInfo.capabilityTable.instrumentationEnabled = false; - ret = hwConfig.configureHwInfoWddm(&pInHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); + ret = productHelper->configureHwInfoWddm(&pInHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); ASSERT_EQ(0, ret); EXPECT_FALSE(outHwInfo.capabilityTable.instrumentationEnabled); outHwInfo.capabilityTable.instrumentationEnabled = true; - ret = hwConfig.configureHwInfoWddm(&pInHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); + ret = productHelper->configureHwInfoWddm(&pInHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); ASSERT_EQ(0, ret); EXPECT_TRUE(outHwInfo.capabilityTable.instrumentationEnabled); } -HWTEST_F(HwInfoConfigTestWindows, givenFtrIaCoherencyFlagWhenConfiguringHwInfoThenSetCoherencySupportCorrectly) { +HWTEST_F(ProductHelperTestWindows, givenFtrIaCoherencyFlagWhenConfiguringHwInfoThenSetCoherencySupportCorrectly) { HardwareInfo initialHwInfo = *defaultHwInfo; - auto &productHelper = rootDeviceEnvironment->getHelper(); bool initialCoherencyStatus = false; - productHelper.setCapabilityCoherencyFlag(outHwInfo, initialCoherencyStatus); + productHelper->setCapabilityCoherencyFlag(outHwInfo, initialCoherencyStatus); initialHwInfo.featureTable.flags.ftrL3IACoherency = false; - productHelper.configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); + productHelper->configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); EXPECT_FALSE(outHwInfo.capabilityTable.ftrSupportsCoherency); initialHwInfo.featureTable.flags.ftrL3IACoherency = true; - productHelper.configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); + productHelper->configureHwInfoWddm(&initialHwInfo, &outHwInfo, *rootDeviceEnvironment.get()); EXPECT_EQ(initialCoherencyStatus, outHwInfo.capabilityTable.ftrSupportsCoherency); } diff --git a/shared/test/unit_test/xe_hpc_core/excludes_xe_hpc_core.cpp b/shared/test/unit_test/xe_hpc_core/excludes_xe_hpc_core.cpp index 52b21d1663..43735e816e 100644 --- a/shared/test/unit_test/xe_hpc_core/excludes_xe_hpc_core.cpp +++ b/shared/test/unit_test/xe_hpc_core/excludes_xe_hpc_core.cpp @@ -30,18 +30,18 @@ HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeProgrammingWhenL 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); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsAdjustProgrammableIdPreferredSlmSizeRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsComputeDispatchAllWalkerEnableInCfeStateRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsComputeDispatchAllWalkerEnableInComputeWalkerRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsGlobalFenceInCommandStreamRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsSystolicModeConfigurabledThenFalseIsReturned, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenGetThreadEuRatioForScratchThen8IsReturned, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenCallingGetDeviceMemoryNameThenDdrIsReturned, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHardwareInfoWhenCallingIsMaxThreadsForWorkgroupWARequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned, IGFX_XE_HPC_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsPrefetcherDisablingInDirectSubmissionRequiredThenTrueIsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsAdjustProgrammableIdPreferredSlmSizeRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsComputeDispatchAllWalkerEnableInCfeStateRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsComputeDispatchAllWalkerEnableInComputeWalkerRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsGlobalFenceInCommandStreamRequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsSystolicModeConfigurabledThenFalseIsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenGetThreadEuRatioForScratchThen8IsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenCallingGetDeviceMemoryNameThenDdrIsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenHardwareInfoWhenCallingIsMaxThreadsForWorkgroupWARequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenFalseIsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned, IGFX_XE_HPC_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsPrefetcherDisablingInDirectSubmissionRequiredThenTrueIsReturned, IGFX_XE_HPC_CORE); HWTEST_EXCLUDE_PRODUCT(DirectSubmissionTest, givenDebugFlagSetWhenDispatchingPrefetcherThenSetCorrectValue, IGFX_XE_HPC_CORE); HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenRingBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet, IGFX_XE_HPC_CORE); HWTEST_EXCLUDE_PRODUCT(GetAllocationDataTestHw, givenSemaphoreBufferAllocationWhenGetAllocationDataIsCalledThenItHasProperFieldsSet, IGFX_XE_HPC_CORE); diff --git a/shared/test/unit_test/xe_hpc_core/pvc/excludes_xe_hpc_core_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/excludes_xe_hpc_core_pvc.cpp index 16da2942fe..a519d49fc8 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/excludes_xe_hpc_core_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/excludes_xe_hpc_core_pvc.cpp @@ -7,4 +7,4 @@ #include "shared/test/common/test_macros/hw_test_base.h" -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfIsBlitSplitEnqueueWARequiredThenReturnFalse, IGFX_PVC); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfIsBlitSplitEnqueueWARequiredThenReturnFalse, IGFX_PVC); diff --git a/shared/test/unit_test/xe_hpc_core/pvc/linux/hw_info_config_tests_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/linux/hw_info_config_tests_pvc.cpp index 3f8ea0fbfe..3625a8b748 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/linux/hw_info_config_tests_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/linux/hw_info_config_tests_pvc.cpp @@ -61,7 +61,7 @@ PVCTEST_F(PvcProductHelperLinux, GivenPvcWhenConfigureHardwareCustomThenKmdNotif EXPECT_EQ(20ll, pInHwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds); } -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPatIndexProgrammingSupportedThenReturnFalse, IGFX_PVC); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPatIndexProgrammingSupportedThenReturnFalse, IGFX_PVC); PVCTEST_F(PvcProductHelperLinux, givenProductHelperWhenAskedIfPatIndexProgrammingSupportedThenReturnTrue) { diff --git a/shared/test/unit_test/xe_hpg_core/dg2/excludes_xe_hpg_core_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/excludes_xe_hpg_core_dg2.cpp index 87d4804254..2b16e09b28 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/excludes_xe_hpg_core_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/excludes_xe_hpg_core_dg2.cpp @@ -7,19 +7,19 @@ #include "shared/test/common/test_macros/hw_test_base.h" -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, WhenAllowCompressionIsCalledThenTrueIsReturned, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHardwareInfoWhenCallingIsAdditionalStateBaseAddressWARequiredThenFalseIsReturned, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHardwareInfoWhenCallingIsMaxThreadsForWorkgroupWARequiredThenFalseIsReturned, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedForDefaultEngineTypeAdjustmentThenFalseIsReturned, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfAllocationSizeAdjustmentIsRequiredThenFalseIsReturned, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPrefetchDisablingIsRequiredThenFalseIsReturned, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenFalseIsReturned, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenConvertingTimestampsToCsDomainThenNothingIsChanged, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfStorageInfoAdjustmentIsRequiredThenFalseIsReturned, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteByPassPolicyOption_IsAtLeastXeHpgCore, IGFX_DG2); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenGetL1CachePolicyThenReturnWriteByPass_IsAtLeastXeHpgCore, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, WhenAllowCompressionIsCalledThenTrueIsReturned, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenHardwareInfoWhenCallingIsAdditionalStateBaseAddressWARequiredThenFalseIsReturned, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenHardwareInfoWhenCallingIsMaxThreadsForWorkgroupWARequiredThenFalseIsReturned, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedForDefaultEngineTypeAdjustmentThenFalseIsReturned, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfAllocationSizeAdjustmentIsRequiredThenFalseIsReturned, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPrefetchDisablingIsRequiredThenFalseIsReturned, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenFalseIsReturned, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenConvertingTimestampsToCsDomainThenNothingIsChanged, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfStorageInfoAdjustmentIsRequiredThenFalseIsReturned, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(CompilerHwInfoConfigFixture, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteByPassPolicyOption_IsAtLeastXeHpgCore, IGFX_DG2); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenGetL1CachePolicyThenReturnWriteByPass_IsAtLeastXeHpgCore, IGFX_DG2); HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetL1CachePolicyThenReturnCorrectValue_IsAtLeastXeHpgCore, IGFX_DG2); HWTEST_EXCLUDE_PRODUCT(AILTests, whenModifyKernelIfRequiredIsCalledThenDontChangeKernelSources, IGFX_DG2); HWTEST_EXCLUDE_PRODUCT(CommandEncodeStatesTest, givenSlmTotalSizeEqualZeroWhenDispatchingKernelThenSharedMemorySizeIsSetCorrectly, IGFX_DG2); diff --git a/shared/test/unit_test/xe_hpg_core/excludes_xe_hpg_core.cpp b/shared/test/unit_test/xe_hpg_core/excludes_xe_hpg_core.cpp index b7f2b94437..73b104b550 100644 --- a/shared/test/unit_test/xe_hpg_core/excludes_xe_hpg_core.cpp +++ b/shared/test/unit_test/xe_hpg_core/excludes_xe_hpg_core.cpp @@ -7,10 +7,10 @@ #include "shared/test/common/test_macros/hw_test_base.h" -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenSamplerStateWhenAdjustSamplerStateThenNothingIsChanged, IGFX_XE_HPG_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfBlitterForImagesIsSupportedThenFalseIsReturned, IGFX_XE_HPG_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned, IGFX_XE_HPG_CORE); -HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenIsSystolicModeConfigurabledThenFalseIsReturned, IGFX_XE_HPG_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenSamplerStateWhenAdjustSamplerStateThenNothingIsChanged, IGFX_XE_HPG_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfBlitterForImagesIsSupportedThenFalseIsReturned, IGFX_XE_HPG_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned, IGFX_XE_HPG_CORE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsSystolicModeConfigurabledThenFalseIsReturned, IGFX_XE_HPG_CORE); HWTEST_EXCLUDE_PRODUCT(CommandEncodeStatesTest, givenEventAddressWhenEncodeThenMocsFromGmmHelperIsSet, IGFX_XE_HPG_CORE); HWTEST_EXCLUDE_PRODUCT(XeHPAndLaterPreemptionTests, GivenDebuggerUsedWhenProgrammingStateSipThenStateSipIsAdded, IGFX_XE_HPG_CORE); HWTEST_EXCLUDE_PRODUCT(ComputeModeRequirements, givenComputeModeCmdSizeWhenLargeGrfModeChangeIsRequiredThenSCMCommandSizeIsCalculated, IGFX_XE_HPG_CORE);