diff --git a/shared/source/xe2_hpg_core/windows/product_helper_bmg.cpp b/shared/source/xe2_hpg_core/windows/product_helper_bmg.cpp index ed98ef3fe1..d1bbaf0bcf 100644 --- a/shared/source/xe2_hpg_core/windows/product_helper_bmg.cpp +++ b/shared/source/xe2_hpg_core/windows/product_helper_bmg.cpp @@ -41,5 +41,14 @@ bool ProductHelperHw::isStagingBuffersEnabled() const { return true; } +template <> +uint64_t ProductHelperHw::overridePatIndex(bool isUncachedType, uint64_t patIndex, AllocationType allocationType) const { + if (allocationType == AllocationType::sharedImage && patIndex == 8u) { // L3: UC + return 13; // L3, L4: WB, Non coh + } + + return patIndex; +} + template class ProductHelperHw; } // namespace NEO diff --git a/shared/test/unit_test/xe2_hpg_core/bmg/windows/product_helper_tests_bmg_windows.cpp b/shared/test/unit_test/xe2_hpg_core/bmg/windows/product_helper_tests_bmg_windows.cpp index 21380cf441..22705df562 100644 --- a/shared/test/unit_test/xe2_hpg_core/bmg/windows/product_helper_tests_bmg_windows.cpp +++ b/shared/test/unit_test/xe2_hpg_core/bmg/windows/product_helper_tests_bmg_windows.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/memory_manager/allocation_type.h" #include "shared/source/os_interface/product_helper.h" #include "shared/source/xe2_hpg_core/hw_cmds_bmg.h" #include "shared/source/xe2_hpg_core/hw_info_xe2_hpg_core.h" @@ -24,3 +25,19 @@ BMGTEST_F(BmgProductHelperWindows, givenProductHelperWhenCheckDirectSubmissionSu BMGTEST_F(BmgProductHelperWindows, givenProductHelperWhenIsStagingBuffersEnabledThenTrueIsReturned) { EXPECT_TRUE(productHelper->isStagingBuffersEnabled()); } + +BMGTEST_F(BmgProductHelperWindows, givenProductHelperWhenOverridePatIndexCalledThenCorrectValueIsReturned) { + uint64_t expectedPatIndex = 2u; + for (int i = 0; i < static_cast(AllocationType::count); ++i) { + EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, static_cast(i))); + } + + expectedPatIndex = 8u; + for (int i = 0; i < static_cast(AllocationType::count); ++i) { + if (static_cast(i) == AllocationType::sharedImage) { + EXPECT_EQ(13u, productHelper->overridePatIndex(0u, expectedPatIndex, static_cast(i))); + } else { + EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, static_cast(i))); + } + } +} \ No newline at end of file