diff --git a/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp b/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp index ba8a968f97..2a85bba4f6 100644 --- a/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/linux_create_command_queue_with_properties_tests.cpp @@ -10,7 +10,6 @@ #include "shared/test/common/libult/linux/drm_mock.h" #include "shared/test/common/mocks/linux/mock_drm_command_stream_receiver.h" #include "shared/test/common/mocks/linux/mock_drm_memory_manager.h" -#include "shared/test/common/mocks/linux/mock_ioctl_helper.h" #include "shared/test/common/test_macros/hw_test.h" #include "opencl/source/command_queue/command_queue_hw.h" @@ -33,7 +32,7 @@ struct ClCreateCommandQueueWithPropertiesLinux : public UltCommandStreamReceiver executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface = DrmMemoryOperationsHandler::create(*drm, rootDeviceIndex, false); executionEnvironment->memoryManager.reset(new TestedDrmMemoryManager(*executionEnvironment)); mdevice = std::make_unique(MockDevice::create(executionEnvironment, rootDeviceIndex)); - ASSERT_NE(nullptr, mdevice.get()); + clDevice = mdevice.get(); retVal = CL_SUCCESS; context = std::unique_ptr(Context::create(nullptr, ClDeviceVector(&clDevice, 1), nullptr, nullptr, retVal)); diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 6fbcde67c2..ed8d686c68 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -84,7 +84,7 @@ DECLARE_DEBUG_VARIABLE(bool, ForceMemoryPrefetchForKmdMigratedSharedAllocations, DECLARE_DEBUG_VARIABLE(bool, ClKhrExternalMemoryExtension, true, "Enable cl_khr_external_memory extension") DECLARE_DEBUG_VARIABLE(bool, WaitForMemoryRelease, false, "Wait for memory release when out of memory") DECLARE_DEBUG_VARIABLE(bool, RemoveRestrictionsOnNumberOfThreadsInGpgpuThreadGroup, 0, "0 - default disabled, 1- remove restrictions on NumberOfThreadsInGpgpuThreadGroup in INTERFACE_DESCRIPTOR_DATA") -DECLARE_DEBUG_VARIABLE(bool, DisableGemCreateExtSetPat, false, "Do not use I915_GEM_CREATE_EXT_SET_PAT extension when gem create ext is called") +DECLARE_DEBUG_VARIABLE(bool, DisableGemCreateExtSetPat, true, "Do not use I915_GEM_CREATE_EXT_SET_PAT extension when gem create ext is called") DECLARE_DEBUG_VARIABLE(bool, SkipInOrderNonWalkerSignalingAllowed, false, "Allows for skipping non walker signalling in InOrder command lists, default: false") DECLARE_DEBUG_VARIABLE(std::string, ForceDeviceId, std::string("unk"), "Override device id in AUB/TBX mode") DECLARE_DEBUG_VARIABLE(std::string, FilterDeviceId, std::string("unk"), "Device id filter, adapter matching device id will be opened; ignored when unk") diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index c687a8d220..c7625d554c 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -635,26 +635,15 @@ GraphicsAllocation *DrmMemoryManager::allocateMemoryByKMD(const AllocationData & auto gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), allocationData.hostPtr, allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), systemMemoryStorageInfo, gmmRequirements); size_t bufferSize = allocationData.size; - auto alignment = allocationData.alignment; - if (bufferSize >= 2 * MemoryConstants::megaByte) { - alignment = MemoryConstants::pageSize2M; - } - uint64_t gpuRange = acquireGpuRangeWithCustomAlignment(bufferSize, allocationData.rootDeviceIndex, HeapIndex::heapStandard64KB, alignment); + uint64_t gpuRange = acquireGpuRangeWithCustomAlignment(bufferSize, allocationData.rootDeviceIndex, HeapIndex::heapStandard64KB, allocationData.alignment); auto &drm = getDrm(allocationData.rootDeviceIndex); - int ret = -1; - uint32_t handle; + auto ioctlHelper = drm.getIoctlHelper(); + + uint32_t handle = ioctlHelper->createGem(bufferSize, static_cast(allocationData.storageInfo.memoryBanks.to_ulong())); + auto patIndex = drm.getPatIndex(gmm.get(), allocationData.type, CacheRegion::defaultRegion, CachePolicy::writeBack, false, MemoryPoolHelper::isSystemMemoryPool(memoryPool)); - if (drm.getMemoryInfo()) { - ret = drm.getMemoryInfo()->createGemExtWithSingleRegion(allocationData.storageInfo.getMemoryBanks(), bufferSize, handle, patIndex, -1, allocationData.flags.isUSMHostAllocation); - } - - if (0 != ret) { - auto ioctlHelper = drm.getIoctlHelper(); - handle = ioctlHelper->createGem(bufferSize, static_cast(allocationData.storageInfo.memoryBanks.to_ulong())); - } - std::unique_ptr bo(new BufferObject(allocationData.rootDeviceIndex, &drm, patIndex, handle, bufferSize, maxOsContextCount)); bo->setAddress(gpuRange); diff --git a/shared/source/os_interface/linux/drm_neo.cpp b/shared/source/os_interface/linux/drm_neo.cpp index 7e137e33a3..d4c75b7545 100644 --- a/shared/source/os_interface/linux/drm_neo.cpp +++ b/shared/source/os_interface/linux/drm_neo.cpp @@ -1231,7 +1231,7 @@ uint64_t Drm::getPatIndex(Gmm *gmm, AllocationType allocationType, CacheRegion c } uint64_t patIndex = rootDeviceEnvironment.getGmmClientContext()->cachePolicyGetPATIndex(resourceInfo, usageType, compressed, cachable); - patIndex = productHelper.overridePatIndex(isUncachedType, patIndex, allocationType); + patIndex = productHelper.overridePatIndex(isUncachedType, patIndex); UNRECOVERABLE_IF(patIndex == static_cast(GMM_PAT_ERROR)); diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index 1e3b6bdbe9..b6687e18ee 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -217,7 +217,7 @@ class ProductHelper { virtual bool isSkippingStatefulInformationRequired(const KernelDescriptor &kernelDescriptor) const = 0; virtual bool getMediaFrequencyTileIndex(const ReleaseHelper *releaseHelper, uint32_t &tileIndex) const = 0; virtual bool isResolvingSubDeviceIDNeeded(const ReleaseHelper *releaseHelper) const = 0; - virtual uint64_t overridePatIndex(bool isUncachedType, uint64_t patIndex, AllocationType allocationType) const = 0; + virtual uint64_t overridePatIndex(bool isUncachedType, uint64_t patIndex) const = 0; virtual std::vector getSupportedNumGrfs(const ReleaseHelper *releaseHelper) const = 0; virtual aub_stream::EngineType getDefaultCopyEngine() const = 0; virtual void adjustEngineGroupType(EngineGroupType &engineGroupType) const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index fa3682a116..d1b1b26105 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -16,7 +16,6 @@ #include "shared/source/helpers/local_memory_access_modes.h" #include "shared/source/helpers/preamble.h" #include "shared/source/kernel/kernel_properties.h" -#include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/memory_manager/memory_manager.h" #include "shared/source/os_interface/product_helper.h" @@ -839,7 +838,7 @@ bool ProductHelperHw::isResolvingSubDeviceIDNeeded(const ReleaseHelp } template -uint64_t ProductHelperHw::overridePatIndex(bool isUncachedType, uint64_t patIndex, AllocationType allocationType) const { +uint64_t ProductHelperHw::overridePatIndex(bool isUncachedType, uint64_t patIndex) const { return patIndex; } diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 804fe947bc..5244a1acdb 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -164,7 +164,7 @@ class ProductHelperHw : public ProductHelper { bool isSkippingStatefulInformationRequired(const KernelDescriptor &kernelDescriptor) const override; bool getMediaFrequencyTileIndex(const ReleaseHelper *releaseHelper, uint32_t &tileIndex) const override; bool isResolvingSubDeviceIDNeeded(const ReleaseHelper *releaseHelper) const override; - uint64_t overridePatIndex(bool isUncachedType, uint64_t patIndex, AllocationType allocationType) const override; + uint64_t overridePatIndex(bool isUncachedType, uint64_t patIndex) const override; std::vector getSupportedNumGrfs(const ReleaseHelper *releaseHelper) const override; aub_stream::EngineType getDefaultCopyEngine() const override; void adjustEngineGroupType(EngineGroupType &engineGroupType) const override; diff --git a/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp b/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp index 99e6702a23..793b00b2d1 100644 --- a/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp +++ b/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp @@ -11,17 +11,5 @@ constexpr static auto gfxProduct = IGFX_METEORLAKE; #include "shared/source/xe_hpg_core/xe_lpg/linux/product_helper_xe_lpg_linux.inl" #include "shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl" -namespace NEO { -template <> -uint64_t ProductHelperHw::overridePatIndex(bool isUncachedType, uint64_t patIndex, AllocationType allocationType) const { - switch (allocationType) { - case NEO::AllocationType::buffer: - return 0u; - default: - return 3u; - } -} template class NEO::ProductHelperHw; - -} // namespace NEO \ No newline at end of file diff --git a/shared/test/common/os_interface/linux/device_command_stream_fixture.h b/shared/test/common/os_interface/linux/device_command_stream_fixture.h index 379e59e197..0bf3e55543 100644 --- a/shared/test/common/os_interface/linux/device_command_stream_fixture.h +++ b/shared/test/common/os_interface/linux/device_command_stream_fixture.h @@ -77,10 +77,8 @@ class DrmMockTime : public DrmMockSuccess { public: using DrmMockSuccess::DrmMockSuccess; int ioctl(DrmIoctl request, void *arg) override { - if (DrmIoctl::regRead == request) { - auto *reg = reinterpret_cast(arg); - reg->value = getVal() << 32 | 0x1; - } + auto *reg = reinterpret_cast(arg); + reg->value = getVal() << 32 | 0x1; return 0; }; diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index 9b085cd35f..d2fe954874 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -552,7 +552,7 @@ TrackNumCsrClientsOnSyncPoints = -1 EventTimestampRefreshIntervalInMilliSec = -1 SynchronizeEventBeforeReset = -1 RemoveRestrictionsOnNumberOfThreadsInGpgpuThreadGroup = 0 -DisableGemCreateExtSetPat = 0 +DisableGemCreateExtSetPat = 1 SkipDcFlushOnBarrierWithoutEvents = -1 EnableAIL=1 WaitForUserFenceOnEventHostSynchronize = -1 diff --git a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index a019eff2b2..b31cebe5f2 100644 --- a/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -1756,11 +1756,8 @@ TEST_F(DrmMemoryManagerTest, givenRequiresStandard2MBHeapThenStandard2MBHeapIsAc } TEST_F(DrmMemoryManagerTest, GivenShareableEnabledWhenAskedToCreateGraphicsAllocationThenValidAllocationIsReturnedAndStandard64KBHeapIsUsed) { - mock->ioctlHelper.reset(new MockIoctlHelper(*mock)); - mock->queryMemoryInfo(); - EXPECT_NE(nullptr, mock->getMemoryInfo()); mock->ioctlExpected.gemWait = 1; - mock->ioctlExpected.gemCreateExt = 1; + mock->ioctlExpected.gemCreate = 1; mock->ioctlExpected.gemClose = 1; allocationData.size = MemoryConstants::pageSize; @@ -1777,9 +1774,6 @@ TEST_F(DrmMemoryManagerTest, GivenShareableEnabledWhenAskedToCreateGraphicsAlloc } TEST_F(DrmMemoryManagerTest, GivenSizeAndAlignmentWhenAskedToCreateGraphicsAllocationThenValidAllocationIsReturnedAndMemoryIsAligned) { - mock->ioctlHelper.reset(new MockIoctlHelper(*mock)); - mock->queryMemoryInfo(); - EXPECT_NE(nullptr, mock->getMemoryInfo()); allocationData.size = 1; int ioctlCnt = 0; size_t alignment = 8 * MemoryConstants::megaByte; @@ -1798,7 +1792,7 @@ TEST_F(DrmMemoryManagerTest, GivenSizeAndAlignmentWhenAskedToCreateGraphicsAlloc ioctlCnt += 1; } while (alignment != 0); - mock->ioctlExpected.gemCreateExt = ioctlCnt; + mock->ioctlExpected.gemCreate = ioctlCnt; mock->ioctlExpected.gemWait = ioctlCnt; mock->ioctlExpected.gemClose = ioctlCnt; } diff --git a/shared/test/unit_test/os_interface/linux/drm_residency_handler_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_residency_handler_prelim_tests.cpp index 1351102df8..b0b5b684fd 100644 --- a/shared/test/unit_test/os_interface/linux/drm_residency_handler_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_residency_handler_prelim_tests.cpp @@ -1126,7 +1126,7 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenPatIndexProgrammingEnabledWhen } if (debugFlag == 0 || !closSupported || debugFlag == -1) { - auto expectedIndex = productHelper.overridePatIndex(false, static_cast(MockGmmClientContextBase::MockPatIndex::cached), allocation.getAllocationType()); + auto expectedIndex = productHelper.overridePatIndex(false, static_cast(MockGmmClientContextBase::MockPatIndex::cached)); EXPECT_EQ(expectedIndex, mock->context.receivedVmBindPatIndex.value()); @@ -1187,7 +1187,7 @@ HWTEST_F(DrmMemoryOperationsHandlerBindTest, givenUncachedDebugFlagSetWhenVmBind auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{device->getRootDeviceIndex(), MemoryConstants::pageSize}); operationHandler->makeResident(device, ArrayRef(&allocation, 1)); - auto expectedIndex = productHelper.overridePatIndex(true, static_cast(MockGmmClientContextBase::MockPatIndex::uncached), allocation->getAllocationType()); + auto expectedIndex = productHelper.overridePatIndex(true, static_cast(MockGmmClientContextBase::MockPatIndex::uncached)); EXPECT_EQ(expectedIndex, mock->context.receivedVmBindPatIndex.value()); 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 daa02d6735..79548ba13f 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -11,7 +11,6 @@ #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/local_memory_access_modes.h" #include "shared/source/kernel/kernel_descriptor.h" -#include "shared/source/memory_manager/allocation_type.h" #include "shared/source/os_interface/product_helper.h" #include "shared/source/release_helper/release_helper.h" #include "shared/source/unified_memory/usm_memory_support.h" @@ -446,6 +445,7 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfTile64With3DSurfaceOnBC } HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfPatIndexProgrammingSupportedThenReturnFalse) { + EXPECT_FALSE(productHelper->isVmBindPatIndexProgrammingSupported()); } @@ -841,10 +841,10 @@ HWTEST_F(ProductHelperTest, whenDisableL3ForDebugCalledThenFalseIsReturned) { HWTEST_F(ProductHelperTest, givenBooleanUncachedWhenCallOverridePatIndexThenProperPatIndexIsReturned) { uint64_t patIndex = 1u; bool isUncached = true; - EXPECT_EQ(patIndex, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::buffer)); + EXPECT_EQ(patIndex, productHelper->overridePatIndex(isUncached, patIndex)); isUncached = false; - EXPECT_EQ(patIndex, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::buffer)); + EXPECT_EQ(patIndex, productHelper->overridePatIndex(isUncached, patIndex)); } HWTEST_F(ProductHelperTest, givenProductHelperWhenGettingSupportedNumGrfsThenCorrectValueIsReturned) { 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 d9bf5cf750..2487b874ea 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 @@ -68,6 +68,7 @@ PVCTEST_F(PvcProductHelperLinux, GivenPvcWhenConfigureHardwareCustomThenKmdNotif } PVCTEST_F(PvcProductHelperLinux, givenProductHelperWhenAskedIfPatIndexProgrammingSupportedThenReturnTrue) { + EXPECT_TRUE(productHelper->isVmBindPatIndexProgrammingSupported()); } diff --git a/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp index 871863f569..55bb8fd744 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/excludes_xe_hpg_core_mtl.cpp @@ -21,4 +21,3 @@ HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPatIndexP HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenIsAdjustWalkOrderAvailableCallThenFalseReturn, IGFX_METEORLAKE); HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenCheckBlitEnqueueAllowedThenReturnTrue, IGFX_METEORLAKE); HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenGettingPreferredAllocationMethodThenNoPreferenceIsReturned, IGFX_METEORLAKE); -HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenBooleanUncachedWhenCallOverridePatIndexThenProperPatIndexIsReturned, IGFX_METEORLAKE); diff --git a/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl_linux.cpp b/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl_linux.cpp index e97e318311..3cd58b8e07 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl_linux.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl_linux.cpp @@ -5,7 +5,6 @@ * */ -#include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/os_interface/os_interface.h" #include "shared/source/xe_hpg_core/hw_info_xe_hpg_core.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -57,15 +56,4 @@ MTLTEST_F(MtlProductHelperLinux, givenProductHelperWhenAskedIsKmdMigrationsSuppo MTLTEST_F(MtlProductHelperLinux, whenCheckingIsTimestampWaitSupportedForEventsThenReturnTrue) { EXPECT_FALSE(productHelper->isTimestampWaitSupportedForEvents()); -} - -MTLTEST_F(MtlProductHelperLinux, givenBooleanUncachedWhenCallOverridePatIndexThenProperPatIndexIsReturned) { - uint64_t patIndex = 1u; - bool isUncached = true; - EXPECT_EQ(0u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::buffer)); - EXPECT_EQ(3u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::commandBuffer)); - - isUncached = false; - EXPECT_EQ(0u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::buffer)); - EXPECT_EQ(3u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::commandBuffer)); -} +} \ No newline at end of file