diff --git a/shared/source/os_interface/linux/drm_neo.cpp b/shared/source/os_interface/linux/drm_neo.cpp index fcbd79b745..17321a2558 100644 --- a/shared/source/os_interface/linux/drm_neo.cpp +++ b/shared/source/os_interface/linux/drm_neo.cpp @@ -43,6 +43,7 @@ #include "shared/source/os_interface/os_environment.h" #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/product_helper.h" +#include "shared/source/release_helper/release_helper.h" #include "shared/source/utilities/api_intercept.h" #include "shared/source/utilities/directory.h" #include "shared/source/utilities/io_functions.h" @@ -510,6 +511,11 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl hwInfo->gtSystemInfo.SubSliceCount = static_cast(topologyData.subSliceCount); hwInfo->gtSystemInfo.DualSubSliceCount = static_cast(topologyData.subSliceCount); hwInfo->gtSystemInfo.EUCount = static_cast(topologyData.euCount); + + auto releaseHelper = rootDeviceEnvironment.getReleaseHelper(); + auto numThreadsPerEu = releaseHelper ? releaseHelper->getNumThreadsPerEu() : 7u; + hwInfo->gtSystemInfo.ThreadCount = numThreadsPerEu * hwInfo->gtSystemInfo.EUCount; + if (topologyData.maxSubSliceCount > 0) { hwInfo->gtSystemInfo.MaxSubSlicesSupported = static_cast(topologyData.maxSubSliceCount); hwInfo->gtSystemInfo.MaxDualSubSlicesSupported = static_cast(topologyData.maxSubSliceCount); @@ -526,7 +532,6 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl } status = querySystemInfo(); - auto releaseHelper = rootDeviceEnvironment.getReleaseHelper(); device->setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper); rootDeviceEnvironment.setRcsExposure(); diff --git a/shared/source/os_interface/linux/product_helper_drm.cpp b/shared/source/os_interface/linux/product_helper_drm.cpp index 4f707fdae2..01cd312dbc 100644 --- a/shared/source/os_interface/linux/product_helper_drm.cpp +++ b/shared/source/os_interface/linux/product_helper_drm.cpp @@ -15,7 +15,6 @@ #include "shared/source/os_interface/linux/drm_neo.h" #include "shared/source/os_interface/os_interface.h" #include "shared/source/os_interface/product_helper.h" -#include "shared/source/release_helper/release_helper.h" #include "shared/source/utilities/cpu_info.h" #include @@ -74,49 +73,6 @@ int ProductHelper::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo auto gtSystemInfo = &outHwInfo->gtSystemInfo; auto featureTable = &outHwInfo->featureTable; - DrmQueryTopologyData topologyData = {}; - - bool status = drm->queryTopology(*outHwInfo, topologyData); - - if (!status) { - PRINT_DEBUG_STRING(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Topology query failed!\n"); - - topologyData.sliceCount = gtSystemInfo->SliceCount; - - ret = drm->getEuTotal(topologyData.euCount); - if (ret != 0) { - PRINT_DEBUG_STRING(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "FATAL: Cannot query EU total parameter!\n"); - *outHwInfo = {}; - return ret; - } - - ret = drm->getSubsliceTotal(topologyData.subSliceCount); - if (ret != 0) { - PRINT_DEBUG_STRING(debugManager.flags.PrintDebugMessages.get(), stderr, "%s", "FATAL: Cannot query subslice total parameter!\n"); - *outHwInfo = {}; - return ret; - } - - topologyData.maxEuPerSubSlice = topologyData.subSliceCount > 0 ? topologyData.euCount / topologyData.subSliceCount : 0; - topologyData.maxSliceCount = topologyData.sliceCount; - topologyData.maxSubSliceCount = topologyData.sliceCount > 0 ? topologyData.subSliceCount / topologyData.sliceCount : 0; - } - - auto releaseHelper = rootDeviceEnvironment.getReleaseHelper(); - - auto numThreadsPerEu = releaseHelper ? releaseHelper->getNumThreadsPerEu() : 7u; - - gtSystemInfo->SliceCount = static_cast(topologyData.sliceCount); - gtSystemInfo->SubSliceCount = static_cast(topologyData.subSliceCount); - gtSystemInfo->DualSubSliceCount = static_cast(topologyData.subSliceCount); - gtSystemInfo->EUCount = static_cast(topologyData.euCount); - gtSystemInfo->ThreadCount = numThreadsPerEu * gtSystemInfo->EUCount; - - gtSystemInfo->MaxEuPerSubSlice = gtSystemInfo->MaxEuPerSubSlice != 0 ? gtSystemInfo->MaxEuPerSubSlice : topologyData.maxEuPerSubSlice; - gtSystemInfo->MaxSubSlicesSupported = std::max(static_cast(topologyData.maxSubSliceCount * topologyData.maxSliceCount), gtSystemInfo->MaxSubSlicesSupported); - gtSystemInfo->MaxSlicesSupported = topologyData.maxSliceCount; - gtSystemInfo->MaxDualSubSlicesSupported = gtSystemInfo->MaxSubSlicesSupported; - gtSystemInfo->IsDynamicallyPopulated = true; for (uint32_t slice = 0; slice < GT_MAX_SLICE; slice++) { gtSystemInfo->SliceInfo[slice].Enabled = slice < gtSystemInfo->SliceCount; diff --git a/shared/test/unit_test/gen11/ehl/linux/product_helper_tests_ehl.cpp b/shared/test/unit_test/gen11/ehl/linux/product_helper_tests_ehl.cpp index 085d54e6e6..113de14879 100644 --- a/shared/test/unit_test/gen11/ehl/linux/product_helper_tests_ehl.cpp +++ b/shared/test/unit_test/gen11/ehl/linux/product_helper_tests_ehl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2023 Intel Corporation + * Copyright (C) 2019-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,35 +13,6 @@ using namespace NEO; -struct EhlProductHelperLinux : ProductHelperTestLinux { - void SetUp() override { - ProductHelperTestLinux::SetUp(); - - drm->storedSSVal = 8; - } -}; - -EHLTEST_F(EhlProductHelperLinux, GivenEhlThenHwInfoIsCorrect) { - int ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); -} - -EHLTEST_F(EhlProductHelperLinux, GivenInvalidDeviceIdWhenConfiguringHwInfoThenNegativeOneReturned) { - - drm->failRetTopology = true; - drm->storedRetValForEUVal = -1; - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); - - drm->storedRetValForEUVal = 0; - drm->storedRetValForSSVal = -1; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); -} - template class EhlHwInfoTests : public ::testing::Test {}; TEST(EhlHwInfoTests, WhenGtIsSetupThenGtSystemInfoIsCorrect) { diff --git a/shared/test/unit_test/gen11/icllp/linux/product_helper_tests_icllp.cpp b/shared/test/unit_test/gen11/icllp/linux/product_helper_tests_icllp.cpp index 4a0c3f8cee..fa7d1e1417 100644 --- a/shared/test/unit_test/gen11/icllp/linux/product_helper_tests_icllp.cpp +++ b/shared/test/unit_test/gen11/icllp/linux/product_helper_tests_icllp.cpp @@ -14,37 +14,6 @@ using namespace NEO; -struct IcllpProductHelperLinux : ProductHelperTestLinux { - void SetUp() override { - ProductHelperTestLinux::SetUp(); - } -}; - -ICLLPTEST_F(IcllpProductHelperLinux, GivenIcllpThenHwInfoIsCorrect) { - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); - EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); - - EXPECT_FALSE(outHwInfo.featureTable.flags.ftrTileY); -} - -ICLLPTEST_F(IcllpProductHelperLinux, GivenInvalidDeviceIdWhenConfiguringHwInfoThenNegativeOneReturned) { - - drm->failRetTopology = true; - drm->storedRetValForEUVal = -1; - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); - - drm->storedRetValForEUVal = 0; - drm->storedRetValForSSVal = -1; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); -} - template class IcllpHwInfoTests : public ::testing::Test {}; typedef ::testing::Types icllpTestTypes; diff --git a/shared/test/unit_test/gen11/lkf/linux/product_helper_tests_lkf.cpp b/shared/test/unit_test/gen11/lkf/linux/product_helper_tests_lkf.cpp index b4fe32904e..132be67ebe 100644 --- a/shared/test/unit_test/gen11/lkf/linux/product_helper_tests_lkf.cpp +++ b/shared/test/unit_test/gen11/lkf/linux/product_helper_tests_lkf.cpp @@ -13,40 +13,6 @@ using namespace NEO; -struct LkfProductHelperLinux : ProductHelperTestLinux { - void SetUp() override { - ProductHelperTestLinux::SetUp(); - - drm->storedSSVal = 8; - } -}; - -LKFTEST_F(LkfProductHelperLinux, GivenLkfThenHwInfoIsCorrect) { - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); - - EXPECT_FALSE(outHwInfo.featureTable.flags.ftrTileY); -} - -LKFTEST_F(LkfProductHelperLinux, GivenInvalidDeviceIdWhenConfiguringHwInfoThenNegativeOneReturned) { - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - - drm->failRetTopology = true; - drm->storedRetValForEUVal = -1; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); - - drm->storedRetValForEUVal = 0; - drm->storedRetValForSSVal = -1; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); -} - template class LkfHwInfoTests : public ::testing::Test {}; using lkfTestTypes = ::testing::Types; diff --git a/shared/test/unit_test/gen12lp/adln/linux/product_helper_tests_adln.cpp b/shared/test/unit_test/gen12lp/adln/linux/product_helper_tests_adln.cpp index a2860813b9..de73301031 100644 --- a/shared/test/unit_test/gen12lp/adln/linux/product_helper_tests_adln.cpp +++ b/shared/test/unit_test/gen12lp/adln/linux/product_helper_tests_adln.cpp @@ -1,54 +1,21 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2024 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/execution_environment/execution_environment.h" +#include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen12lp/hw_cmds_adln.h" #include "shared/source/gen12lp/hw_info_gen12lp.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/gtest_helpers.h" #include "shared/test/common/libult/linux/drm_mock.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" -#include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h" using namespace NEO; -struct AdlnProductHelperLinux : ProductHelperTestLinux { - void SetUp() override { - ProductHelperTestLinux::SetUp(); - - drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]); - osInterface->setDriverModel(std::unique_ptr(drm)); - } -}; - -ADLNTEST_F(AdlnProductHelperLinux, WhenConfiguringHwInfoThenConfigIsCorrect) { - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ(static_cast(drm->storedEUVal), outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ(static_cast(drm->storedSSVal), outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); - - EXPECT_FALSE(outHwInfo.featureTable.flags.ftrTileY); -} - -ADLNTEST_F(AdlnProductHelperLinux, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) { - - drm->failRetTopology = true; - drm->storedRetValForEUVal = -1; - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); - - drm->storedRetValForEUVal = 0; - drm->storedRetValForSSVal = -1; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - - EXPECT_EQ(-1, ret); -} - using AdlnHwInfoLinux = ::testing::Test; ADLNTEST_F(AdlnHwInfoLinux, WhenSettingUpHwInfoThenConfigIsCorrect) { diff --git a/shared/test/unit_test/gen12lp/adlp/linux/product_helper_tests_adlp.cpp b/shared/test/unit_test/gen12lp/adlp/linux/product_helper_tests_adlp.cpp index 00e1ac1a71..577e046a7d 100644 --- a/shared/test/unit_test/gen12lp/adlp/linux/product_helper_tests_adlp.cpp +++ b/shared/test/unit_test/gen12lp/adlp/linux/product_helper_tests_adlp.cpp @@ -13,46 +13,11 @@ #include "shared/test/common/helpers/gtest_helpers.h" #include "shared/test/common/libult/linux/drm_mock.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" -#include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h" using namespace NEO; -struct AdlpProductHelperLinux : ProductHelperTestLinux { - void SetUp() override { - ProductHelperTestLinux::SetUp(); - - drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]); - osInterface->setDriverModel(std::unique_ptr(drm)); - } -}; - -ADLPTEST_F(AdlpProductHelperLinux, WhenConfiguringHwInfoThenInfoIsSetCorrectly) { - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - - EXPECT_EQ(0, ret); - EXPECT_EQ(static_cast(drm->storedEUVal), outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ(static_cast(drm->storedSSVal), outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); - - EXPECT_FALSE(outHwInfo.featureTable.flags.ftrTileY); -} - -ADLPTEST_F(AdlpProductHelperLinux, GivenInvalidDeviceIdWhenConfiguringHwInfoThenErrorIsReturned) { - - drm->failRetTopology = true; - drm->storedRetValForEUVal = -1; - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - - EXPECT_EQ(-1, ret); - - drm->storedRetValForEUVal = 0; - drm->storedRetValForSSVal = -1; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); -} - -ADLPTEST_F(AdlpProductHelperLinux, givenAdlpConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { +using AdlpHwInfoLinux = ::testing::Test; +ADLPTEST_F(AdlpHwInfoLinux, givenAdlpConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { HardwareInfo hwInfo = *defaultHwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; ADLP::setupHardwareInfoBase(&hwInfo, false, nullptr); @@ -63,16 +28,11 @@ ADLPTEST_F(AdlpProductHelperLinux, givenAdlpConfigWhenSetupHardwareInfoBaseThenG EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); } -template -using AdlpHwInfoLinux = ::testing::Test; -using adlpConfigTestTypes = ::testing::Types; -TYPED_TEST_SUITE(AdlpHwInfoLinux, adlpConfigTestTypes); - -TYPED_TEST(AdlpHwInfoLinux, givenSliceCountZeroWhenSetupHardwareInfoThenNotZeroValuesSetInGtSystemInfo) { +ADLPTEST_F(AdlpHwInfoLinux, givenSliceCountZeroWhenSetupHardwareInfoThenNotZeroValuesSetInGtSystemInfo) { HardwareInfo hwInfo = *defaultHwInfo; hwInfo.gtSystemInfo = {0}; - TypeParam::setupHardwareInfo(&hwInfo, false, nullptr); + AdlpHwConfig::setupHardwareInfo(&hwInfo, false, nullptr); EXPECT_NE(0u, hwInfo.gtSystemInfo.SliceCount); EXPECT_NE(0u, hwInfo.gtSystemInfo.SubSliceCount); diff --git a/shared/test/unit_test/gen12lp/adls/linux/product_helper_tests_adls.cpp b/shared/test/unit_test/gen12lp/adls/linux/product_helper_tests_adls.cpp index 7e81f4bbac..12f0cab4e2 100644 --- a/shared/test/unit_test/gen12lp/adls/linux/product_helper_tests_adls.cpp +++ b/shared/test/unit_test/gen12lp/adls/linux/product_helper_tests_adls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,40 +15,6 @@ using namespace NEO; -struct AdlsProductHelperLinux : ProductHelperTestLinux { - void SetUp() override { - ProductHelperTestLinux::SetUp(); - - drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]); - osInterface->setDriverModel(std::unique_ptr(drm)); - } -}; - -ADLSTEST_F(AdlsProductHelperLinux, WhenConfiguringHwInfoThenConfigIsCorrect) { - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - - EXPECT_EQ(0, ret); - EXPECT_EQ(static_cast(drm->storedEUVal), outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ(static_cast(drm->storedSSVal), outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); - - EXPECT_FALSE(outHwInfo.featureTable.flags.ftrTileY); -} - -ADLSTEST_F(AdlsProductHelperLinux, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) { - - drm->failRetTopology = true; - drm->storedRetValForEUVal = -1; - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); - - drm->storedRetValForEUVal = 0; - drm->storedRetValForSSVal = -1; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); -} - using AdlsHwInfoLinux = ::testing::Test; ADLSTEST_F(AdlsHwInfoLinux, WhenSettingUpHwInfoThenConfigIsCorrect) { diff --git a/shared/test/unit_test/gen12lp/dg1/linux/product_helper_tests_dg1.cpp b/shared/test/unit_test/gen12lp/dg1/linux/product_helper_tests_dg1.cpp index 7b1389650b..f179798e97 100644 --- a/shared/test/unit_test/gen12lp/dg1/linux/product_helper_tests_dg1.cpp +++ b/shared/test/unit_test/gen12lp/dg1/linux/product_helper_tests_dg1.cpp @@ -48,29 +48,6 @@ DG1TEST_F(Dg1ProductHelperLinux, GivenDG1WhenConfigureHardwareCustomThenKmdNotif EXPECT_EQ(300ll, hardwareInfo.capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds); } -DG1TEST_F(Dg1ProductHelperLinux, WhenConfiguringHwInfoThenInfoIsSetCorrectly) { - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ(static_cast(drm->storedEUVal), outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ(static_cast(drm->storedSSVal), outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); - - EXPECT_FALSE(outHwInfo.featureTable.flags.ftrTileY); -} - -DG1TEST_F(Dg1ProductHelperLinux, GivenInvalidDeviceIdWhenConfiguringHwInfoThenErrorIsReturned) { - - drm->failRetTopology = true; - drm->storedRetValForEUVal = -1; - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); - - drm->storedRetValForEUVal = 0; - drm->storedRetValForSSVal = -1; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); -} - template class Dg1HwInfoLinux : public ::testing::Test {}; using dg1TestTypes = ::testing::Types; diff --git a/shared/test/unit_test/gen12lp/rkl/linux/product_helper_tests_rkl.cpp b/shared/test/unit_test/gen12lp/rkl/linux/product_helper_tests_rkl.cpp index a24d973659..1cf27afc73 100644 --- a/shared/test/unit_test/gen12lp/rkl/linux/product_helper_tests_rkl.cpp +++ b/shared/test/unit_test/gen12lp/rkl/linux/product_helper_tests_rkl.cpp @@ -1,54 +1,21 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2024 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/execution_environment/execution_environment.h" +#include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen12lp/hw_cmds_rkl.h" #include "shared/source/gen12lp/hw_info_gen12lp.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/gtest_helpers.h" #include "shared/test/common/libult/linux/drm_mock.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" -#include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h" using namespace NEO; -struct RklProductHelperLinux : ProductHelperTestLinux { - void SetUp() override { - ProductHelperTestLinux::SetUp(); - - drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]); - osInterface->setDriverModel(std::unique_ptr(drm)); - } -}; - -RKLTEST_F(RklProductHelperLinux, WhenConfiguringHwInfoThenConfigIsCorrect) { - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); - - EXPECT_FALSE(outHwInfo.featureTable.flags.ftrTileY); -} - -RKLTEST_F(RklProductHelperLinux, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) { - - drm->failRetTopology = true; - drm->storedRetValForEUVal = -1; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); - - drm->storedRetValForEUVal = 0; - drm->storedRetValForSSVal = -1; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); -} - using RklHwInfoLinux = ::testing::Test; RKLTEST_F(RklHwInfoLinux, WhenSettingUpHwInfoThenConfigIsCorrect) { diff --git a/shared/test/unit_test/gen12lp/tgllp/linux/product_helper_tests_tgllp.cpp b/shared/test/unit_test/gen12lp/tgllp/linux/product_helper_tests_tgllp.cpp index 36bc8ebf98..019886cb6b 100644 --- a/shared/test/unit_test/gen12lp/tgllp/linux/product_helper_tests_tgllp.cpp +++ b/shared/test/unit_test/gen12lp/tgllp/linux/product_helper_tests_tgllp.cpp @@ -38,32 +38,6 @@ TGLLPTEST_F(TgllpProductHelperLinux, GivenTGLLPWhenConfigureHardwareCustomThenMT EXPECT_FALSE(outHwInfo.featureTable.flags.ftrGpGpuMidThreadLevelPreempt); } -TGLLPTEST_F(TgllpProductHelperLinux, WhenConfiguringHwInfoThenInfoIsSetCorrectly) { - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); - - EXPECT_FALSE(outHwInfo.featureTable.flags.ftrTileY); -} - -TGLLPTEST_F(TgllpProductHelperLinux, GivenInvalidDeviceIdWhenConfiguringHwInfoThenErrorIsReturned) { - - drm->failRetTopology = true; - drm->storedRetValForEUVal = -1; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); - - drm->storedRetValForEUVal = 0; - drm->storedRetValForSSVal = -1; - - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); -} - template class TgllpHwInfoLinux : public ::testing::Test {}; typedef ::testing::Types tgllpTestTypes; diff --git a/shared/test/unit_test/gen8/bdw/linux/product_helper_tests_bdw.cpp b/shared/test/unit_test/gen8/bdw/linux/product_helper_tests_bdw.cpp index 542570181f..3ee2944cae 100644 --- a/shared/test/unit_test/gen8/bdw/linux/product_helper_tests_bdw.cpp +++ b/shared/test/unit_test/gen8/bdw/linux/product_helper_tests_bdw.cpp @@ -13,78 +13,6 @@ using namespace NEO; -struct BdwProductHelperLinux : ProductHelperTestLinux { - void SetUp() override { - ProductHelperTestLinux::SetUp(); - } -}; - -BDWTEST_F(BdwProductHelperLinux, WhenConfiguringHwInfoThenInformationIsCorrect) { - drm->storedSSVal = 3; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); - EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); - - pInHwInfo.platform.usDeviceID = 0x1602; - - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); - - pInHwInfo.platform.usDeviceID = 0x1626; - - drm->storedSSVal = 6; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(2u, outHwInfo.gtSystemInfo.SliceCount); - EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); -} - -BDWTEST_F(BdwProductHelperLinux, GivenFailedIoctlEuCountWhenConfiguringHwInfoThenErrorIsReturned) { - drm->failRetTopology = true; - drm->storedRetValForEUVal = -4; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-4, ret); -} - -BDWTEST_F(BdwProductHelperLinux, GivenFailedIoctlSsCountWhenConfiguringHwInfoThenErrorIsReturned) { - drm->failRetTopology = true; - drm->storedRetValForSSVal = -5; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-5, ret); -} - -BDWTEST_F(BdwProductHelperLinux, WhenConfiguringHwInfoThenEdramInformationIsCorrect) { - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ_VAL(0u, outHwInfo.gtSystemInfo.EdramSizeInKb); - EXPECT_EQ(0u, outHwInfo.featureTable.flags.ftrEDram); - - pInHwInfo.platform.usDeviceID = 0x1622; - - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ_VAL((128u * 1024u), outHwInfo.gtSystemInfo.EdramSizeInKb); - EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrEDram); - - pInHwInfo.platform.usDeviceID = 0x162A; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - EXPECT_EQ_VAL((128u * 1024u), outHwInfo.gtSystemInfo.EdramSizeInKb); - EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrEDram); -} - template class BdwHwInfoTests : public ::testing::Test { }; diff --git a/shared/test/unit_test/gen9/bxt/linux/product_helper_tests_bxt.cpp b/shared/test/unit_test/gen9/bxt/linux/product_helper_tests_bxt.cpp index 978cbc9196..4a97e551f4 100644 --- a/shared/test/unit_test/gen9/bxt/linux/product_helper_tests_bxt.cpp +++ b/shared/test/unit_test/gen9/bxt/linux/product_helper_tests_bxt.cpp @@ -27,11 +27,8 @@ struct BxtProductHelperLinux : ProductHelperTestLinux { BXTTEST_F(BxtProductHelperLinux, WhenConfiguringHwInfoThenConfigIsCorrect) { auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); EXPECT_EQ((unsigned int)drm->storedHasPooledEU, outHwInfo.featureTable.flags.ftrPooledEuEnabled); EXPECT_EQ((uint32_t)drm->storedMinEUinPool, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); // constant sysInfo/ftr flags @@ -41,19 +38,14 @@ BXTTEST_F(BxtProductHelperLinux, WhenConfiguringHwInfoThenConfigIsCorrect) { drm->storedMinEUinPool = 6; ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); EXPECT_EQ((unsigned int)drm->storedHasPooledEU, outHwInfo.featureTable.flags.ftrPooledEuEnabled); EXPECT_EQ((uint32_t)drm->storedMinEUinPool, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); pInHwInfo.platform.usDeviceID = 0x5A85; drm->storedMinEUinPool = 9; ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); EXPECT_EQ((unsigned int)drm->storedHasPooledEU, outHwInfo.featureTable.flags.ftrPooledEuEnabled); EXPECT_EQ((uint32_t)drm->storedMinEUinPool, outHwInfo.gtSystemInfo.EuCountPerPoolMin); EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); @@ -68,26 +60,6 @@ BXTTEST_F(BxtProductHelperLinux, WhenConfiguringHwInfoThenConfigIsCorrect) { EXPECT_EQ(200000, outKmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds); } -BXTTEST_F(BxtProductHelperLinux, GivenFailedIoctlEuCountWhenConfiguringHwInfoThenErrorIsReturned) { - drm->failRetTopology = true; - drm->storedRetValForEUVal = -4; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - - EXPECT_EQ(-4, ret); -} - -BXTTEST_F(BxtProductHelperLinux, GivenFailingEnabledPoolWhenConfiguringHwInfoThenZeroIsReturned) { - drm->storedRetValForPooledEU = -1; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(0u, outHwInfo.featureTable.flags.ftrPooledEuEnabled); - EXPECT_EQ(0u, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ(0u, outHwInfo.gtSystemInfo.EuCountPerPoolMax); -} - BXTTEST_F(BxtProductHelperLinux, GivenDisabledEnabledPoolWhenConfiguringHwInfoThenZeroIsReturned) { drm->storedHasPooledEU = 0; @@ -99,47 +71,6 @@ BXTTEST_F(BxtProductHelperLinux, GivenDisabledEnabledPoolWhenConfiguringHwInfoTh EXPECT_EQ(0u, outHwInfo.gtSystemInfo.EuCountPerPoolMax); } -BXTTEST_F(BxtProductHelperLinux, GivenFailingMinEuInPoolWhenConfiguringHwInfoThenZeroIsReturned) { - drm->storedRetValForMinEUinPool = -1; - drm->storedSSVal = 3; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrPooledEuEnabled); - EXPECT_EQ(9u, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); - - drm->storedSSVal = 2; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrPooledEuEnabled); - EXPECT_EQ(3u, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); -} - -BXTTEST_F(BxtProductHelperLinux, GivenInvalidMinEuInPoolWhenConfiguringHwInfoThenZeroIsReturned) { - drm->storedMinEUinPool = 4; - drm->storedSSVal = 3; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrPooledEuEnabled); - EXPECT_EQ(9u, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); - - drm->storedSSVal = 2; - - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrPooledEuEnabled); - EXPECT_EQ(3u, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); -} - template class BxtHwInfoTests : public ::testing::Test { }; diff --git a/shared/test/unit_test/gen9/cfl/linux/product_helper_tests_cfl.cpp b/shared/test/unit_test/gen9/cfl/linux/product_helper_tests_cfl.cpp index ab498f6013..d045bbc3e3 100644 --- a/shared/test/unit_test/gen9/cfl/linux/product_helper_tests_cfl.cpp +++ b/shared/test/unit_test/gen9/cfl/linux/product_helper_tests_cfl.cpp @@ -24,8 +24,6 @@ CFLTEST_F(CflProductHelperLinux, WhenConfiguringHwInfoThenInformationIsCorrect) auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); // constant sysInfo/ftr flags @@ -33,23 +31,15 @@ CFLTEST_F(CflProductHelperLinux, WhenConfiguringHwInfoThenInformationIsCorrect) EXPECT_TRUE(outHwInfo.gtSystemInfo.VEBoxInfo.IsValid); pInHwInfo.platform.usDeviceID = 0x3E90; - drm->storedSSVal = 3; ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); pInHwInfo.platform.usDeviceID = 0x3EA5; - drm->storedSSVal = 6; ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(2u, outHwInfo.gtSystemInfo.SliceCount); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); auto &outKmdNotifyProperties = outHwInfo.capabilityTable.kmdNotifyProperties; @@ -63,22 +53,6 @@ CFLTEST_F(CflProductHelperLinux, WhenConfiguringHwInfoThenInformationIsCorrect) EXPECT_EQ(0, outKmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds); } -CFLTEST_F(CflProductHelperLinux, GivenFailedIoctlEuCountWhenConfiguringHwInfoThenErrorIsReturned) { - drm->storedRetValForEUVal = -4; - drm->failRetTopology = true; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-4, ret); -} - -CFLTEST_F(CflProductHelperLinux, GivenFailedIoctlSsCountWhenConfiguringHwInfoThenErrorIsReturned) { - drm->storedRetValForSSVal = -5; - drm->failRetTopology = true; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-5, ret); -} - CFLTEST_F(CflProductHelperLinux, WhenConfiguringHwInfoThenEdramInformationIsCorrect) { auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); diff --git a/shared/test/unit_test/gen9/glk/linux/product_helper_tests_glk.cpp b/shared/test/unit_test/gen9/glk/linux/product_helper_tests_glk.cpp index 81db4242e6..f7ed3dd0f5 100644 --- a/shared/test/unit_test/gen9/glk/linux/product_helper_tests_glk.cpp +++ b/shared/test/unit_test/gen9/glk/linux/product_helper_tests_glk.cpp @@ -70,20 +70,6 @@ GLKTEST_F(GlkProductHelperLinux, WhenConfiguringHwInfoThenInformationIsCorrect) EXPECT_EQ(0, outKmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds); } -GLKTEST_F(GlkProductHelperLinux, GivenInvalidInputWhenConfiguringHwInfoThenErrorIsReturned) { - - drm->failRetTopology = true; - drm->storedRetValForEUVal = -1; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); - - drm->storedRetValForEUVal = 0; - drm->storedRetValForSSVal = -1; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-1, ret); -} - GLKTEST_F(GlkProductHelperLinux, GivenFailingEnabledPoolWhenConfiguringHwInfoThenZeroIsSet) { drm->storedRetValForPooledEU = -1; @@ -106,52 +92,6 @@ GLKTEST_F(GlkProductHelperLinux, GivenDisabledEnabledPoolWhenConfiguringHwInfoTh EXPECT_EQ(0u, outHwInfo.gtSystemInfo.EuCountPerPoolMax); } -GLKTEST_F(GlkProductHelperLinux, GivenFailingMinEuInPoolWhenConfiguringHwInfoThenCorrectValueSet) { - drm->storedRetValForMinEUinPool = -1; - drm->storedSSVal = 3; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrPooledEuEnabled); - EXPECT_EQ(9u, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); - - drm->storedSSVal = 2; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrPooledEuEnabled); - EXPECT_EQ(3u, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); -} - -GLKTEST_F(GlkProductHelperLinux, GivenInvalidMinEuInPoolWhenConfiguringHwInfoThenCorrectValueSet) { - drm->storedMinEUinPool = 4; - drm->storedSSVal = 3; - - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrPooledEuEnabled); - EXPECT_EQ(9u, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); - - drm->storedSSVal = 2; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(1u, outHwInfo.featureTable.flags.ftrPooledEuEnabled); - EXPECT_EQ(3u, outHwInfo.gtSystemInfo.EuCountPerPoolMin); - EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax); -} - -GLKTEST_F(GlkProductHelperLinux, GivenWaFlagsWhenConfiguringHwInfoThenInformationIsCorrect) { - pInHwInfo.platform.usRevId = 0; - auto ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(0, ret); -} - template class GlkHwInfoTests : public ::testing::Test { }; diff --git a/shared/test/unit_test/gen9/kbl/linux/product_helper_tests_kbl.cpp b/shared/test/unit_test/gen9/kbl/linux/product_helper_tests_kbl.cpp index 5d24b5a4bb..944bb516d6 100644 --- a/shared/test/unit_test/gen9/kbl/linux/product_helper_tests_kbl.cpp +++ b/shared/test/unit_test/gen9/kbl/linux/product_helper_tests_kbl.cpp @@ -51,18 +51,10 @@ KBLTEST_F(KblProductHelperLinux, WhenConfiguringHwInfoThenInformationIsCorrect) ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(2u, outHwInfo.gtSystemInfo.SliceCount); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); - drm->storedSSVal = 6; - ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(2u, outHwInfo.gtSystemInfo.SliceCount); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); auto &outKmdNotifyProperties = outHwInfo.capabilityTable.kmdNotifyProperties; @@ -76,22 +68,6 @@ KBLTEST_F(KblProductHelperLinux, WhenConfiguringHwInfoThenInformationIsCorrect) EXPECT_EQ(0, outKmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds); } -KBLTEST_F(KblProductHelperLinux, GivenFailedIoctlEuCountWhenConfiguringHwInfoThenErrorIsReturned) { - drm->failRetTopology = true; - drm->storedRetValForEUVal = -4; - - int ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-4, ret); -} - -KBLTEST_F(KblProductHelperLinux, GivenFailedIoctlSsCountWhenConfiguringHwInfoThenErrorIsReturned) { - drm->failRetTopology = true; - drm->storedRetValForSSVal = -5; - - int ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-5, ret); -} - KBLTEST_F(KblProductHelperLinux, GivenWaFlagsWhenConfiguringHwInfoThenInformationIsCorrect) { outHwInfo.platform.usRevId = 0; diff --git a/shared/test/unit_test/gen9/skl/linux/product_helper_tests_skl.cpp b/shared/test/unit_test/gen9/skl/linux/product_helper_tests_skl.cpp index 0c02ab9935..74d9e64e06 100644 --- a/shared/test/unit_test/gen9/skl/linux/product_helper_tests_skl.cpp +++ b/shared/test/unit_test/gen9/skl/linux/product_helper_tests_skl.cpp @@ -22,8 +22,6 @@ struct SklProductHelperLinux : ProductHelperTestLinux { SKLTEST_F(SklProductHelperLinux, WhenConfiguringHwInfoThenInformationIsCorrect) { int ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); // constant sysInfo/ftr flags @@ -34,38 +32,26 @@ SKLTEST_F(SklProductHelperLinux, WhenConfiguringHwInfoThenInformationIsCorrect) pInHwInfo.platform.usDeviceID = 0x1902; - drm->storedSSVal = 3; ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); pInHwInfo.platform.usDeviceID = 0x1917; ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); pInHwInfo.platform.usDeviceID = 0x0903; ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); pInHwInfo.platform.usDeviceID = 0x0903; - drm->storedSSVal = 6; ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); EXPECT_EQ(0, ret); - EXPECT_EQ((uint32_t)drm->storedEUVal, outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ((uint32_t)drm->storedSSVal, outHwInfo.gtSystemInfo.SubSliceCount); - EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount); EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType); auto &outKmdNotifyProperties = outHwInfo.capabilityTable.kmdNotifyProperties; @@ -79,22 +65,6 @@ SKLTEST_F(SklProductHelperLinux, WhenConfiguringHwInfoThenInformationIsCorrect) EXPECT_EQ(0, outKmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds); } -SKLTEST_F(SklProductHelperLinux, GivenFailedIoctlEuCountWhenConfiguringHwInfoThenErrorIsReturned) { - drm->storedRetValForEUVal = -4; - drm->failRetTopology = true; - - int ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-4, ret); -} - -SKLTEST_F(SklProductHelperLinux, GivenFailedIoctlSsCountWhenConfiguringHwInfoThenErrorIsReturned) { - drm->storedRetValForSSVal = -5; - drm->failRetTopology = true; - - int ret = productHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, getRootDeviceEnvironment()); - EXPECT_EQ(-5, ret); -} - SKLTEST_F(SklProductHelperLinux, GivenWaFlagsWhenConfiguringHwInfoThenInformationIsCorrect) { pInHwInfo.platform.usRevId = 1; diff --git a/shared/test/unit_test/os_interface/linux/device_factory_tests_linux.cpp b/shared/test/unit_test/os_interface/linux/device_factory_tests_linux.cpp index 3439687e1b..814829a907 100644 --- a/shared/test/unit_test/os_interface/linux/device_factory_tests_linux.cpp +++ b/shared/test/unit_test/os_interface/linux/device_factory_tests_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,43 +22,6 @@ namespace NEO { extern std::map> directoryFilesMap; }; -TEST_F(DeviceFactoryLinuxTest, WhenPreparingDeviceEnvironmentsThenInitializedCorrectly) { - const HardwareInfo *refHwinfo = defaultHwInfo.get(); - - pDrm->storedEUVal = 16; - pDrm->storedSSVal = 8; - - bool success = DeviceFactory::prepareDeviceEnvironments(executionEnvironment); - auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); - - EXPECT_TRUE(success); - EXPECT_NE(hwInfo, nullptr); - EXPECT_EQ(refHwinfo->platform.eDisplayCoreFamily, hwInfo->platform.eDisplayCoreFamily); - EXPECT_EQ((int)hwInfo->gtSystemInfo.EUCount, 16); - EXPECT_EQ((int)hwInfo->gtSystemInfo.SubSliceCount, 8); - EXPECT_EQ((int)hwInfo->gtSystemInfo.DualSubSliceCount, 8); -} - -TEST_F(DeviceFactoryLinuxTest, givenSomeDisabledSSAndEUWhenPrepareDeviceEnvironmentsThenCorrectObtainEUCntSSCnt) { - const HardwareInfo *refHwinfo = defaultHwInfo.get(); - - pDrm->storedEUVal = 144; - pDrm->storedSSVal = 12; - pDrm->storedSVal = 2; - pDrm->disableSomeTopology = true; - - bool success = DeviceFactory::prepareDeviceEnvironments(executionEnvironment); - auto hwInfo = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo(); - - EXPECT_TRUE(success); - EXPECT_NE(hwInfo, nullptr); - EXPECT_EQ(refHwinfo->platform.eDisplayCoreFamily, hwInfo->platform.eDisplayCoreFamily); - EXPECT_EQ((int)hwInfo->gtSystemInfo.SliceCount, 1); - EXPECT_EQ((int)hwInfo->gtSystemInfo.SubSliceCount, 2); - EXPECT_EQ((int)hwInfo->gtSystemInfo.DualSubSliceCount, 2); - EXPECT_EQ((int)hwInfo->gtSystemInfo.EUCount, 12); -} - TEST_F(DeviceFactoryLinuxTest, givenGetDeviceCallWhenItIsDoneThenOsInterfaceIsAllocatedAndItContainDrm) { bool success = DeviceFactory::prepareDeviceEnvironments(executionEnvironment); EXPECT_TRUE(success); diff --git a/shared/test/unit_test/os_interface/linux/drm_query_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_query_tests.cpp index dd29709a8c..3e731a05ab 100644 --- a/shared/test/unit_test/os_interface/linux/drm_query_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_query_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,38 +19,6 @@ using namespace NEO; -using HwConfigTopologyQuery = ::testing::Test; - -HWTEST2_F(HwConfigTopologyQuery, WhenGettingTopologyFailsThenSetMaxValuesBasedOnSubsliceIoctlQuery, MatchAny) { - auto executionEnvironment = std::make_unique(); - - auto drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]); - - executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); - auto osInterface = executionEnvironment->rootDeviceEnvironments[0]->osInterface.get(); - osInterface->setDriverModel(std::unique_ptr(drm)); - - drm->failRetTopology = true; - - auto hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); - HardwareInfo outHwInfo; - - hwInfo.gtSystemInfo.MaxSlicesSupported = 0; - hwInfo.gtSystemInfo.MaxSubSlicesSupported = 0; - hwInfo.gtSystemInfo.MaxEuPerSubSlice = 6; - - auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); - int ret = productHelper.configureHwInfoDrm(&hwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); - EXPECT_NE(-1, ret); - - EXPECT_EQ(6u, outHwInfo.gtSystemInfo.MaxEuPerSubSlice); - EXPECT_EQ(outHwInfo.gtSystemInfo.SubSliceCount, outHwInfo.gtSystemInfo.MaxSubSlicesSupported); - EXPECT_EQ(hwInfo.gtSystemInfo.SliceCount, outHwInfo.gtSystemInfo.MaxSlicesSupported); - - EXPECT_EQ(static_cast(drm->storedEUVal), outHwInfo.gtSystemInfo.EUCount); - EXPECT_EQ(static_cast(drm->storedSSVal), outHwInfo.gtSystemInfo.SubSliceCount); -} - TEST(DrmQueryTest, WhenCallingIsDebugAttachAvailableThenReturnValueIsFalse) { auto executionEnvironment = std::make_unique(); DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]}; diff --git a/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.cpp b/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.cpp index 5071e4b739..dba419a287 100644 --- a/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/product_helper_linux_tests.cpp @@ -84,22 +84,6 @@ TEST_F(MockProductHelperTestLinux, givenDisabledPlatformCoherencyWhenConfiguring EXPECT_FALSE(outHwInfo.capabilityTable.ftrSupportsCoherency); } -TEST_F(MockProductHelperTestLinux, GivenFailGetEuCountWhenConfiguringHwInfoThenFails) { - drm->storedRetValForEUVal = -4; - drm->failRetTopology = true; - - int ret = mockProductHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); - EXPECT_EQ(-4, ret); -} - -TEST_F(MockProductHelperTestLinux, GivenFailGetSsCountWhenConfiguringHwInfoThenFails) { - drm->storedRetValForSSVal = -5; - drm->failRetTopology = true; - - int ret = mockProductHelper->configureHwInfoDrm(&pInHwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); - EXPECT_EQ(-5, ret); -} - TEST_F(MockProductHelperTestLinux, whenFailGettingTopologyThenFallbackToEuCountIoctl) { drm->failRetTopology = true; @@ -368,58 +352,6 @@ HWTEST2_F(HwConfigLinux, givenPlatformWithPlatformQuerySupportedWhenItIsCalledTh EXPECT_TRUE(productHelper.isPlatformQuerySupported()); } -HWTEST2_F(HwConfigLinux, GivenDifferentValuesFromTopologyQueryWhenConfiguringHwInfoThenMaxSlicesSupportedSetToAvailableCountInGtSystemInfo, MatchAny) { - auto executionEnvironment = std::make_unique(); - executionEnvironment->prepareRootDeviceEnvironments(1); - - executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(NEO::defaultHwInfo.get()); - auto drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]); - executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); - auto osInterface = executionEnvironment->rootDeviceEnvironments[0]->osInterface.get(); - osInterface->setDriverModel(std::unique_ptr(drm)); - - auto hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); - HardwareInfo outHwInfo; - auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); - - hwInfo.gtSystemInfo.MaxSubSlicesSupported = drm->storedSSVal * 2; - hwInfo.gtSystemInfo.MaxDualSubSlicesSupported = drm->storedSSVal * 2; - hwInfo.gtSystemInfo.MaxEuPerSubSlice = 16; - hwInfo.gtSystemInfo.MaxSlicesSupported = drm->storedSVal * 4; - - int ret = productHelper.configureHwInfoDrm(&hwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(static_cast(drm->storedSSVal * 2), outHwInfo.gtSystemInfo.MaxSubSlicesSupported); - EXPECT_EQ(static_cast(drm->storedSSVal * 2), outHwInfo.gtSystemInfo.MaxDualSubSlicesSupported); - EXPECT_EQ(16u, outHwInfo.gtSystemInfo.MaxEuPerSubSlice); - EXPECT_EQ(static_cast(drm->storedSVal), outHwInfo.gtSystemInfo.MaxSlicesSupported); - - drm->storedSVal = 3; - drm->storedSSVal = 12; - drm->storedEUVal = 12 * 8; - - hwInfo.gtSystemInfo.MaxSubSlicesSupported = drm->storedSSVal / 2; - hwInfo.gtSystemInfo.MaxDualSubSlicesSupported = drm->storedSSVal / 2; - hwInfo.gtSystemInfo.MaxEuPerSubSlice = 6; - hwInfo.gtSystemInfo.MaxSlicesSupported = drm->storedSVal / 2; - - ret = productHelper.configureHwInfoDrm(&hwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); - EXPECT_EQ(0, ret); - - EXPECT_EQ(12u, outHwInfo.gtSystemInfo.MaxSubSlicesSupported); - EXPECT_EQ(6u, outHwInfo.gtSystemInfo.MaxEuPerSubSlice); // MaxEuPerSubslice is preserved - EXPECT_EQ(static_cast(drm->storedSVal), outHwInfo.gtSystemInfo.MaxSlicesSupported); - - EXPECT_EQ(outHwInfo.gtSystemInfo.MaxSubSlicesSupported, outHwInfo.gtSystemInfo.MaxDualSubSlicesSupported); - - hwInfo.gtSystemInfo.MaxEuPerSubSlice = 0; - - ret = productHelper.configureHwInfoDrm(&hwInfo, &outHwInfo, *executionEnvironment->rootDeviceEnvironments[0].get()); - EXPECT_EQ(0, ret); - EXPECT_EQ(8u, outHwInfo.gtSystemInfo.MaxEuPerSubSlice); -} - HWTEST2_F(HwConfigLinux, givenSliceCountWhenConfigureHwInfoDrmThenProperInitializationInSliceInfoEnabled, MatchAny) { auto executionEnvironment = std::make_unique(); executionEnvironment->prepareRootDeviceEnvironments(1);