diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index 7a3d72c908..ece582a1d9 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -149,7 +149,6 @@ class ProductHelper { virtual bool isBcsReportWaRequired(const HardwareInfo &hwInfo) const = 0; virtual bool isBlitSplitEnqueueWARequired(const HardwareInfo &hwInfo) const = 0; virtual bool isBlitCopyRequiredForLocalMemory(const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation) const = 0; - virtual bool isBlitCopyRequiredForLocalMemory(const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation, bool lockingSucceeded) const = 0; virtual bool isInitDeviceWithFirstSubmissionRequired(const HardwareInfo &hwInfo) const = 0; virtual bool isImplicitScalingSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isCpuCopyNecessary(const void *ptr, MemoryManager *memoryManager) const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index 03c25cee4e..a1c0afd0df 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -485,7 +485,7 @@ bool ProductHelperHw::isBlitSplitEnqueueWARequired(const HardwareInf } template -bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation, bool lockingSucceeded) const { +bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation) const { auto &productHelper = rootDeviceEnvironment.getHelper(); auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo(); return allocation.isAllocatedInLocalMemoryPool() && @@ -493,11 +493,6 @@ bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDev !allocation.isAllocationLockable()); } -template -bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation) const { - return this->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, allocation, false); -} - template bool ProductHelperHw::isInitDeviceWithFirstSubmissionRequired(const HardwareInfo &hwInfo) const { return false; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index bb16c48b15..408fb92705 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -101,7 +101,6 @@ class ProductHelperHw : public ProductHelper { bool allowMemoryPrefetch(const HardwareInfo &hwInfo) const override; bool isBcsReportWaRequired(const HardwareInfo &hwInfo) const override; bool isBlitCopyRequiredForLocalMemory(const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation) const override; - bool isBlitCopyRequiredForLocalMemory(const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation, bool lockingSucceeded) const override; bool isImplicitScalingSupported(const HardwareInfo &hwInfo) const override; bool isCpuCopyNecessary(const void *ptr, MemoryManager *memoryManager) const override; bool isUnlockingLockedPtrNecessary(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/program/program_initialization.cpp b/shared/source/program/program_initialization.cpp index c55b5efc30..6a149bf7fd 100644 --- a/shared/source/program/program_initialization.cpp +++ b/shared/source/program/program_initialization.cpp @@ -29,7 +29,7 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::SVMAllocsManager *const svmAlloc if (linkerInput != nullptr) { globalsAreExported = constant ? linkerInput->getTraits().exportsGlobalConstants : linkerInput->getTraits().exportsGlobalVariables; } - bool lockingSucceeded = false; + if (globalsAreExported && (svmAllocManager != nullptr)) { RootDeviceIndicesContainer rootDeviceIndices; rootDeviceIndices.push_back(rootDeviceIndex); @@ -45,7 +45,6 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::SVMAllocsManager *const svmAlloc auto usmAlloc = svmAllocManager->getSVMAlloc(ptr); UNRECOVERABLE_IF(usmAlloc == nullptr); gpuAllocation = usmAlloc->gpuAllocations.getGraphicsAllocation(rootDeviceIndex); - lockingSucceeded = device.getMemoryManager()->lockResource(gpuAllocation) != nullptr; } else { auto allocationType = constant ? AllocationType::CONSTANT_SURFACE : AllocationType::GLOBAL_SURFACE; gpuAllocation = device.getMemoryManager()->allocateGraphicsMemoryWithProperties({rootDeviceIndex, @@ -65,7 +64,7 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::SVMAllocsManager *const svmAlloc bool isOnlyBssData = (totalSize == zeroInitSize); if (false == isOnlyBssData) { auto initSize = totalSize - zeroInitSize; - auto success = MemoryTransferHelper::transferMemoryToAllocation(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, *gpuAllocation, lockingSucceeded), + auto success = MemoryTransferHelper::transferMemoryToAllocation(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, *gpuAllocation), device, gpuAllocation, 0, initData, initSize); UNRECOVERABLE_IF(!success); } diff --git a/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl b/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl index dd0939cbaa..14c91dfc5a 100644 --- a/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl +++ b/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl @@ -141,7 +141,7 @@ bool ProductHelperHw::isBcsReportWaRequired(const HardwareInfo &hwIn } template <> -bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation, bool lockingSucceeded) const { +bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation) const { if (!allocation.isAllocatedInLocalMemoryPool()) { return false; } @@ -152,7 +152,7 @@ bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDev return true; } - if (!allocation.isAllocationLockable() && !lockingSucceeded) { + if (!allocation.isAllocationLockable()) { return true; } @@ -166,11 +166,6 @@ bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDev return false; } -template <> -bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation) const { - return this->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, allocation, false); -} - template <> bool ProductHelperHw::isTlbFlushRequired() const { return false; 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 e44b252ff8..ba30414cf5 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -433,24 +433,18 @@ HWTEST_F(ProductHelperTest, givenLockableAllocationWhenGettingIsBlitCopyRequired DebugManager.flags.ForceLocalMemoryAccessMode.set(0); EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); DebugManager.flags.ForceLocalMemoryAccessMode.set(1); EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); DebugManager.flags.ForceLocalMemoryAccessMode.set(3); EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); pInHwInfo.capabilityTable.blitterOperationsSupported = false; EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); graphicsAllocation.overrideMemoryPool(MemoryPool::System64KBPages); EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); pInHwInfo.capabilityTable.blitterOperationsSupported = true; EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); } HWTEST_F(ProductHelperTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { @@ -479,24 +473,18 @@ HWTEST_F(ProductHelperTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequi DebugManager.flags.ForceLocalMemoryAccessMode.set(0); EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); DebugManager.flags.ForceLocalMemoryAccessMode.set(1); EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); DebugManager.flags.ForceLocalMemoryAccessMode.set(3); EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); hwInfo.capabilityTable.blitterOperationsSupported = false; EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_TRUE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); graphicsAllocation.overrideMemoryPool(MemoryPool::System64KBPages); EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); hwInfo.capabilityTable.blitterOperationsSupported = true; EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_FALSE(productHelper->isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); } HWTEST2_F(ProductHelperTest, givenProductHelperWhenGettingIsBlitCopyRequiredForLocalMemoryThenFalseIsReturned, IsAtMostGen11) { diff --git a/shared/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp index f772d60277..c6d8960fb2 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/engine_node_helper_tests_pvc.cpp @@ -11,8 +11,6 @@ #include "shared/test/common/fixtures/device_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_device.h" -#include "shared/test/common/mocks/mock_execution_environment.h" -#include "shared/test/common/mocks/mock_gmm.h" #include "shared/test/common/mocks/mock_graphics_allocation.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" @@ -542,49 +540,3 @@ PVCTEST_F(EngineNodeHelperPvcTests, givenNonTile0AccessWhenGettingIsBlitCopyRequ EXPECT_FALSE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); } } - -PVCTEST_F(EngineNodeHelperPvcTests, givenNotLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { - DebugManagerStateRestore restore{}; - auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment(); - auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo(); - - hwInfo.capabilityTable.blitterOperationsSupported = true; - - MockGraphicsAllocation graphicsAllocation; - graphicsAllocation.setAllocationType(AllocationType::SVM_GPU); - EXPECT_FALSE(GraphicsAllocation::isLockable(graphicsAllocation.getAllocationType())); - graphicsAllocation.overrideMemoryPool(MemoryPool::LocalMemory); - - MockExecutionEnvironment executionEnvironment(&hwInfo); - executionEnvironment.initGmm(); - executionEnvironment.prepareRootDeviceEnvironments(1); - auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); - - MockGmm mockGmm(gmmHelper, nullptr, 100, 100, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true); - mockGmm.resourceParams.Flags.Info.NotLockable = true; - graphicsAllocation.setDefaultGmm(&mockGmm); - - auto &productHelper = getHelper(); - EXPECT_TRUE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - - DebugManager.flags.ForceLocalMemoryAccessMode.set(0); - EXPECT_TRUE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_FALSE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); - DebugManager.flags.ForceLocalMemoryAccessMode.set(1); - EXPECT_TRUE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_FALSE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); - - DebugManager.flags.ForceLocalMemoryAccessMode.set(3); - EXPECT_TRUE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_TRUE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); - hwInfo.capabilityTable.blitterOperationsSupported = false; - EXPECT_TRUE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_TRUE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); - - graphicsAllocation.overrideMemoryPool(MemoryPool::System64KBPages); - EXPECT_FALSE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_FALSE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); - hwInfo.capabilityTable.blitterOperationsSupported = true; - EXPECT_FALSE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation)); - EXPECT_FALSE(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, graphicsAllocation, true)); -} \ No newline at end of file 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 3136d53e6d..38e5942f89 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 @@ -8,6 +8,5 @@ #include "shared/test/common/test_macros/hw_test_base.h" HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfIsBlitSplitEnqueueWARequiredThenReturnFalse, IGFX_PVC); -HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenNotLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned, IGFX_PVC); HWTEST_EXCLUDE_PRODUCT(BlitTests, GivenCpuAccessToLocalMemoryWhenGettingMaxBlitSizeThenValuesAreOverriden_BlitPlatforms, IGFX_PVC); HWTEST_EXCLUDE_PRODUCT(GfxCoreHelperTest, GivenCooperativeEngineSupportedAndNotUsedWhenAdjustMaxWorkGroupCountIsCalledThenSmallerValueIsReturned, IGFX_PVC);