diff --git a/shared/source/gmm_helper/cache_settings_helper.cpp b/shared/source/gmm_helper/cache_settings_helper.cpp index 98658cc54b..21e80384ef 100644 --- a/shared/source/gmm_helper/cache_settings_helper.cpp +++ b/shared/source/gmm_helper/cache_settings_helper.cpp @@ -18,7 +18,7 @@ namespace NEO { -GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getGmmUsageType(AllocationType allocationType, bool forceUncached, const ProductHelper &productHelper) { +GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getGmmUsageType(AllocationType allocationType, bool forceUncached, const ProductHelper &productHelper, const HardwareInfo *hwInfo) { if (debugManager.flags.ForceUncachedGmmUsageType.get()) { UNRECOVERABLE_IF(allocationType == AllocationType::unknown); if ((1llu << (static_cast(allocationType) - 1)) & debugManager.flags.ForceUncachedGmmUsageType.get()) { @@ -29,7 +29,7 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getGmmUsageType(AllocationType if (forceUncached || debugManager.flags.ForceAllResourcesUncached.get()) { return getDefaultUsageTypeWithCachingDisabled(allocationType, productHelper); } else { - return getDefaultUsageTypeWithCachingEnabled(allocationType, productHelper); + return getDefaultUsageTypeWithCachingEnabled(allocationType, productHelper, hwInfo); } } @@ -47,7 +47,7 @@ bool CacheSettingsHelper::preferNoCpuAccess(GMM_RESOURCE_USAGE_TYPE_ENUM gmmReso return (gmmResourceUsageType != GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER); } -GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper) { +GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper, const HardwareInfo *hwInfo) { if (productHelper.overrideUsageForDcFlushMitigation(allocationType)) { return getDefaultUsageTypeWithCachingDisabled(allocationType, productHelper); } @@ -59,6 +59,12 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching } } + if (hwInfo->capabilityTable.isIntegratedDevice) { + if (AllocationType::ringBuffer == allocationType) { + return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; + } + } + switch (allocationType) { case AllocationType::image: return GMM_RESOURCE_USAGE_OCL_IMAGE; @@ -81,11 +87,11 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching return getDefaultUsageTypeWithCachingDisabled(allocationType, productHelper); } return GMM_RESOURCE_USAGE_OCL_BUFFER; - case AllocationType::externalHostPtr: case AllocationType::bufferHostMemory: + case AllocationType::externalHostPtr: + case AllocationType::fillPattern: case AllocationType::internalHostMemory: case AllocationType::mapAllocation: - case AllocationType::fillPattern: case AllocationType::svmCpu: case AllocationType::svmZeroCopy: case AllocationType::tagBuffer: diff --git a/shared/source/gmm_helper/cache_settings_helper.h b/shared/source/gmm_helper/cache_settings_helper.h index e4ab8142fa..f087f61d65 100644 --- a/shared/source/gmm_helper/cache_settings_helper.h +++ b/shared/source/gmm_helper/cache_settings_helper.h @@ -19,7 +19,7 @@ class ProductHelper; struct RootDeviceEnvironment; struct CacheSettingsHelper { - static GMM_RESOURCE_USAGE_TYPE_ENUM getGmmUsageType(AllocationType allocationType, bool forceUncached, const ProductHelper &productHelper); + static GMM_RESOURCE_USAGE_TYPE_ENUM getGmmUsageType(AllocationType allocationType, bool forceUncached, const ProductHelper &productHelper, const HardwareInfo *hwInfo); static GMM_RESOURCE_USAGE_TYPE_ENUM getGmmUsageTypeForUserPtr(bool isCacheFlushRequired, const void *userPtr, size_t size, const ProductHelper &productHelper); static constexpr bool isUncachedType(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType) { @@ -32,7 +32,7 @@ struct CacheSettingsHelper { static bool preferNoCpuAccess(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType, const RootDeviceEnvironment &rootDeviceEnvironment); protected: - static GMM_RESOURCE_USAGE_TYPE_ENUM getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper); + static GMM_RESOURCE_USAGE_TYPE_ENUM getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper, const HardwareInfo *hwInfo); static GMM_RESOURCE_USAGE_TYPE_ENUM getDefaultUsageTypeWithCachingDisabled(AllocationType allocationType, const ProductHelper &productHelper); }; -} // namespace NEO \ No newline at end of file +} // namespace NEO diff --git a/shared/source/gmm_helper/gmm.cpp b/shared/source/gmm_helper/gmm.cpp index 925c478231..fc27028b20 100644 --- a/shared/source/gmm_helper/gmm.cpp +++ b/shared/source/gmm_helper/gmm.cpp @@ -161,7 +161,7 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo, bool preferCompressed) { auto &productHelper = gmmHelper->getRootDeviceEnvironment().getHelper(); resourceParams.NoGfxMemory = 1; // dont allocate, only query for params - resourceParams.Usage = CacheSettingsHelper::getGmmUsageType(AllocationType::image, false, productHelper); + resourceParams.Usage = CacheSettingsHelper::getGmmUsageType(AllocationType::image, false, productHelper, gmmHelper->getHardwareInfo()); resourceParams.Format = imgInfo.surfaceFormat->gmmSurfaceFormat; resourceParams.Flags.Gpu.Texture = 1; diff --git a/shared/source/helpers/state_base_address_base.inl b/shared/source/helpers/state_base_address_base.inl index dfe5d3a6a4..f61a0637f0 100644 --- a/shared/source/helpers/state_base_address_base.inl +++ b/shared/source/helpers/state_base_address_base.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -98,7 +98,7 @@ void StateBaseAddressHelper::programStateBaseAddress( args.stateBaseAddressCmd->setInstructionBufferSize(MemoryConstants::sizeOf4GBinPageEntities); auto &productHelper = args.gmmHelper->getRootDeviceEnvironment().template getHelper(); - auto resourceUsage = CacheSettingsHelper::getGmmUsageType(AllocationType::internalHeap, debugManager.flags.DisableCachingForHeaps.get(), productHelper); + auto resourceUsage = CacheSettingsHelper::getGmmUsageType(AllocationType::internalHeap, debugManager.flags.DisableCachingForHeaps.get(), productHelper, args.gmmHelper->getHardwareInfo()); args.stateBaseAddressCmd->setInstructionMemoryObjectControlState(args.gmmHelper->getMOCS(resourceUsage)); } diff --git a/shared/source/helpers/state_base_address_xehp_and_later.inl b/shared/source/helpers/state_base_address_xehp_and_later.inl index ff3f6bcba7..6b187455ad 100644 --- a/shared/source/helpers/state_base_address_xehp_and_later.inl +++ b/shared/source/helpers/state_base_address_xehp_and_later.inl @@ -74,7 +74,7 @@ void StateBaseAddressHelper::appendStateBaseAddressParameters( auto &productHelper = args.gmmHelper->getRootDeviceEnvironment().template getHelper(); - auto heapResourceUsage = CacheSettingsHelper::getGmmUsageType(AllocationType::internalHeap, debugManager.flags.DisableCachingForHeaps.get(), productHelper); + auto heapResourceUsage = CacheSettingsHelper::getGmmUsageType(AllocationType::internalHeap, debugManager.flags.DisableCachingForHeaps.get(), productHelper, args.gmmHelper->getHardwareInfo()); auto heapMocsValue = args.gmmHelper->getMOCS(heapResourceUsage); args.stateBaseAddressCmd->setSurfaceStateMemoryObjectControlState(heapMocsValue); diff --git a/shared/source/memory_manager/os_agnostic_memory_manager.cpp b/shared/source/memory_manager/os_agnostic_memory_manager.cpp index 496eea8cdd..263d19917b 100644 --- a/shared/source/memory_manager/os_agnostic_memory_manager.cpp +++ b/shared/source/memory_manager/os_agnostic_memory_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2024 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -127,7 +127,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryWithAlignment allocationData.hostPtr, sizeAligned, alignment, - CacheSettingsHelper::getGmmUsageType(memoryAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper), + CacheSettingsHelper::getGmmUsageType(memoryAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper, pHwInfo), allocationData.storageInfo, gmmRequirements); memoryAllocation->setDefaultGmm(gmm.release()); @@ -208,7 +208,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemory64kb(const Al allocationData.hostPtr, allocationDataAlign.size, allocationDataAlign.alignment, - CacheSettingsHelper::getGmmUsageType(memoryAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper), + CacheSettingsHelper::getGmmUsageType(memoryAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper, hwInfo), allocationData.storageInfo, gmmRequirements); memoryAllocation->setDefaultGmm(gmm.release()); } @@ -456,6 +456,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocatePhysicalLocalDeviceMemory(c size_t sizeAligned64k = 0; sizeAligned64k = alignUp(allocationData.size, MemoryConstants::pageSize64k); auto &productHelper = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHelper(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper()->getHardwareInfo(); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = allocationData.flags.preferCompressed; @@ -463,7 +464,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocatePhysicalLocalDeviceMemory(c nullptr, sizeAligned64k, MemoryConstants::pageSize64k, - CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), + CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper, hwInfo), allocationData.storageInfo, gmmRequirements); @@ -491,11 +492,12 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocatePhysicalDeviceMemory(const status = AllocationStatus::Error; auto &productHelper = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHelper(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper()->getHardwareInfo(); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = allocationData.flags.preferCompressed; auto gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), allocationData.hostPtr, - allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), + allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper, hwInfo), allocationData.storageInfo, gmmRequirements); GraphicsAllocation *alloc = nullptr; @@ -518,11 +520,12 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocatePhysicalHostMemory(const Al status = AllocationStatus::Error; auto &productHelper = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHelper(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper()->getHardwareInfo(); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; auto gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), nullptr, - allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), + allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper, hwInfo), allocationData.storageInfo, gmmRequirements); GraphicsAllocation *alloc = nullptr; @@ -545,11 +548,12 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocatePhysicalHostMemory(const Al GraphicsAllocation *OsAgnosticMemoryManager::allocateMemoryByKMD(const AllocationData &allocationData) { auto &productHelper = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHelper(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper()->getHardwareInfo(); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = allocationData.flags.preferCompressed; auto gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), allocationData.hostPtr, - allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), + allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper, hwInfo), allocationData.storageInfo, gmmRequirements); GraphicsAllocation *alloc = nullptr; @@ -702,7 +706,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool( allocationData.hostPtr, allocationData.size, MemoryConstants::pageSize2M, - CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), + CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper, gmmHelper->getHardwareInfo()), allocationData.storageInfo, gmmRequirements); allocation->setDefaultGmm(gmm.release()); @@ -729,7 +733,7 @@ GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool( allocationData.hostPtr, sizeAligned64k, MemoryConstants::pageSize64k, - CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), + CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper, gmmHelper->getHardwareInfo()), allocationData.storageInfo, gmmRequirements); } diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index d40677afa9..87b6738a81 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -803,12 +803,13 @@ GraphicsAllocation *DrmMemoryManager::allocatePhysicalDeviceMemory(const Allocat const auto memoryPool = MemoryPool::systemCpuInaccessible; StorageInfo systemMemoryStorageInfo = {}; auto &productHelper = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHelper(); + auto gmmHelper = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(); GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; - auto gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), nullptr, - allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), systemMemoryStorageInfo, gmmRequirements); + auto gmm = std::make_unique(gmmHelper, nullptr, + allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper, gmmHelper->getHardwareInfo()), systemMemoryStorageInfo, gmmRequirements); size_t bufferSize = allocationData.size; auto &drm = getDrm(allocationData.rootDeviceIndex); @@ -837,7 +838,7 @@ GraphicsAllocation *DrmMemoryManager::allocateMemoryByKMD(const AllocationData & gmmRequirements.preferCompressed = false; auto gmmHelper = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(); auto gmm = std::make_unique(gmmHelper, allocationData.hostPtr, - allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), systemMemoryStorageInfo, gmmRequirements); + allocationData.size, 0u, CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper, gmmHelper->getHardwareInfo()), systemMemoryStorageInfo, gmmRequirements); size_t bufferSize = allocationData.size; auto alignment = allocationData.alignment; if (bufferSize >= 2 * MemoryConstants::megaByte) { @@ -1111,7 +1112,7 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromMultipleShared nullptr, bo->peekSize(), 0u, - CacheSettingsHelper::getGmmUsageType(drmAllocation->getAllocationType(), false, productHelper), + CacheSettingsHelper::getGmmUsageType(drmAllocation->getAllocationType(), false, productHelper, gmmHelper->getHardwareInfo()), allocationData.storageInfo, gmmRequirements); drmAllocation->setGmm(gmm, i); @@ -1880,7 +1881,7 @@ void createColouredGmms(GmmHelper *gmmHelper, DrmAllocation &allocation, bool co nullptr, currentSize, 0u, - CacheSettingsHelper::getGmmUsageType(allocation.getAllocationType(), false, productHelper), + CacheSettingsHelper::getGmmUsageType(allocation.getAllocationType(), false, productHelper, gmmHelper->getHardwareInfo()), limitedStorageInfo, gmmRequirements); allocation.setGmm(gmm, handleId); @@ -1900,7 +1901,7 @@ void fillGmmsInAllocation(GmmHelper *gmmHelper, DrmAllocation *allocation) { limitedStorageInfo.memoryBanks &= 1u << handleId; limitedStorageInfo.pageTablesVisibility &= 1u << handleId; auto gmm = new Gmm(gmmHelper, nullptr, alignedSize, 0u, - CacheSettingsHelper::getGmmUsageType(allocation->getAllocationType(), false, productHelper), limitedStorageInfo, gmmRequirements); + CacheSettingsHelper::getGmmUsageType(allocation->getAllocationType(), false, productHelper, gmmHelper->getHardwareInfo()), limitedStorageInfo, gmmRequirements); allocation->setGmm(gmm, handleId); } } @@ -2007,7 +2008,7 @@ inline std::unique_ptr DrmMemoryManager::makeGmmIfSingleHandle(const Alloca nullptr, sizeAligned, 0u, - CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper), + CacheSettingsHelper::getGmmUsageType(allocationData.type, allocationData.flags.uncacheable, productHelper, gmmHelper->getHardwareInfo()), allocationData.storageInfo, gmmRequirements); } diff --git a/shared/source/os_interface/linux/drm_neo.cpp b/shared/source/os_interface/linux/drm_neo.cpp index 158e5fc1cb..cd445deee9 100644 --- a/shared/source/os_interface/linux/drm_neo.cpp +++ b/shared/source/os_interface/linux/drm_neo.cpp @@ -1426,7 +1426,7 @@ uint64_t Drm::getPatIndex(Gmm *gmm, AllocationType allocationType, CacheRegion c } auto &productHelper = rootDeviceEnvironment.getProductHelper(); - GMM_RESOURCE_USAGE_TYPE usageType = CacheSettingsHelper::getGmmUsageType(allocationType, false, productHelper); + GMM_RESOURCE_USAGE_TYPE usageType = CacheSettingsHelper::getGmmUsageType(allocationType, false, productHelper, getHardwareInfo()); auto isUncachedType = CacheSettingsHelper::isUncachedType(usageType); if (isUncachedType && debugManager.flags.OverridePatIndexForUncachedTypes.get() != -1) { diff --git a/shared/source/os_interface/windows/wddm_memory_manager.cpp b/shared/source/os_interface/windows/wddm_memory_manager.cpp index 649ee02c58..25c8f98333 100644 --- a/shared/source/os_interface/windows/wddm_memory_manager.cpp +++ b/shared/source/os_interface/windows/wddm_memory_manager.cpp @@ -126,13 +126,14 @@ bool WddmMemoryManager::mapPhysicalHostMemoryToVirtualMemory(RootDeviceIndicesCo GraphicsAllocation *WddmMemoryManager::allocatePhysicalDeviceMemory(const AllocationData &allocationData, AllocationStatus &status) { auto &productHelper = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHelper(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper()->getHardwareInfo(); StorageInfo systemMemoryStorageInfo = {}; systemMemoryStorageInfo.isLockable = allocationData.storageInfo.isLockable; GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; auto gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), nullptr, allocationData.size, 0u, - CacheSettingsHelper::getGmmUsageType(allocationData.type, !!allocationData.flags.uncacheable, productHelper), systemMemoryStorageInfo, gmmRequirements); + CacheSettingsHelper::getGmmUsageType(allocationData.type, !!allocationData.flags.uncacheable, productHelper, hwInfo), systemMemoryStorageInfo, gmmRequirements); auto allocation = std::make_unique(allocationData.rootDeviceIndex, 1u, // numGmms allocationData.type, nullptr, 0, allocationData.size, nullptr, @@ -153,13 +154,14 @@ GraphicsAllocation *WddmMemoryManager::allocateMemoryByKMD(const AllocationData } auto &productHelper = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHelper(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper()->getHardwareInfo(); StorageInfo systemMemoryStorageInfo = {}; systemMemoryStorageInfo.isLockable = allocationData.storageInfo.isLockable; GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = allocationData.flags.preferCompressed; 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); + CacheSettingsHelper::getGmmUsageType(allocationData.type, !!allocationData.flags.uncacheable, productHelper, hwInfo), systemMemoryStorageInfo, gmmRequirements); auto allocation = std::make_unique(allocationData.rootDeviceIndex, 1u, // numGmms allocationData.type, nullptr, 0, allocationData.size, nullptr, @@ -225,6 +227,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryUsingKmdAndMapItToC maxOsContextCount); auto &productHelper = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getHelper(); + auto hwInfo = executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper()->getHardwareInfo(); auto storageInfo = allocationData.storageInfo; if (!allocationData.flags.preferCompressed) { @@ -245,7 +248,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryUsingKmdAndMapItToC auto gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), nullptr, sizeAligned, 0u, - CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper), + CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper, hwInfo), storageInfo, gmmRequirements); wddmAllocation->setDefaultGmm(gmm); @@ -331,7 +334,7 @@ GraphicsAllocation *WddmMemoryManager::allocateHugeGraphicsMemory(const Allocati gmmRequirements.preferCompressed = false; auto gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), static_cast(alignedPtr) + gmmId * chunkSize, size, 0u, - CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!uncacheable, productHelper), {}, gmmRequirements); + CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!uncacheable, productHelper, gmmHelper->getHardwareInfo()), {}, gmmRequirements); wddmAllocation->setGmm(gmm, gmmId); sizeRemaining -= size; } @@ -413,7 +416,7 @@ GraphicsAllocation *WddmMemoryManager::allocateSystemMemoryAndCreateGraphicsAllo gmmRequirements.preferCompressed = allocationData.flags.preferCompressed; gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), pSysMem, sizeAligned, 0u, - CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper), + CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper, gmmHelper->getHardwareInfo()), allocationData.storageInfo, gmmRequirements); wddmAllocation->setDefaultGmm(gmm); @@ -522,7 +525,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryWithHostPtr(const A gmmRequirements.preferCompressed = false; Gmm *gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), ptrAligned, sizeAligned, 0u, - CacheSettingsHelper::getGmmUsageType(allocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper), {}, gmmRequirements); + CacheSettingsHelper::getGmmUsageType(allocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper, gmmHelper->getHardwareInfo()), {}, gmmRequirements); allocation->setDefaultGmm(gmm); if (createWddmAllocation(allocation, reserve)) { return allocation; @@ -580,7 +583,7 @@ GraphicsAllocation *WddmMemoryManager::allocate32BitGraphicsMemoryImpl(const All gmmRequirements.preferCompressed = false; gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), ptrAligned, sizeAligned, 0u, - CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper), storageInfo, gmmRequirements); + CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper, hwInfo), storageInfo, gmmRequirements); wddmAllocation->setDefaultGmm(gmm); if (!createWddmAllocation(wddmAllocation.get(), nullptr)) { @@ -856,6 +859,7 @@ MemoryManager::AllocationStatus WddmMemoryManager::populateOsHandles(OsHandleSto uint32_t allocatedFragmentsCounter = 0; auto &productHelper = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHelper(); + auto hwInfo = getGmmHelper(rootDeviceIndex)->getHardwareInfo(); for (unsigned int i = 0; i < maxFragmentsCount; i++) { // If no fragment is present it means it already exists. @@ -871,7 +875,7 @@ MemoryManager::AllocationStatus WddmMemoryManager::populateOsHandles(OsHandleSto osHandle->gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getGmmHelper(), handleStorage.fragmentStorageData[i].cpuPtr, handleStorage.fragmentStorageData[i].fragmentSize, 0u, - CacheSettingsHelper::getGmmUsageType(AllocationType::externalHostPtr, false, productHelper), {}, gmmRequirements); + CacheSettingsHelper::getGmmUsageType(AllocationType::externalHostPtr, false, productHelper, hwInfo), {}, gmmRequirements); allocatedFragmentIndexes[allocatedFragmentsCounter] = i; allocatedFragmentsCounter++; } @@ -1284,7 +1288,7 @@ void createColouredGmms(GmmHelper *gmmHelper, WddmAllocation &allocation, const nullptr, currentSize, 0u, - CacheSettingsHelper::getGmmUsageType(allocation.getAllocationType(), false, productHelper), + CacheSettingsHelper::getGmmUsageType(allocation.getAllocationType(), false, productHelper, gmmHelper->getHardwareInfo()), limitedStorageInfo, gmmRequirements); allocation.setGmm(gmm, handleId); } @@ -1302,7 +1306,7 @@ void fillGmmsInAllocation(GmmHelper *gmmHelper, WddmAllocation *allocation, cons limitedStorageInfo.memoryBanks &= static_cast(1u << handleId); limitedStorageInfo.pageTablesVisibility &= static_cast(1u << handleId); auto gmm = new Gmm(gmmHelper, nullptr, allocation->getAlignedSize(), 0u, - CacheSettingsHelper::getGmmUsageType(allocation->getAllocationType(), false, productHelper), limitedStorageInfo, gmmRequirements); + CacheSettingsHelper::getGmmUsageType(allocation->getAllocationType(), false, productHelper, gmmHelper->getHardwareInfo()), limitedStorageInfo, gmmRequirements); allocation->setGmm(gmm, handleId); } } @@ -1318,7 +1322,7 @@ void splitGmmsInAllocation(GmmHelper *gmmHelper, WddmAllocation *wddmAllocation, for (auto gmmId = 0u; gmmId < wddmAllocation->getNumGmms(); ++gmmId) { auto size = sizeRemaining > chunkSize ? chunkSize : sizeRemaining; auto gmm = new Gmm(gmmHelper, nullptr, size, alignment, - CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), false, productHelper), storageInfo, gmmRequirements); + CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), false, productHelper, gmmHelper->getHardwareInfo()), storageInfo, gmmRequirements); wddmAllocation->setGmm(gmm, gmmId); sizeRemaining -= size; } @@ -1358,7 +1362,7 @@ GraphicsAllocation *WddmMemoryManager::allocatePhysicalLocalDeviceMemory(const A nullptr, sizeAligned, alignment, - CacheSettingsHelper::getGmmUsageType(allocationData.type, !!allocationData.flags.uncacheable, productHelper), + CacheSettingsHelper::getGmmUsageType(allocationData.type, !!allocationData.flags.uncacheable, productHelper, gmmHelper->getHardwareInfo()), allocationData.storageInfo, gmmRequirements); } @@ -1452,7 +1456,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryInDevicePool(const nullptr, sizeAligned, alignment, - CacheSettingsHelper::getGmmUsageType(allocationData.type, !!allocationData.flags.uncacheable, productHelper), + CacheSettingsHelper::getGmmUsageType(allocationData.type, !!allocationData.flags.uncacheable, productHelper, gmmHelper->getHardwareInfo()), allocationData.storageInfo, gmmRequirements); } diff --git a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp index 5e0a4e7776..04a630694a 100644 --- a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -685,11 +685,14 @@ TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) { GTEST_SKIP(); } + HardwareInfo hwInfo; + hwInfo.capabilityTable.isIntegratedDevice = false; + for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); auto uncachedGmmUsageType = productHelper.isNewCoherencyModelSupported() ? GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC : GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; for (auto forceUncached : {true, false}) { - auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, forceUncached, productHelper); + auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, forceUncached, productHelper, &hwInfo); auto expectedUsage = GMM_RESOURCE_USAGE_UNKNOWN; switch (allocationType) { @@ -711,11 +714,59 @@ TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) { expectedUsage = (forceUncached || productHelper.isDcFlushAllowed()) ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_BUFFER; break; - case AllocationType::externalHostPtr: case AllocationType::bufferHostMemory: + case AllocationType::externalHostPtr: + case AllocationType::fillPattern: case AllocationType::internalHostMemory: case AllocationType::mapAllocation: + case AllocationType::svmCpu: + case AllocationType::svmZeroCopy: + case AllocationType::tagBuffer: + expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; + break; + default: + expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_BUFFER; + break; + } + + EXPECT_EQ(expectedUsage, usage); + } + } + + hwInfo.capabilityTable.isIntegratedDevice = true; + + for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { + auto allocationType = static_cast(i); + auto uncachedGmmUsageType = productHelper.isNewCoherencyModelSupported() ? GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC : GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; + for (auto forceUncached : {true, false}) { + auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, forceUncached, productHelper, &hwInfo); + auto expectedUsage = GMM_RESOURCE_USAGE_UNKNOWN; + + switch (allocationType) { + case AllocationType::constantSurface: + expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; + break; + case AllocationType::image: + expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_IMAGE; + break; + case AllocationType::preemption: + expectedUsage = forceUncached ? GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC : GMM_RESOURCE_USAGE_OCL_BUFFER; + break; + case AllocationType::internalHeap: + case AllocationType::linearStream: + expectedUsage = forceUncached ? GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED : GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER; + break; + case AllocationType::gpuTimestampDeviceBuffer: + case AllocationType::timestampPacketTagBuffer: + expectedUsage = (forceUncached || productHelper.isDcFlushAllowed()) ? uncachedGmmUsageType + : GMM_RESOURCE_USAGE_OCL_BUFFER; + break; + case AllocationType::bufferHostMemory: + case AllocationType::externalHostPtr: case AllocationType::fillPattern: + case AllocationType::internalHostMemory: + case AllocationType::mapAllocation: + case AllocationType::ringBuffer: case AllocationType::svmCpu: case AllocationType::svmZeroCopy: case AllocationType::tagBuffer: @@ -736,24 +787,28 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu debugManager.flags.AllowDcFlush.set(0); MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + + HardwareInfo hwInfo; + hwInfo.capabilityTable.isIntegratedDevice = false; + for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); auto uncachedGmmUsageType = productHelper.isNewCoherencyModelSupported() ? GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC : GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; - auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, false, productHelper); + auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, false, productHelper, &hwInfo); auto expectedUsage = GMM_RESOURCE_USAGE_UNKNOWN; if (productHelper.isDcFlushMitigated()) { switch (allocationType) { + case AllocationType::bufferHostMemory: case AllocationType::externalHostPtr: + case AllocationType::gpuTimestampDeviceBuffer: + case AllocationType::internalHostMemory: case AllocationType::mapAllocation: + case AllocationType::printfSurface: case AllocationType::svmCpu: case AllocationType::svmZeroCopy: - case AllocationType::internalHostMemory: - case AllocationType::timestampPacketTagBuffer: - case AllocationType::gpuTimestampDeviceBuffer: - case AllocationType::bufferHostMemory: case AllocationType::tagBuffer: - case AllocationType::printfSurface: + case AllocationType::timestampPacketTagBuffer: expectedUsage = uncachedGmmUsageType; break; @@ -786,11 +841,84 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu case AllocationType::linearStream: expectedUsage = GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER; break; - case AllocationType::externalHostPtr: case AllocationType::bufferHostMemory: + case AllocationType::externalHostPtr: + case AllocationType::fillPattern: case AllocationType::internalHostMemory: case AllocationType::mapAllocation: + case AllocationType::svmCpu: + case AllocationType::svmZeroCopy: + case AllocationType::tagBuffer: + expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; + break; + default: + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER; + break; + } + } + + EXPECT_EQ(expectedUsage, usage); + } + + hwInfo.capabilityTable.isIntegratedDevice = true; + + for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { + auto allocationType = static_cast(i); + auto uncachedGmmUsageType = productHelper.isNewCoherencyModelSupported() ? GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC : GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; + auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, false, productHelper, &hwInfo); + auto expectedUsage = GMM_RESOURCE_USAGE_UNKNOWN; + + if (productHelper.isDcFlushMitigated()) { + switch (allocationType) { + case AllocationType::bufferHostMemory: + case AllocationType::externalHostPtr: + case AllocationType::gpuTimestampDeviceBuffer: + case AllocationType::internalHostMemory: + case AllocationType::mapAllocation: + case AllocationType::printfSurface: + case AllocationType::svmCpu: + case AllocationType::svmZeroCopy: + case AllocationType::tagBuffer: + case AllocationType::timestampPacketTagBuffer: + expectedUsage = uncachedGmmUsageType; + break; + + case AllocationType::linearStream: + case AllocationType::internalHeap: + expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED; + break; + case AllocationType::constantSurface: + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; + break; + case AllocationType::image: + expectedUsage = GMM_RESOURCE_USAGE_OCL_IMAGE; + break; case AllocationType::fillPattern: + case AllocationType::ringBuffer: + expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; + break; + default: + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER; + break; + } + } else { + switch (allocationType) { + case AllocationType::constantSurface: + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; + break; + case AllocationType::image: + expectedUsage = GMM_RESOURCE_USAGE_OCL_IMAGE; + break; + case AllocationType::internalHeap: + case AllocationType::linearStream: + expectedUsage = GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER; + break; + case AllocationType::bufferHostMemory: + case AllocationType::externalHostPtr: + case AllocationType::fillPattern: + case AllocationType::internalHostMemory: + case AllocationType::mapAllocation: + case AllocationType::ringBuffer: case AllocationType::svmCpu: case AllocationType::svmZeroCopy: case AllocationType::tagBuffer: @@ -812,8 +940,8 @@ TEST(GmmTest, givenDebugFlagWhenTimestampAllocationsAreQueriedThenBufferPolicyIs MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); auto expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER; - EXPECT_EQ(expectedUsage, CacheSettingsHelper::getGmmUsageType(AllocationType::gpuTimestampDeviceBuffer, false, productHelper)); - EXPECT_EQ(expectedUsage, CacheSettingsHelper::getGmmUsageType(AllocationType::timestampPacketTagBuffer, false, productHelper)); + EXPECT_EQ(expectedUsage, CacheSettingsHelper::getGmmUsageType(AllocationType::gpuTimestampDeviceBuffer, false, productHelper, defaultHwInfo.get())); + EXPECT_EQ(expectedUsage, CacheSettingsHelper::getGmmUsageType(AllocationType::timestampPacketTagBuffer, false, productHelper, defaultHwInfo.get())); } TEST(GmmTest, givenForceAllResourcesUncachedFlagSetWhenGettingUsageTypeThenReturnUncached) { @@ -825,7 +953,7 @@ TEST(GmmTest, givenForceAllResourcesUncachedFlagSetWhenGettingUsageTypeThenRetur for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); - auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, false, productHelper); + auto usage = CacheSettingsHelper::getGmmUsageType(allocationType, false, productHelper, defaultHwInfo.get()); auto expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; if (productHelper.isNewCoherencyModelSupported()) { @@ -867,10 +995,10 @@ TEST(GmmTest, givenInternalHeapOrLinearStreamWhenDebugFlagIsSetThenReturnUncache MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - auto usage = CacheSettingsHelper::getGmmUsageType(AllocationType::internalHeap, false, productHelper); + auto usage = CacheSettingsHelper::getGmmUsageType(AllocationType::internalHeap, false, productHelper, defaultHwInfo.get()); EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED, usage); - usage = CacheSettingsHelper::getGmmUsageType(AllocationType::linearStream, false, productHelper); + usage = CacheSettingsHelper::getGmmUsageType(AllocationType::linearStream, false, productHelper, defaultHwInfo.get()); EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED, usage); } @@ -884,7 +1012,7 @@ TEST(GmmTest, givenConstSurfaceWhenDebugFlagIsSetThenReturnUncachedType) { expectedUncachedGmmUsageType = GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; } EXPECT_EQ(expectedUncachedGmmUsageType, - CacheSettingsHelper::getGmmUsageType(AllocationType::constantSurface, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::constantSurface, false, productHelper, defaultHwInfo.get())); } TEST(GmmTest, givenUncachedDebugFlagMaskSetWhenAskingForUsageTypeThenReturnUncached) { @@ -906,13 +1034,13 @@ TEST(GmmTest, givenUncachedDebugFlagMaskSetWhenAskingForUsageTypeThenReturnUncac expectedUncachedGmmUsageType = GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; } EXPECT_EQ(expectedUncachedGmmUsageType, - CacheSettingsHelper::getGmmUsageType(AllocationType::buffer, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::buffer, false, productHelper, defaultHwInfo.get())); EXPECT_EQ(expectedUncachedGmmUsageType, - CacheSettingsHelper::getGmmUsageType(AllocationType::image, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::image, false, productHelper, defaultHwInfo.get())); EXPECT_NE(expectedUncachedGmmUsageType, - CacheSettingsHelper::getGmmUsageType(AllocationType::bufferHostMemory, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::bufferHostMemory, false, productHelper, defaultHwInfo.get())); } TEST(GmmTest, givenFlagForceGmmSystemMemoryBufferForAllocationsWhenCallGetGmmUsageTypeThenReturnSystemMemoryBuffer) { @@ -927,17 +1055,17 @@ TEST(GmmTest, givenFlagForceGmmSystemMemoryBufferForAllocationsWhenCallGetGmmUsa auto defaultGmmUsageType = GMM_RESOURCE_USAGE_OCL_BUFFER; EXPECT_EQ(defaultGmmUsageType, - CacheSettingsHelper::getGmmUsageType(AllocationType::buffer, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::buffer, false, productHelper, defaultHwInfo.get())); EXPECT_EQ(defaultGmmUsageType, - CacheSettingsHelper::getGmmUsageType(AllocationType::globalFence, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::globalFence, false, productHelper, defaultHwInfo.get())); debugManager.flags.ForceGmmSystemMemoryBufferForAllocations.set(bufferMask | globalFence); auto expectedGmmUsageTypeAfterForcingFlag = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; EXPECT_EQ(expectedGmmUsageTypeAfterForcingFlag, - CacheSettingsHelper::getGmmUsageType(AllocationType::buffer, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::buffer, false, productHelper, defaultHwInfo.get())); EXPECT_EQ(expectedGmmUsageTypeAfterForcingFlag, - CacheSettingsHelper::getGmmUsageType(AllocationType::globalFence, false, productHelper)); + CacheSettingsHelper::getGmmUsageType(AllocationType::globalFence, false, productHelper, defaultHwInfo.get())); } TEST(GmmTest, givenAllocationForStatefulAccessWhenDebugFlagIsSetThenReturnUncachedType) { @@ -961,7 +1089,7 @@ TEST(GmmTest, givenAllocationForStatefulAccessWhenDebugFlagIsSetThenReturnUncach AllocationType::svmZeroCopy, AllocationType::unifiedSharedMemory}) { - EXPECT_EQ(expectedUncachedGmmUsageType, CacheSettingsHelper::getGmmUsageType(allocType, false, productHelper)); + EXPECT_EQ(expectedUncachedGmmUsageType, CacheSettingsHelper::getGmmUsageType(allocType, false, productHelper, defaultHwInfo.get())); } }