diff --git a/opencl/test/unit_test/context/driver_diagnostics_tests.h b/opencl/test/unit_test/context/driver_diagnostics_tests.h index 143815ad90..ab400797fe 100644 --- a/opencl/test/unit_test/context/driver_diagnostics_tests.h +++ b/opencl/test/unit_test/context/driver_diagnostics_tests.h @@ -212,6 +212,9 @@ struct PerformanceHintEnqueueMapTest : public PerformanceHintEnqueueTest, void SetUp() override { PerformanceHintEnqueueTest::SetUp(); + if (context->getDevice(0)->getRootDeviceEnvironment().getProductHelper().isDcFlushMitigated()) { + GTEST_SKIP(); + } } void TearDown() override { diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index c1c69858fa..18b7f8030c 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -131,6 +131,7 @@ class ProductHelper { virtual bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isDcFlushAllowed() const = 0; virtual bool isDcFlushMitigated() const = 0; + virtual bool mitigateDcFlush() const = 0; virtual bool overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const = 0; virtual bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const = 0; virtual uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index 81f7b5aede..421d15424b 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -394,7 +394,7 @@ bool ProductHelperHw::isDisableScratchPagesSupported() const { template bool ProductHelperHw::isDcFlushAllowed() const { using GfxProduct = typename HwMapper::GfxProduct; - bool dcFlushAllowed = GfxProduct::isDcFlushAllowed; + bool dcFlushAllowed = GfxProduct::isDcFlushAllowed && !this->mitigateDcFlush(); if (debugManager.flags.AllowDcFlush.get() != -1) { dcFlushAllowed = debugManager.flags.AllowDcFlush.get(); @@ -403,6 +403,11 @@ bool ProductHelperHw::isDcFlushAllowed() const { return dcFlushAllowed; } +template +bool ProductHelperHw::mitigateDcFlush() const { + return false; +} + template bool ProductHelperHw::isDcFlushMitigated() const { using GfxProduct = typename HwMapper::GfxProduct; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 407390cb81..2a772c745a 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -76,6 +76,7 @@ class ProductHelperHw : public ProductHelper { bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const override; bool isDcFlushAllowed() const override; bool isDcFlushMitigated() const override; + bool mitigateDcFlush() const override; bool overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const override; bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const override; uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const override; diff --git a/shared/test/common/mocks/mock_product_helper.cpp b/shared/test/common/mocks/mock_product_helper.cpp index 8630add1dd..c5b988214d 100644 --- a/shared/test/common/mocks/mock_product_helper.cpp +++ b/shared/test/common/mocks/mock_product_helper.cpp @@ -281,6 +281,11 @@ bool ProductHelperHw::isDcFlushMitigated() const { return false; } +template <> +bool ProductHelperHw::mitigateDcFlush() const { + return false; +} + template <> bool ProductHelperHw::overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const { return false; 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 6003873725..1117ded1bf 100644 --- a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -682,6 +682,11 @@ TEST(GmmTest, givenHwInfoWhenDeviceIsCreatedThenSetThisHwInfoToGmmHelper) { TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) { MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + + if (productHelper.isDcFlushMitigated()) { + GTEST_SKIP(); + } + 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; @@ -876,6 +881,10 @@ TEST(GmmTest, givenUncachedDebugFlagMaskSetWhenAskingForUsageTypeThenReturnUncac MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + if (productHelper.isDcFlushMitigated()) { + GTEST_SKIP(); + } + constexpr int64_t bufferMask = 1 << (static_cast(AllocationType::buffer) - 1); constexpr int64_t imageMask = 1 << (static_cast(AllocationType::image) - 1); 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 d7c3b28840..873efedff5 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -311,9 +311,11 @@ HWTEST_F(ProductHelperTest, givenVariousValuesWhenGettingAubStreamSteppingFromHw HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatAndUsageForDcFlushMitigationThenReturnCorrectValue) { DebugManagerStateRestore restorer; - for (auto i = 0; i < static_cast(AllocationType::count); ++i) { - auto allocationType = static_cast(i); - EXPECT_FALSE(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType)); + if (!productHelper->isDcFlushMitigated()) { + for (auto i = 0; i < static_cast(AllocationType::count); ++i) { + auto allocationType = static_cast(i); + EXPECT_FALSE(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType)); + } } debugManager.flags.AllowDcFlush.set(0); for (auto i = 0; i < static_cast(AllocationType::count); ++i) {