diff --git a/shared/source/helpers/gfx_core_helper.h b/shared/source/helpers/gfx_core_helper.h index 6f5b2c1fb3..7f919e3631 100644 --- a/shared/source/helpers/gfx_core_helper.h +++ b/shared/source/helpers/gfx_core_helper.h @@ -124,7 +124,6 @@ class GfxCoreHelper { virtual size_t getSipKernelMaxDbgSurfaceSize(const HardwareInfo &hwInfo) const = 0; virtual bool isSipWANeeded(const HardwareInfo &hwInfo) const = 0; virtual bool isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const = 0; - virtual bool isKmdMigrationSupported(const HardwareInfo &hwInfo) const = 0; virtual aub_stream::MMIOList getExtraMmioList(const HardwareInfo &hwInfo, const GmmHelper &gmmHelper) const = 0; virtual uint32_t getNumCacheRegions() const = 0; virtual bool isSubDeviceEngineSupported(const RootDeviceEnvironment &rootDeviceEnvironment, const DeviceBitfield &deviceBitfield, aub_stream::EngineType engineType) const = 0; @@ -328,8 +327,6 @@ class GfxCoreHelperHw : public GfxCoreHelper { size_t getSipKernelMaxDbgSurfaceSize(const HardwareInfo &hwInfo) const override; - bool isKmdMigrationSupported(const HardwareInfo &hwInfo) const override; - bool isSipWANeeded(const HardwareInfo &hwInfo) const override; bool isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/helpers/gfx_core_helper_base.inl b/shared/source/helpers/gfx_core_helper_base.inl index 6a1bfba1d0..5366195cf7 100644 --- a/shared/source/helpers/gfx_core_helper_base.inl +++ b/shared/source/helpers/gfx_core_helper_base.inl @@ -553,11 +553,6 @@ bool MemorySynchronizationCommands::isBarrierPriorToPipelineSelectWaR return false; } -template -bool GfxCoreHelperHw::isKmdMigrationSupported(const HardwareInfo &hwInfo) const { - return false; -} - template bool GfxCoreHelperHw::isSipWANeeded(const HardwareInfo &hwInfo) const { return false; diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index bfe558517d..828b3d113e 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -245,10 +245,8 @@ bool DrmMemoryManager::hasPageFaultsEnabled(const Device &neoDevice) { } bool DrmMemoryManager::isKmdMigrationAvailable(uint32_t rootDeviceIndex) { - auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); - auto &gfxCoreHelper = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHelper(); - - auto useKmdMigration = gfxCoreHelper.isKmdMigrationSupported(*hwInfo); + const auto &productHelper = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHelper(); + auto useKmdMigration = productHelper.isKmdMigrationSupported(); if (DebugManager.flags.UseKmdMigration.get() != -1) { useKmdMigration = DebugManager.flags.UseKmdMigration.get(); diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index 763c9ffbba..593eb818e5 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -120,6 +120,7 @@ class ProductHelper { virtual bool isStorageInfoAdjustmentRequired() const = 0; virtual bool isBlitterForImagesSupported() const = 0; virtual bool isPageFaultSupported() const = 0; + virtual bool isKmdMigrationSupported() const = 0; virtual bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isDcFlushAllowed() const = 0; virtual uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index a3ff6a8c02..c69b9041f5 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -355,6 +355,11 @@ bool ProductHelperHw::isPageFaultSupported() const { return false; } +template +bool ProductHelperHw::isKmdMigrationSupported() const { + return false; +} + template bool ProductHelperHw::isDcFlushAllowed() const { return true; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 18ba9a0adf..310aa898ee 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -73,6 +73,7 @@ class ProductHelperHw : public ProductHelper { bool isStorageInfoAdjustmentRequired() const override; bool isBlitterForImagesSupported() const override; bool isPageFaultSupported() const override; + bool isKmdMigrationSupported() const override; bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const override; bool isDcFlushAllowed() const override; uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp b/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp index 5b466e3052..f07b6ee746 100644 --- a/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp +++ b/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp @@ -80,6 +80,11 @@ bool ProductHelperHw::isPageFaultSupported() const { return true; } +template <> +bool ProductHelperHw::isKmdMigrationSupported() const { + return false; +} + } // namespace NEO #include "shared/source/xe_hpc_core/linux/product_helper_xe_hpc_core.inl" diff --git a/shared/test/unit_test/helpers/CMakeLists.txt b/shared/test/unit_test/helpers/CMakeLists.txt index cfc9157628..6d129634d1 100644 --- a/shared/test/unit_test/helpers/CMakeLists.txt +++ b/shared/test/unit_test/helpers/CMakeLists.txt @@ -32,7 +32,6 @@ target_sources(neo_shared_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/hw_aot_config_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gfx_core_helper_default_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gfx_core_helper_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/gfx_core_helper_tests_dg2_or_below.cpp ${CMAKE_CURRENT_SOURCE_DIR}/local_id_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/l3_range_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/kernel_helpers_tests.cpp diff --git a/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_or_below.cpp b/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_or_below.cpp deleted file mode 100644 index 930b1368b7..0000000000 --- a/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_or_below.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/helpers/gfx_core_helper.h" -#include "shared/test/common/helpers/default_hw_info.h" -#include "shared/test/common/mocks/mock_execution_environment.h" -#include "shared/test/common/test_macros/hw_test.h" - -using namespace NEO; - -using GfxCoreHelperDg2OrBelowTests = ::testing::Test; - -using isDG2OrBelow = IsAtMostProduct; -HWTEST2_F(GfxCoreHelperDg2OrBelowTests, WhenGettingIsKmdMigrationSupportedThenFalseIsReturned, isDG2OrBelow) { - MockExecutionEnvironment mockExecutionEnvironment{}; - auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - EXPECT_FALSE(gfxCoreHelper.isKmdMigrationSupported(*defaultHwInfo)); -} \ No newline at end of file diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index d6f29b22f2..fcc950f713 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -408,6 +408,11 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfPageFaultIsSupportedThe EXPECT_FALSE(productHelper->isPageFaultSupported()); } +HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfKmdMigrationIsSupportedThenReturnFalse) { + + EXPECT_FALSE(productHelper->isKmdMigrationSupported()); +} + HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned) { EXPECT_TRUE(productHelper->isTile64With3DSurfaceOnBCSSupported(pInHwInfo)); diff --git a/shared/test/unit_test/xe_hpc_core/pvc/linux/product_helper_tests_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/linux/product_helper_tests_pvc.cpp index 75339cc790..ca51f602d8 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/linux/product_helper_tests_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/linux/product_helper_tests_pvc.cpp @@ -76,6 +76,12 @@ PVCTEST_F(PvcProductHelperLinux, givenProductHelperWhenAskedIsPageFaultSupported EXPECT_TRUE(productHelper->isPageFaultSupported()); } +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfKmdMigrationIsSupportedThenReturnFalse, IGFX_PVC); + +PVCTEST_F(PvcProductHelperLinux, givenProductHelperWhenAskedIsKmdMigrationSupportedThenReturnTrue) { + EXPECT_FALSE(productHelper->isKmdMigrationSupported()); +} + PVCTEST_F(PvcProductHelperLinux, givenAotConfigWhenSetHwInfoRevisionIdForPvcThenCorrectValueIsSet) { auto &compilerProductHelper = this->executionEnvironment->rootDeviceEnvironments[0]->getHelper(); for (const auto &config : AOT_PVC::productConfigs) { diff --git a/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl.cpp index b3c5029edf..ffc9734c24 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl.cpp @@ -49,3 +49,7 @@ MTLTEST_F(MtlProductHelperLinux, givenMtlWhenisVmBindPatIndexProgrammingSupporte MTLTEST_F(MtlProductHelperLinux, givenProductHelperWhenAskedIsPageFaultSupportedThenReturnFalse) { EXPECT_FALSE(productHelper->isPageFaultSupported()); } + +MTLTEST_F(MtlProductHelperLinux, givenProductHelperWhenAskedIsKmdMigrationsSupportedThenReturnFalse) { + EXPECT_FALSE(productHelper->isKmdMigrationSupported()); +}