From 5794ee810010fa77036f3a292e8b8f459fe0c719 Mon Sep 17 00:00:00 2001 From: Lukasz Jobczyk Date: Wed, 19 Jun 2024 09:25:33 +0000 Subject: [PATCH] fix: Add printf surface to dc flush mitigation logic Related-To: NEO-10556 Signed-off-by: Lukasz Jobczyk --- shared/source/os_interface/product_helper.inl | 3 ++- shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp | 1 + shared/test/unit_test/os_interface/product_helper_tests.cpp | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index 13918db696..70a2894ecb 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -429,7 +429,8 @@ bool ProductHelperHw::overrideCacheableForDcFlushMitigation(Allocati allocationType == AllocationType::svmZeroCopy || allocationType == AllocationType::internalHostMemory || allocationType == AllocationType::internalHeap || - allocationType == AllocationType::linearStream); + allocationType == AllocationType::linearStream || + allocationType == AllocationType::printfSurface); } template 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 b2d9679deb..abbd3e9739 100644 --- a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -750,6 +750,7 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu case AllocationType::gpuTimestampDeviceBuffer: case AllocationType::bufferHostMemory: case AllocationType::tagBuffer: + case AllocationType::printfSurface: expectedUsage = uncachedGmmUsageType; break; 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 d3e7ccba02..460d500876 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -328,7 +328,8 @@ HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatAndUsageForDcFl allocationType == AllocationType::tagBuffer || allocationType == AllocationType::gpuTimestampDeviceBuffer || allocationType == AllocationType::linearStream || - allocationType == AllocationType::internalHeap) { + allocationType == AllocationType::internalHeap || + allocationType == AllocationType::printfSurface) { EXPECT_EQ(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType), productHelper->isDcFlushMitigated()); } else { EXPECT_FALSE(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType));