From 95b3d16d764d0c31c69a0639493c835ac95357c9 Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Mon, 23 Dec 2024 18:39:54 +0100 Subject: [PATCH] Revert "fix: add scratch page support with xekmd" This reverts commit dec695f405d95ca08079ed03fe5b84f0dc501eb5. Signed-off-by: Compute-Runtime-Validation --- .../os_interface/linux/xe/ioctl_helper_xe.cpp | 3 --- .../xe2_hpg_core/linux/product_helper_bmg.cpp | 5 ----- .../xe2_hpg_core/linux/product_helper_lnl.cpp | 5 ----- .../os_interface/linux/drm_tests.cpp | 2 +- .../linux/xe/ioctl_helper_xe_tests.cpp | 22 +++++++------------ .../os_interface/product_helper_tests.cpp | 3 ++- .../linux/product_helper_tests_bmg_linux.cpp | 4 ++-- .../linux/product_helper_tests_lnl_linux.cpp | 4 ++-- 8 files changed, 15 insertions(+), 33 deletions(-) diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp index f223871f2b..2841fdc4fc 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp @@ -968,9 +968,6 @@ uint32_t IoctlHelperXe::getFlagsForVmCreate(bool disableScratch, bool enablePage if (enablePageFault) { flags |= DRM_XE_VM_CREATE_FLAG_FAULT_MODE; } - if (!disableScratch) { - flags |= DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE; - } return flags; } diff --git a/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp b/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp index f06fc51202..a28586f30c 100644 --- a/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp +++ b/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp @@ -33,10 +33,5 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O return 0; } -template <> -bool ProductHelperHw::isDisableScratchPagesSupported() const { - return true; -} - template class ProductHelperHw; } // namespace NEO diff --git a/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp b/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp index fc9d9f4c5c..97d86a83a5 100644 --- a/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp +++ b/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp @@ -35,10 +35,5 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O return 0; } -template <> -bool ProductHelperHw::isDisableScratchPagesSupported() const { - return true; -} - template class ProductHelperHw; } // namespace NEO diff --git a/shared/test/unit_test/os_interface/linux/drm_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_tests.cpp index 1f7529a8bf..e0eac950c3 100644 --- a/shared/test/unit_test/os_interface/linux/drm_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_tests.cpp @@ -1549,7 +1549,7 @@ HWTEST2_F(DrmDisableScratchPagesDefaultTest, } HWTEST2_F(DrmDisableScratchPagesDefaultTest, - givenDefaultDisableScratchPagesThenCheckingGpuFaultCheckIsSetToDefaultAndScratchPageIsEnabled, IsBeforeXeHpcCore) { + givenDefaultDisableScratchPagesThenCheckingGpuFaultCheckIsSetToDefaultAndScratchPageIsEnabled, IsNotPVC) { auto executionEnvironment = std::make_unique(); DrmMockCheckPageFault drm{*executionEnvironment->rootDeviceEnvironments[0]}; drm.configureScratchPagePolicy(); diff --git a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp index a4df3ccbc6..69cc8084f2 100644 --- a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp @@ -456,20 +456,14 @@ TEST_F(IoctlHelperXeTest, whenGettingFlagsForVmCreateThenPropertValueIsReturned) DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]}; auto xeIoctlHelper = std::make_unique(drm); - for (auto &disableScratch : ::testing::Bool()) { - for (auto &enablePageFault : ::testing::Bool()) { - for (auto &useVmBind : ::testing::Bool()) { - auto flags = xeIoctlHelper->getFlagsForVmCreate(disableScratch, enablePageFault, useVmBind); - EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_LR_MODE), (flags & DRM_XE_VM_CREATE_FLAG_LR_MODE)); - if (enablePageFault) { - EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_FAULT_MODE), (flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE)); - } - if (!disableScratch) { - EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE), (flags & DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE)); - } - } - } - } + EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_LR_MODE | DRM_XE_VM_CREATE_FLAG_FAULT_MODE), xeIoctlHelper->getFlagsForVmCreate(true, true, true)); + EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_LR_MODE | DRM_XE_VM_CREATE_FLAG_FAULT_MODE), xeIoctlHelper->getFlagsForVmCreate(true, true, false)); + EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_LR_MODE | DRM_XE_VM_CREATE_FLAG_FAULT_MODE), xeIoctlHelper->getFlagsForVmCreate(false, true, true)); + EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_LR_MODE | DRM_XE_VM_CREATE_FLAG_FAULT_MODE), xeIoctlHelper->getFlagsForVmCreate(false, true, false)); + EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_LR_MODE), xeIoctlHelper->getFlagsForVmCreate(true, false, true)); + EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_LR_MODE), xeIoctlHelper->getFlagsForVmCreate(true, false, false)); + EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_LR_MODE), xeIoctlHelper->getFlagsForVmCreate(false, false, true)); + EXPECT_EQ(static_cast(DRM_XE_VM_CREATE_FLAG_LR_MODE), xeIoctlHelper->getFlagsForVmCreate(false, false, false)); } TEST_F(IoctlHelperXeTest, whenGettingFlagsForVmBindThenPropertValueIsReturned) { 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 d647c8e5c4..b1c8a110f8 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -457,7 +457,8 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfKmdMigrationIsSupported EXPECT_FALSE(productHelper->isKmdMigrationSupported()); } -HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfDisableScratchPagesIsSupportedThenReturnFalse, IsBeforeXeHpcCore) { +HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfDisableScratchPagesIsSupportedThenReturnFalse, IsNotPVC) { + EXPECT_FALSE(productHelper->isDisableScratchPagesSupported()); } diff --git a/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp b/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp index 156332805c..5b8e956162 100644 --- a/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp +++ b/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp @@ -61,8 +61,8 @@ BMGTEST_F(BmgProductHelperLinux, givenProductHelperWhenAskedIsKmdMigrationSuppor EXPECT_FALSE(productHelper->isKmdMigrationSupported()); } -BMGTEST_F(BmgProductHelperLinux, givenProductHelperWhenAskedIsDisableScratchPagesSupportedThenReturnTrue) { - EXPECT_TRUE(productHelper->isDisableScratchPagesSupported()); +BMGTEST_F(BmgProductHelperLinux, givenProductHelperWhenAskedIsDisableScratchPagesSupportedThenReturnFalse) { + EXPECT_FALSE(productHelper->isDisableScratchPagesSupported()); } BMGTEST_F(BmgProductHelperLinux, WhenGtIsSetupThenGtSystemInfoIsCorrect) { diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp index e8db2bc36c..4e5276f21a 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp @@ -60,8 +60,8 @@ LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenAskedIsKmdMigrationSuppor EXPECT_FALSE(productHelper->isKmdMigrationSupported()); } -LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenAskedIsDisableScratchPagesSupportedThenReturnTrue) { - EXPECT_TRUE(productHelper->isDisableScratchPagesSupported()); +LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenAskedIsDisableScratchPagesSupportedThenReturnFalse) { + EXPECT_FALSE(productHelper->isDisableScratchPagesSupported()); } LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenCheckDirectSubmissionSupportedThenFalseIsReturned) {