diff --git a/runtime/dll/linux/drm_neo_create.cpp b/runtime/dll/linux/drm_neo_create.cpp index 006d36d580..0a65be23f4 100644 --- a/runtime/dll/linux/drm_neo_create.cpp +++ b/runtime/dll/linux/drm_neo_create.cpp @@ -178,11 +178,6 @@ Drm *Drm::create(int32_t deviceOrdinal) { // Activate the Turbo Boost Frequency feature ret = drmObject->enableTurboBoost(); if (ret != 0) { - // turbo patch not present, we are not on custom Kernel, switch to simplified Mocs selection - // do this only for GEN9+ - if (device->pHwInfo->platform.eRenderCoreFamily >= IGFX_GEN9_CORE) { - drmObject->setSimplifiedMocsTableUsage(true); - } printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to request OCL Turbo Boost\n"); } diff --git a/runtime/gmm_helper/gmm_helper.cpp b/runtime/gmm_helper/gmm_helper.cpp index 7ae5c210d3..f6a7737c85 100644 --- a/runtime/gmm_helper/gmm_helper.cpp +++ b/runtime/gmm_helper/gmm_helper.cpp @@ -37,10 +37,6 @@ GmmHelper *GmmHelper::getInstance() { return platform()->peekExecutionEnvironment()->getGmmHelper(); } -void GmmHelper::setSimplifiedMocsTableUsage(bool value) { - useSimplifiedMocsTable = value; -} - void GmmHelper::initContext(const PLATFORM *platform, const FeatureTable *featureTable, const WorkaroundTable *workaroundTable, @@ -57,13 +53,6 @@ void GmmHelper::initContext(const PLATFORM *platform, } uint32_t GmmHelper::getMOCS(uint32_t type) { - if (useSimplifiedMocsTable) { - if (type == GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) { - return cacheDisabledIndex; - } else { - return cacheEnabledIndex; - } - } MEMORY_OBJECT_CONTROL_STATE mocs = gmmClientContext->cachePolicyGetMemoryObject(nullptr, static_cast(type)); return static_cast(mocs.DwordValue); diff --git a/runtime/gmm_helper/gmm_helper.h b/runtime/gmm_helper/gmm_helper.h index acab01fa4f..cc030186bf 100644 --- a/runtime/gmm_helper/gmm_helper.h +++ b/runtime/gmm_helper/gmm_helper.h @@ -33,10 +33,7 @@ class GmmHelper { const HardwareInfo *getHardwareInfo(); uint32_t getMOCS(uint32_t type); - void setSimplifiedMocsTableUsage(bool value); - static constexpr uint32_t cacheDisabledIndex = 0; - static constexpr uint32_t cacheEnabledIndex = 4; static constexpr uint64_t maxPossiblePitch = 2147483648; template @@ -63,7 +60,6 @@ class GmmHelper { void loadLib(); void initContext(const PLATFORM *platform, const FeatureTable *featureTable, const WorkaroundTable *workaroundTable, const GT_SYSTEM_INFO *pGtSysInfo); - bool useSimplifiedMocsTable = false; const HardwareInfo *hwInfo = nullptr; std::unique_ptr gmmLib; std::unique_ptr gmmClientContext; diff --git a/runtime/os_interface/linux/drm_neo.cpp b/runtime/os_interface/linux/drm_neo.cpp index 59fca8e8d0..9973f36aa6 100644 --- a/runtime/os_interface/linux/drm_neo.cpp +++ b/runtime/os_interface/linux/drm_neo.cpp @@ -205,12 +205,4 @@ int Drm::getErrno() { return errno; } -bool Drm::getSimplifiedMocsTableUsage() const { - return useSimplifiedMocsTable; -} - -void Drm::setSimplifiedMocsTableUsage(bool value) { - useSimplifiedMocsTable = value; -} - } // namespace NEO diff --git a/runtime/os_interface/linux/drm_neo.h b/runtime/os_interface/linux/drm_neo.h index 60aca7d016..b11b071ab2 100644 --- a/runtime/os_interface/linux/drm_neo.h +++ b/runtime/os_interface/linux/drm_neo.h @@ -72,8 +72,6 @@ class Drm { void setGtType(GTTYPE eGtType) { this->eGtType = eGtType; } GTTYPE getGtType() const { return this->eGtType; } MOCKABLE_VIRTUAL int getErrno(); - void setSimplifiedMocsTableUsage(bool value); - bool getSimplifiedMocsTableUsage() const; bool setQueueSliceCount(uint64_t sliceCount); void checkQueueSliceSupport(); uint64_t getSliceMask(uint64_t sliceCount); @@ -89,7 +87,6 @@ class Drm { int getQueueSliceCount(drm_i915_gem_context_param_sseu *sseu); bool sliceCountChangeSupported = false; drm_i915_gem_context_param_sseu sseu{}; - bool useSimplifiedMocsTable = false; bool preemptionSupported = false; int fd; int deviceId = 0; diff --git a/unit_tests/gen9/kernel_tests_gen9.cpp b/unit_tests/gen9/kernel_tests_gen9.cpp index 68da9b6b38..4133f67ab9 100644 --- a/unit_tests/gen9/kernel_tests_gen9.cpp +++ b/unit_tests/gen9/kernel_tests_gen9.cpp @@ -24,30 +24,3 @@ using Gen9HardwareCommandsTest = testing::Test; GEN9TEST_F(Gen9HardwareCommandsTest, givenGen9PlatformWhenDoBindingTablePrefetchIsCalledThenReturnsTrue) { EXPECT_TRUE(HardwareCommandsHelper::doBindingTablePrefetch()); } - -GEN9TEST_F(Gen9HardwareCommandsTest, givenBufferThatIsNotZeroCopyWhenSurfaceStateisSetThenL3IsTurnedOn) { - MockContext context; - - auto retVal = CL_SUCCESS; - char ptr[16u] = {}; - - std::unique_ptr buffer(Buffer::create( - &context, - CL_MEM_USE_HOST_PTR, - 16u, - ptr, - retVal)); - - EXPECT_FALSE(buffer->isMemObjZeroCopy()); - - using RENDER_SURFACE_STATE = typename SKLFamily::RENDER_SURFACE_STATE; - RENDER_SURFACE_STATE surfaceState = {}; - - auto gmmHelper = context.getDevice(0)->getExecutionEnvironment()->getGmmHelper(); - gmmHelper->setSimplifiedMocsTableUsage(true); - - buffer->setArgStateful(&surfaceState, false, false, false, false); - //make sure proper mocs is selected - constexpr uint32_t expectedMocs = GmmHelper::cacheEnabledIndex; - EXPECT_EQ(expectedMocs, surfaceState.getMemoryObjectControlStateIndexToMocsTables()); -} diff --git a/unit_tests/gmm_helper/gmm_helper_tests.cpp b/unit_tests/gmm_helper/gmm_helper_tests.cpp index 3a4eee0409..1c6386efdb 100644 --- a/unit_tests/gmm_helper/gmm_helper_tests.cpp +++ b/unit_tests/gmm_helper/gmm_helper_tests.cpp @@ -674,22 +674,6 @@ TEST(GmmTest, givenGmmWithSetMCSInResourceInfoGpuFlagsWhenCallhasMultisampleCont EXPECT_TRUE(gmm->hasMultisampleControlSurface()); } -TEST(GmmSimplifiedCacheSelectionPolicy, givenGmmInSimplifiedCacheSelectionPolicyWhenItIsAskedForUncachedIndexThen0IsReturned) { - GmmHelper gmmHelper(*platformDevices); - gmmHelper.setSimplifiedMocsTableUsage(true); - auto index = gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED); - auto expectedIndex = GmmHelper::cacheDisabledIndex; - EXPECT_EQ(expectedIndex, index); -} - -TEST(GmmSimplifiedCacheSelectionPolicy, givenGmmInSimplifiedCacheSelectionPolicyWhenItIsAskedForCachedIndexThen4IsReturned) { - GmmHelper gmmHelper(*platformDevices); - gmmHelper.setSimplifiedMocsTableUsage(true); - auto index = gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER); - auto expectedIndex = GmmHelper::cacheEnabledIndex; - EXPECT_EQ(expectedIndex, index); -} - TEST(GmmHelperTest, whenGmmHelperIsInitializedThenClientContextIsSet) { ASSERT_NE(nullptr, GmmHelper::getClientContext()); EXPECT_NE(nullptr, GmmHelper::getClientContext()->getHandle()); diff --git a/unit_tests/linux/main_linux_dll.cpp b/unit_tests/linux/main_linux_dll.cpp index 62365c169b..9679ec0fbc 100644 --- a/unit_tests/linux/main_linux_dll.cpp +++ b/unit_tests/linux/main_linux_dll.cpp @@ -219,86 +219,6 @@ TEST_F(DrmTests, failOnParamBoost) { EXPECT_NE(drm, nullptr); } -#ifdef TESTS_BDW -TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenBdwDeviceIsCreatedThenSimplifiedMocsSelectionIsFalse) { - VariableBackup backupDeviceId(&deviceId); - VariableBackup backupFailOnParamBoost(&failOnParamBoost); - - deviceId = IBDW_GT3_WRK_DEVICE_F0_ID; - failOnParamBoost = -1; - auto drm = DrmWrap::createDrm(0); - EXPECT_NE(drm, nullptr); - EXPECT_FALSE(drm->getSimplifiedMocsTableUsage()); -} -#endif - -#ifdef TESTS_SKL -TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenSklDeviceIsCreatedThenSimplifiedMocsSelectionIsTrue) { - VariableBackup backupDeviceId(&deviceId); - VariableBackup backupFailOnParamBoost(&failOnParamBoost); - - deviceId = ISKL_GT2_DT_DEVICE_F0_ID; - failOnParamBoost = -1; - auto drm = DrmWrap::createDrm(0); - EXPECT_NE(drm, nullptr); - EXPECT_TRUE(drm->getSimplifiedMocsTableUsage()); -} -#endif -#ifdef TESTS_KBL -TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenKblDeviceIsCreatedThenSimplifiedMocsSelectionIsTrue) { - VariableBackup backupDeviceId(&deviceId); - VariableBackup backupFailOnParamBoost(&failOnParamBoost); - - deviceId = IKBL_GT1_ULT_DEVICE_F0_ID; - failOnParamBoost = -1; - auto drm = DrmWrap::createDrm(0); - EXPECT_NE(drm, nullptr); - EXPECT_TRUE(drm->getSimplifiedMocsTableUsage()); -} -#endif -#ifdef TESTS_BXT -TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenBxtDeviceIsCreatedThenSimplifiedMocsSelectionIsTrue) { - VariableBackup backupDeviceId(&deviceId); - VariableBackup backupFailOnParamBoost(&failOnParamBoost); - - deviceId = IBXT_X_DEVICE_F0_ID; - failOnParamBoost = -1; - auto drm = DrmWrap::createDrm(0); - EXPECT_NE(drm, nullptr); - EXPECT_TRUE(drm->getSimplifiedMocsTableUsage()); -} -#endif -#ifdef TESTS_GLK -TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenGlkDeviceIsCreatedThenSimplifiedMocsSelectionIsTrue) { - VariableBackup backupDeviceId(&deviceId); - VariableBackup backupFailOnParamBoost(&failOnParamBoost); - - deviceId = IGLK_GT2_ULT_18EU_DEVICE_F0_ID; - failOnParamBoost = -1; - auto drm = DrmWrap::createDrm(0); - EXPECT_NE(drm, nullptr); - EXPECT_TRUE(drm->getSimplifiedMocsTableUsage()); -} -#endif -#ifdef TESTS_CFL -TEST_F(DrmTests, givenKernelNotSupportingTurboPatchWhenCflDeviceIsCreatedThenSimplifiedMocsSelectionIsTrue) { - VariableBackup backupDeviceId(&deviceId); - VariableBackup backupFailOnParamBoost(&failOnParamBoost); - - deviceId = ICFL_GT1_S61_DT_DEVICE_F0_ID; - failOnParamBoost = -1; - auto drm = DrmWrap::createDrm(0); - EXPECT_NE(drm, nullptr); - EXPECT_TRUE(drm->getSimplifiedMocsTableUsage()); -} -#endif - -TEST_F(DrmTests, givenKernelSupportingTurboPatchWhenDeviceIsCreatedThenSimplifiedMocsSelectionIsFalse) { - auto drm = DrmWrap::createDrm(0); - EXPECT_NE(drm, nullptr); - EXPECT_FALSE(drm->getSimplifiedMocsTableUsage()); -} - TEST_F(DrmTests, failOnContextCreate) { VariableBackup backupFailOnContextCreate(&failOnContextCreate); diff --git a/unit_tests/mem_obj/buffer_tests.cpp b/unit_tests/mem_obj/buffer_tests.cpp index ddc990f290..4cdef626ac 100644 --- a/unit_tests/mem_obj/buffer_tests.cpp +++ b/unit_tests/mem_obj/buffer_tests.cpp @@ -1982,8 +1982,6 @@ HWTEST_F(BufferSetSurfaceTests, givenMisalignedPointerWhenSurfaceStateIsProgramm HWTEST_F(BufferSetSurfaceTests, givenBufferThatIsMisalignedWhenSurfaceStateIsBeingProgrammedThenL3CacheIsOff) { using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - this->device->getExecutionEnvironment()->getGmmHelper()->setSimplifiedMocsTableUsage(true); - RENDER_SURFACE_STATE surfaceState = {}; MockContext context; void *svmPtr = reinterpret_cast(0x1005); @@ -2001,7 +1999,6 @@ HWTEST_F(BufferSetSurfaceTests, givenBufferThatIsMisalignedWhenSurfaceStateIsBei class BufferL3CacheTests : public ::testing::TestWithParam { public: void SetUp() override { - ctx.getDevice(0)->getExecutionEnvironment()->getGmmHelper()->setSimplifiedMocsTableUsage(true); hostPtr = reinterpret_cast(GetParam()); } MockContext ctx; diff --git a/unit_tests/os_interface/linux/drm_command_stream_tests.cpp b/unit_tests/os_interface/linux/drm_command_stream_tests.cpp index abf27220ef..e1b64627d1 100644 --- a/unit_tests/os_interface/linux/drm_command_stream_tests.cpp +++ b/unit_tests/os_interface/linux/drm_command_stream_tests.cpp @@ -1370,16 +1370,6 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenDrmCommandStreamReceiverWh EXPECT_TRUE(mm->isValidateHostMemoryEnabled()); } -HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmCommandStreamWhenGettingMocsThenProperValueIsReturned) { - auto mocs = platform()->peekExecutionEnvironment()->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED); - auto expectedMocs = GmmHelper::cacheDisabledIndex; - EXPECT_EQ(mocs, expectedMocs); - - mocs = platform()->peekExecutionEnvironment()->getGmmHelper()->getMOCS(0); - expectedMocs = GmmHelper::cacheEnabledIndex; - EXPECT_EQ(mocs, expectedMocs); -} - HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationWithSingleBufferObjectWhenMakeResidentBufferObjectsIsCalledThenTheBufferObjectIsMadeResident) { auto size = 1024u; auto bo = this->createBO(size);