Revert "fix: Remove UC PAT override for shared images on BMG"

This reverts commit 4d31ec72fd.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation 2024-08-22 03:53:37 +02:00 committed by Compute-Runtime-Automation
parent d8ea5516b2
commit df33eda6e8
2 changed files with 34 additions and 0 deletions

View File

@ -41,5 +41,14 @@ bool ProductHelperHw<gfxProduct>::isStagingBuffersEnabled() const {
return true;
}
template <>
uint64_t ProductHelperHw<gfxProduct>::overridePatIndex(bool isUncachedType, uint64_t patIndex, AllocationType allocationType) const {
if (allocationType == AllocationType::sharedImage && patIndex == 8u && debugManager.flags.OverrideUncachedSharedImages.get()) { // L3: UC
return 13; // L3, L4: WB, Non coh
}
return patIndex;
}
template class ProductHelperHw<gfxProduct>;
} // namespace NEO

View File

@ -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"
@ -25,3 +26,27 @@ BMGTEST_F(BmgProductHelperWindows, givenProductHelperWhenCheckDirectSubmissionSu
BMGTEST_F(BmgProductHelperWindows, givenProductHelperWhenIsStagingBuffersEnabledThenTrueIsReturned) {
EXPECT_TRUE(productHelper->isStagingBuffersEnabled());
}
BMGTEST_F(BmgProductHelperWindows, givenProductHelperWhenOverridePatIndexCalledThenCorrectValueIsReturned) {
DebugManagerStateRestore restorer;
uint64_t expectedPatIndex = 2u;
for (int i = 0; i < static_cast<int>(AllocationType::count); ++i) {
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, static_cast<AllocationType>(i)));
}
expectedPatIndex = 8u;
for (int i = 0; i < static_cast<int>(AllocationType::count); ++i) {
if (static_cast<AllocationType>(i) == AllocationType::sharedImage) {
EXPECT_EQ(13u, productHelper->overridePatIndex(0u, expectedPatIndex, static_cast<AllocationType>(i)));
} else {
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, static_cast<AllocationType>(i)));
}
}
debugManager.flags.OverrideUncachedSharedImages.set(0);
for (int i = 0; i < static_cast<int>(AllocationType::count); ++i) {
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, static_cast<AllocationType>(i)));
}
}