diff --git a/shared/source/os_interface/linux/drm_buffer_object.h b/shared/source/os_interface/linux/drm_buffer_object.h index 978fdba16b684..7c60c9a8a9932 100644 --- a/shared/source/os_interface/linux/drm_buffer_object.h +++ b/shared/source/os_interface/linux/drm_buffer_object.h @@ -10,7 +10,6 @@ #include "shared/source/command_stream/task_count_helper.h" #include "shared/source/helpers/common_types.h" #include "shared/source/helpers/constants.h" -#include "shared/source/memory_manager/allocation_type.h" #include "shared/source/memory_manager/definitions/engine_limits.h" #include "shared/source/memory_manager/memory_operations_status.h" #include "shared/source/os_interface/linux/cache_info.h" @@ -214,14 +213,6 @@ class BufferObject { bool isChunked = false; - void setIsImage(AllocationType type) { - this->isImageAllocation = type == AllocationType::image; - } - - bool isImage() const { - return this->isImageAllocation; - } - protected: MOCKABLE_VIRTUAL MemoryOperationsStatus evictUnusedAllocations(bool waitForCompletion, bool isLockNeeded); @@ -239,7 +230,6 @@ class BufferObject { bool allowCapture = false; bool requiresImmediateBinding = false; bool requiresExplicitResidency = false; - bool isImageAllocation = false; MOCKABLE_VIRTUAL void fillExecObject(ExecObject &execObject, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId); void printBOBindingResult(OsContext *osContext, uint32_t vmHandleId, bool bind, int retVal); diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index 4a71b05489268..d9f45e9f0f06a 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -678,7 +678,6 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryForImageImpl(const A return nullptr; } bo->setAddress(gpuRange); - bo->setIsImage(allocationData.type); [[maybe_unused]] auto ret2 = bo->setTiling(ioctlHelper->getDrmParamValue(DrmParam::tilingY), static_cast(allocationData.imgInfo->rowPitch)); DEBUG_BREAK_IF(ret2 != true); @@ -1068,7 +1067,6 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o drmAllocation->setDefaultGmm(gmm); bo->setPatIndex(drm.getPatIndex(gmm, properties.allocationType, CacheRegion::defaultRegion, CachePolicy::writeBack, false, MemoryPoolHelper::isSystemMemoryPool(memoryPool))); - bo->setIsImage(properties.allocationType); } if (!reuseSharedAllocation) { @@ -1899,7 +1897,6 @@ BufferObject *DrmMemoryManager::createBufferObjectInMemoryRegion(uint32_t rootDe } bo->setAddress(gpuAddress); - bo->setIsImage(allocationType); return bo; } diff --git a/shared/source/os_interface/linux/drm_neo.cpp b/shared/source/os_interface/linux/drm_neo.cpp index 25f81d86afbcc..0d7a96f298585 100644 --- a/shared/source/os_interface/linux/drm_neo.cpp +++ b/shared/source/os_interface/linux/drm_neo.cpp @@ -688,7 +688,7 @@ uint32_t Drm::getVirtualMemoryAddressSpace(uint32_t vmId) const { } void Drm::setNewResourceBoundToVM(BufferObject *bo, uint32_t vmHandleId) { - if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired(*this->getHardwareInfo(), bo->isImage())) { + if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired()) { return; } const auto &engines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines(bo->getRootDeviceIndex()); diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index 457c35430c127..86cbae4a1484e 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -159,7 +159,7 @@ class ProductHelper { virtual bool isResolveDependenciesByPipeControlsSupported(const HardwareInfo &hwInfo, bool isOOQ, TaskCountType queueTaskCount, const CommandStreamReceiver &queueCsr) const = 0; virtual bool isMidThreadPreemptionDisallowedForRayTracingKernels() const = 0; virtual bool isBufferPoolAllocatorSupported() const = 0; - virtual bool isTlbFlushRequired(const HardwareInfo &hwInfo, bool precondition) const = 0; + virtual bool isTlbFlushRequired() const = 0; virtual bool isDummyBlitWaRequired() const = 0; virtual bool isDetectIndirectAccessInKernelSupported(const KernelDescriptor &kernelDescriptor, const bool isPrecompiled) const = 0; virtual bool isLinearStoragePreferred(bool isImage1d, bool forceLinearStorage) const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index d2e3a4cc7a7c4..421f938b53509 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -61,7 +61,7 @@ void ProductHelperHw::adjustSamplerState(void *sampler, const Hardwa } template -bool ProductHelperHw::isTlbFlushRequired(const HardwareInfo &hwInfo, bool precondition) const { +bool ProductHelperHw::isTlbFlushRequired() const { bool tlbFlushRequired = true; if (debugManager.flags.ForceTlbFlush.get() != -1) { tlbFlushRequired = !!debugManager.flags.ForceTlbFlush.get(); diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index f51516e87e2e4..4158581fe74f5 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -112,7 +112,7 @@ class ProductHelperHw : public ProductHelper { bool isResolveDependenciesByPipeControlsSupported(const HardwareInfo &hwInfo, bool isOOQ, TaskCountType queueTaskCount, const CommandStreamReceiver &queueCsr) const override; bool isMidThreadPreemptionDisallowedForRayTracingKernels() const override; bool isBufferPoolAllocatorSupported() const override; - bool isTlbFlushRequired(const HardwareInfo &hwInfo, bool precondition) const override; + bool isTlbFlushRequired() const override; bool isDummyBlitWaRequired() const override; bool isDetectIndirectAccessInKernelSupported(const KernelDescriptor &kernelDescriptor, const bool isPrecompiled) const override; bool isLinearStoragePreferred(bool isImage1d, bool forceLinearStorage) const override; diff --git a/shared/source/os_interface/windows/wddm/wddm.cpp b/shared/source/os_interface/windows/wddm/wddm.cpp index 70c0ae4052179..623b5e72d7bbe 100644 --- a/shared/source/os_interface/windows/wddm/wddm.cpp +++ b/shared/source/os_interface/windows/wddm/wddm.cpp @@ -1349,7 +1349,7 @@ void Wddm::populateIpVersion(HardwareInfo &hwInfo) { } void Wddm::setNewResourceBoundToPageTable() { - if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired(*this->getHardwareInfo(), true)) { + if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired()) { return; } this->forEachContextWithinWddm([](const EngineControl &engine) { engine.osContext->setNewResourceBound(); }); 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 1b1ed4da1562e..b45ba2a589834 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 @@ -138,7 +138,7 @@ bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDev } template <> -bool ProductHelperHw::isTlbFlushRequired(const HardwareInfo &hwInfo, bool precondition) const { +bool ProductHelperHw::isTlbFlushRequired() const { bool tlbFlushRequired = false; if (debugManager.flags.ForceTlbFlush.get() != -1) { tlbFlushRequired = !!debugManager.flags.ForceTlbFlush.get(); diff --git a/shared/source/xe_hpg_core/linux/product_helper_dg2.cpp b/shared/source/xe_hpg_core/linux/product_helper_dg2.cpp index ef9a38e9245eb..59ae1fe90277f 100644 --- a/shared/source/xe_hpg_core/linux/product_helper_dg2.cpp +++ b/shared/source/xe_hpg_core/linux/product_helper_dg2.cpp @@ -46,15 +46,6 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O return 0; } -template <> -bool ProductHelperHw::isTlbFlushRequired(const HardwareInfo &hwInfo, bool precondition) const { - bool tlbFlushRequired = !DG2::isG10(hwInfo) && precondition; - if (debugManager.flags.ForceTlbFlush.get() != -1) { - tlbFlushRequired = !!debugManager.flags.ForceTlbFlush.get(); - } - return tlbFlushRequired; -} - template <> bool ProductHelperHw::getUuid(NEO::DriverModel *driverModel, const uint32_t subDeviceCount, const uint32_t deviceIndex, std::array &uuid) const { if (driverModel->getDriverModelType() != DriverModelType::drm) { diff --git a/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp index a56c64793347d..530a75a216102 100644 --- a/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp @@ -140,15 +140,6 @@ TEST_F(DrmBufferObjectTest, whenExecFailsThenValidateHostPtrFails) { EXPECT_EQ(EINVAL, ret); } -TEST_F(DrmBufferObjectTest, whenSetImageAllocTypeForBOThenReturnProperValue) { - TestedBufferObject bo(0u, this->mock.get()); - EXPECT_FALSE(bo.isImage()); - bo.setIsImage(AllocationType::kernelIsa); - EXPECT_FALSE(bo.isImage()); - bo.setIsImage(AllocationType::image); - EXPECT_TRUE(bo.isImage()); -} - TEST_F(DrmBufferObjectTest, givenResidentBOWhenPrintExecutionBufferIsSetToTrueThenDebugInformationAboutBOIsPrinted) { mock->ioctlExpected.total = 1; DebugManagerStateRestore restore; 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 5bea7960b65ac..2ce4a6120cdcd 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 @@ -131,7 +131,7 @@ TEST_F(DrmMemoryOperationsHandlerBindMultiRootDeviceTest, whenSetNewResourceBoun for (const auto &engine : device->getAllEngines()) { auto osContexLinux = static_cast(engine.osContext); - if (osContexLinux->getDeviceBitfield().test(1u) && executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]->getProductHelper().isTlbFlushRequired(*executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]->getHardwareInfo(), true)) { + if (osContexLinux->getDeviceBitfield().test(1u) && executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]->getProductHelper().isTlbFlushRequired()) { EXPECT_TRUE(osContexLinux->isTlbFlushRequired()); } else { EXPECT_FALSE(osContexLinux->isTlbFlushRequired()); @@ -150,7 +150,7 @@ TEST_F(DrmMemoryOperationsHandlerBindMultiRootDeviceTest, whenSetNewResourceBoun for (const auto &engine : devices[1]->getAllEngines()) { auto osContexLinux = static_cast(engine.osContext); - if (osContexLinux->getDeviceBitfield().test(0u) && executionEnvironment->rootDeviceEnvironments[1]->getProductHelper().isTlbFlushRequired(*executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]->getHardwareInfo(), true)) { + if (osContexLinux->getDeviceBitfield().test(0u) && executionEnvironment->rootDeviceEnvironments[1]->getProductHelper().isTlbFlushRequired()) { EXPECT_TRUE(osContexLinux->isTlbFlushRequired()); } else { EXPECT_FALSE(osContexLinux->isTlbFlushRequired()); @@ -168,7 +168,7 @@ TEST_F(DrmMemoryOperationsHandlerBindMultiRootDeviceTest, whenSetNewResourceBoun for (const auto &engine : device->getAllEngines()) { auto osContexLinux = static_cast(engine.osContext); - if (osContexLinux->getDeviceBitfield().test(1u) && executionEnvironment->rootDeviceEnvironments[1]->getProductHelper().isTlbFlushRequired(*executionEnvironment->rootDeviceEnvironments[device->getRootDeviceIndex()]->getHardwareInfo(), true)) { + if (osContexLinux->getDeviceBitfield().test(1u) && executionEnvironment->rootDeviceEnvironments[1]->getProductHelper().isTlbFlushRequired()) { EXPECT_TRUE(osContexLinux->isTlbFlushRequired()); } else { EXPECT_FALSE(osContexLinux->isTlbFlushRequired()); 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 dca86a526be35..8c612625cde05 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -455,15 +455,13 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfIsTimestampWaitSupport } HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfIsTlbFlushRequiredThenTrueIsReturned, IsNotXeHpgOrXeHpcCore) { - EXPECT_TRUE(productHelper->isTlbFlushRequired(pInHwInfo, false)); - EXPECT_TRUE(productHelper->isTlbFlushRequired(pInHwInfo, true)); + EXPECT_TRUE(productHelper->isTlbFlushRequired()); } HWTEST2_F(ProductHelperTest, givenProductHelperAndForceTlbFlushNotSetWhenAskedIfIsTlbFlushRequiredThenFalseIsReturned, IsNotPVC) { DebugManagerStateRestore restore{}; debugManager.flags.ForceTlbFlush.set(0); - EXPECT_FALSE(productHelper->isTlbFlushRequired(pInHwInfo, true)); - EXPECT_FALSE(productHelper->isTlbFlushRequired(pInHwInfo, false)); + EXPECT_FALSE(productHelper->isTlbFlushRequired()); } HWTEST_F(ProductHelperTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { diff --git a/shared/test/unit_test/os_interface/windows/wddm_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_tests.cpp index 337a9bdb22ede..4bc4ad56419b1 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_tests.cpp @@ -169,7 +169,7 @@ TEST(WddmNewRsourceTest, whenSetNewResourcesBoundToPageTableThenSetInContextFrom } engines = executionEnvironment.memoryManager->getRegisteredEngines(1); for (const auto &engine : engines) { - EXPECT_EQ(engine.osContext->peekTlbFlushCounter(), executionEnvironment.rootDeviceEnvironments[1]->getProductHelper().isTlbFlushRequired(*defaultHwInfo, true)); + EXPECT_EQ(engine.osContext->peekTlbFlushCounter(), executionEnvironment.rootDeviceEnvironments[1]->getProductHelper().isTlbFlushRequired()); } executionEnvironment.memoryManager->unregisterEngineForCsr(csr1.get()); diff --git a/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp index 2cee3aae06b97..7d69f03593311 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp @@ -30,15 +30,13 @@ PVCTEST_F(PvcProductHelper, whenGettingAubstreamProductFamilyThenProperEnumValue } PVCTEST_F(PvcProductHelper, whenCheckIsTlbFlushRequiredThenReturnProperValue) { - EXPECT_FALSE(productHelper->isTlbFlushRequired(*defaultHwInfo, true)); - EXPECT_FALSE(productHelper->isTlbFlushRequired(*defaultHwInfo, false)); + EXPECT_FALSE(productHelper->isTlbFlushRequired()); } PVCTEST_F(PvcProductHelper, whenForceTlbFlushSetAndCheckIsTlbFlushRequiredThenReturnProperValue) { DebugManagerStateRestore restore; debugManager.flags.ForceTlbFlush.set(1); - EXPECT_TRUE(productHelper->isTlbFlushRequired(*defaultHwInfo, false)); - EXPECT_TRUE(productHelper->isTlbFlushRequired(*defaultHwInfo, true)); + EXPECT_TRUE(productHelper->isTlbFlushRequired()); } PVCTEST_F(PvcProductHelper, givenPVCRevId3AndAboveWhenGettingThreadEuRatioForScratchThen16IsReturned) { diff --git a/shared/test/unit_test/xe_hpg_core/dg2/linux/product_helper_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/linux/product_helper_tests_dg2.cpp index ca6ad009a6780..b56153717ad98 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/linux/product_helper_tests_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/linux/product_helper_tests_dg2.cpp @@ -6,9 +6,7 @@ */ #include "shared/source/os_interface/os_interface.h" -#include "shared/source/xe_hpg_core/hw_cmds_dg2.h" #include "shared/source/xe_hpg_core/hw_info_xe_hpg_core.h" -#include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/gtest_helpers.h" #include "shared/test/common/libult/linux/drm_mock.h" @@ -45,18 +43,3 @@ DG2TEST_F(Dg2ProductHelperLinux, GivenDg2WhenConfigureHardwareCustomThenKmdNotif EXPECT_TRUE(pInHwInfo.capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission); EXPECT_EQ(20ll, pInHwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds); } - -DG2TEST_F(Dg2ProductHelperLinux, whenCheckIsTlbFlushRequiredThenReturnProperValue) { - EXPECT_EQ(productHelper->isTlbFlushRequired(pInHwInfo, true), !DG2::isG10(pInHwInfo)); - EXPECT_FALSE(productHelper->isTlbFlushRequired(pInHwInfo, false)); -} - -DG2TEST_F(Dg2ProductHelperLinux, whenForceTlbFlushSetAndCheckIsTlbFlushRequiredThenReturnProperValue) { - DebugManagerStateRestore restore; - debugManager.flags.ForceTlbFlush.set(1); - EXPECT_TRUE(productHelper->isTlbFlushRequired(pInHwInfo, false)); - EXPECT_TRUE(productHelper->isTlbFlushRequired(pInHwInfo, true)); - debugManager.flags.ForceTlbFlush.set(0); - EXPECT_FALSE(productHelper->isTlbFlushRequired(pInHwInfo, false)); - EXPECT_FALSE(productHelper->isTlbFlushRequired(pInHwInfo, true)); -} \ No newline at end of file diff --git a/shared/test/unit_test/xe_hpg_core/mtl/windows/product_helper_tests_mtl_windows.cpp b/shared/test/unit_test/xe_hpg_core/mtl/windows/product_helper_tests_mtl_windows.cpp index dfbe2fe388c5c..3cb437d01aa05 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/windows/product_helper_tests_mtl_windows.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/windows/product_helper_tests_mtl_windows.cpp @@ -14,7 +14,7 @@ using namespace NEO; using MtlProductHelperWindows = ProductHelperTestWindows; MTLTEST_F(MtlProductHelperWindows, whenCheckIsTlbFlushRequiredThenReturnProperValue) { - EXPECT_TRUE(productHelper->isTlbFlushRequired(pInHwInfo, false)); + EXPECT_TRUE(productHelper->isTlbFlushRequired()); } MTLTEST_F(MtlProductHelperWindows, whenCheckingIsTimestampWaitSupportedForEventsThenReturnTrue) {