From ed813def70113eb9f3561755b6285f4dbe512cdf Mon Sep 17 00:00:00 2001 From: Lukasz Jobczyk Date: Mon, 23 Dec 2024 17:01:58 +0000 Subject: [PATCH] performance: Always allocate by KMD on Xe2 Related-To: NEO-13441 Signed-off-by: Lukasz Jobczyk --- .../xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl | 8 +------- .../xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl | 8 +------- .../xe2_hpg_core/bmg/product_helper_tests_bmg.cpp | 9 ++------- .../xe2_hpg_core/lnl/product_helper_tests_lnl.cpp | 9 ++------- 4 files changed, 6 insertions(+), 28 deletions(-) diff --git a/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl b/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl index 0f494829c1..36f8eb279e 100644 --- a/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl +++ b/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl @@ -32,13 +32,7 @@ std::optional ProductHelperHw::getAubStre template <> std::optional ProductHelperHw::getPreferredAllocationMethod(AllocationType allocationType) const { - switch (allocationType) { - case AllocationType::tagBuffer: - case AllocationType::timestampPacketTagBuffer: - return {}; - default: - return GfxMemoryAllocationMethod::allocateByKmd; - } + return GfxMemoryAllocationMethod::allocateByKmd; } template <> diff --git a/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl b/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl index 8ac7d0836f..6f56c53215 100644 --- a/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl +++ b/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl @@ -32,13 +32,7 @@ std::optional ProductHelperHw::getAubStre template <> std::optional ProductHelperHw::getPreferredAllocationMethod(AllocationType allocationType) const { - switch (allocationType) { - case AllocationType::tagBuffer: - case AllocationType::timestampPacketTagBuffer: - return this->isDcFlushMitigated() ? std::optional(GfxMemoryAllocationMethod::allocateByKmd) : std::nullopt; - default: - return GfxMemoryAllocationMethod::allocateByKmd; - } + return GfxMemoryAllocationMethod::allocateByKmd; } template <> diff --git a/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp b/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp index a40c8166a5..8b9e06ae67 100644 --- a/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp +++ b/shared/test/unit_test/xe2_hpg_core/bmg/product_helper_tests_bmg.cpp @@ -73,13 +73,8 @@ BMGTEST_F(BmgProductHelper, whenCheckPreferredAllocationMethodThenAllocateByKmdI for (auto i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); auto preferredAllocationMethod = productHelper->getPreferredAllocationMethod(allocationType); - if (allocationType == AllocationType::tagBuffer || - allocationType == AllocationType::timestampPacketTagBuffer) { - EXPECT_FALSE(preferredAllocationMethod.has_value()); - } else { - EXPECT_TRUE(preferredAllocationMethod.has_value()); - EXPECT_EQ(GfxMemoryAllocationMethod::allocateByKmd, preferredAllocationMethod.value()); - } + EXPECT_TRUE(preferredAllocationMethod.has_value()); + EXPECT_EQ(GfxMemoryAllocationMethod::allocateByKmd, preferredAllocationMethod.value()); } } diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp index 2b78993bdf..a5cb1a76d5 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp @@ -97,13 +97,8 @@ LNLTEST_F(LnlProductHelper, whenCheckPreferredAllocationMethodThenAllocateByKmdI for (auto i = 0; i < static_cast(AllocationType::count); ++i) { auto allocationType = static_cast(i); auto preferredAllocationMethod = productHelper->getPreferredAllocationMethod(allocationType); - if (allocationType == AllocationType::tagBuffer || - allocationType == AllocationType::timestampPacketTagBuffer) { - EXPECT_FALSE(preferredAllocationMethod.has_value()); - } else { - EXPECT_TRUE(preferredAllocationMethod.has_value()); - EXPECT_EQ(GfxMemoryAllocationMethod::allocateByKmd, preferredAllocationMethod.value()); - } + EXPECT_TRUE(preferredAllocationMethod.has_value()); + EXPECT_EQ(GfxMemoryAllocationMethod::allocateByKmd, preferredAllocationMethod.value()); } debugManager.flags.AllowDcFlush.set(0); for (auto i = 0; i < static_cast(AllocationType::count); ++i) {