From df0789714411e85e0675513491adc890455aae75 Mon Sep 17 00:00:00 2001 From: Jaroslaw Warchulski Date: Fri, 4 Apr 2025 10:15:35 +0000 Subject: [PATCH] fix: forbid compression for pre-xe2 platforms Related-To: NEO-9465 Signed-off-by: Jaroslaw Warchulski --- shared/source/gen12lp/linux/product_helper_adlp.cpp | 5 ----- shared/source/gen12lp/linux/product_helper_dg1.cpp | 5 ----- shared/source/gen12lp/linux/product_helper_rkl.cpp | 5 ----- shared/source/gen12lp/linux/product_helper_tgllp.cpp | 5 ----- shared/source/os_interface/product_helper.inl | 5 ----- .../source/os_interface/product_helper_before_xe2.inl | 5 +++++ .../os_interface/product_helper_xe2_and_later.inl | 5 +++++ .../xe_lpg/linux/product_helper_xe_lpg_linux.inl | 5 ----- .../unit_test/os_interface/product_helper_tests.cpp | 10 ++++++++++ .../xe_hpg_core/arl/linux/product_helper_tests_arl.cpp | 5 ----- .../mtl/linux/product_helper_tests_mtl_linux.cpp | 5 ----- 11 files changed, 20 insertions(+), 40 deletions(-) diff --git a/shared/source/gen12lp/linux/product_helper_adlp.cpp b/shared/source/gen12lp/linux/product_helper_adlp.cpp index 68f0b158b7..a8c13b45ee 100644 --- a/shared/source/gen12lp/linux/product_helper_adlp.cpp +++ b/shared/source/gen12lp/linux/product_helper_adlp.cpp @@ -26,10 +26,5 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O return 0; } -template <> -bool ProductHelperHw::isCompressionForbidden(const HardwareInfo &hwInfo) const { - return isCompressionForbiddenCommon(true); -} - template class ProductHelperHw; } // namespace NEO diff --git a/shared/source/gen12lp/linux/product_helper_dg1.cpp b/shared/source/gen12lp/linux/product_helper_dg1.cpp index bf9aac897d..a1ad56843e 100644 --- a/shared/source/gen12lp/linux/product_helper_dg1.cpp +++ b/shared/source/gen12lp/linux/product_helper_dg1.cpp @@ -29,10 +29,5 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O return 0; } -template <> -bool ProductHelperHw::isCompressionForbidden(const HardwareInfo &hwInfo) const { - return isCompressionForbiddenCommon(true); -} - template class ProductHelperHw; } // namespace NEO diff --git a/shared/source/gen12lp/linux/product_helper_rkl.cpp b/shared/source/gen12lp/linux/product_helper_rkl.cpp index 2082429362..5decbdc271 100644 --- a/shared/source/gen12lp/linux/product_helper_rkl.cpp +++ b/shared/source/gen12lp/linux/product_helper_rkl.cpp @@ -26,10 +26,5 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O return 0; } -template <> -bool ProductHelperHw::isCompressionForbidden(const HardwareInfo &hwInfo) const { - return isCompressionForbiddenCommon(true); -} - template class ProductHelperHw; } // namespace NEO diff --git a/shared/source/gen12lp/linux/product_helper_tgllp.cpp b/shared/source/gen12lp/linux/product_helper_tgllp.cpp index 0f3bb04cef..0ee3763b38 100644 --- a/shared/source/gen12lp/linux/product_helper_tgllp.cpp +++ b/shared/source/gen12lp/linux/product_helper_tgllp.cpp @@ -26,10 +26,5 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O return 0; } -template <> -bool ProductHelperHw::isCompressionForbidden(const HardwareInfo &hwInfo) const { - return isCompressionForbiddenCommon(true); -} - template class ProductHelperHw; } // namespace NEO diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index d62dcb92be..096447beb8 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -1116,9 +1116,4 @@ bool ProductHelperHw::isCompressionForbiddenCommon(bool defaultValue } } -template -bool ProductHelperHw::isCompressionForbidden(const HardwareInfo &hwInfo) const { - return isCompressionForbiddenCommon(false); -} - } // namespace NEO diff --git a/shared/source/os_interface/product_helper_before_xe2.inl b/shared/source/os_interface/product_helper_before_xe2.inl index c0ae60b918..f1b03967b9 100644 --- a/shared/source/os_interface/product_helper_before_xe2.inl +++ b/shared/source/os_interface/product_helper_before_xe2.inl @@ -40,4 +40,9 @@ void ProductHelperHw::setRenderCompressedFlags(HardwareInfo &hwInfo) hwInfo.capabilityTable.ftrRenderCompressedBuffers = hwInfo.featureTable.flags.ftrE2ECompression; } +template +bool ProductHelperHw::isCompressionForbidden(const HardwareInfo &hwInfo) const { + return isCompressionForbiddenCommon(true); +} + } // namespace NEO diff --git a/shared/source/os_interface/product_helper_xe2_and_later.inl b/shared/source/os_interface/product_helper_xe2_and_later.inl index 4f4e92e1ad..b3fa3b0e3a 100644 --- a/shared/source/os_interface/product_helper_xe2_and_later.inl +++ b/shared/source/os_interface/product_helper_xe2_and_later.inl @@ -44,4 +44,9 @@ void ProductHelperHw::setRenderCompressedFlags(HardwareInfo &hwInfo) hwInfo.capabilityTable.ftrRenderCompressedBuffers = hwInfo.featureTable.flags.ftrXe2Compression; } +template +bool ProductHelperHw::isCompressionForbidden(const HardwareInfo &hwInfo) const { + return isCompressionForbiddenCommon(false); +} + } // namespace NEO diff --git a/shared/source/xe_hpg_core/xe_lpg/linux/product_helper_xe_lpg_linux.inl b/shared/source/xe_hpg_core/xe_lpg/linux/product_helper_xe_lpg_linux.inl index d3b65819ec..7e6b378bc4 100644 --- a/shared/source/xe_hpg_core/xe_lpg/linux/product_helper_xe_lpg_linux.inl +++ b/shared/source/xe_hpg_core/xe_lpg/linux/product_helper_xe_lpg_linux.inl @@ -49,9 +49,4 @@ bool ProductHelperHw::useGemCreateExtInAllocateMemoryByKMD() const { return true; } -template <> -bool ProductHelperHw::isCompressionForbidden(const HardwareInfo &hwInfo) const { - return isCompressionForbiddenCommon(true); -} - } // namespace NEO 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 dee94a9e4b..6947b3181a 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -1159,3 +1159,13 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenCheckingIsCompressionForbidden debugManager.flags.RenderCompressedImagesEnabled.set(1); EXPECT_FALSE(productHelper->isCompressionForbidden(hwInfo)); } + +HWTEST2_F(ProductHelperTest, givenProductHelperThenCompressionIsForbidden, IsBeforeXe2HpgCore) { + auto hwInfo = *defaultHwInfo; + EXPECT_TRUE(productHelper->isCompressionForbidden(hwInfo)); +} + +HWTEST2_F(ProductHelperTest, givenProductHelperThenCompressionIsNotForbidden, IsAtLeastXe2HpgCore) { + auto hwInfo = *defaultHwInfo; + EXPECT_FALSE(productHelper->isCompressionForbidden(hwInfo)); +} diff --git a/shared/test/unit_test/xe_hpg_core/arl/linux/product_helper_tests_arl.cpp b/shared/test/unit_test/xe_hpg_core/arl/linux/product_helper_tests_arl.cpp index c2a1cf0afa..64007461ce 100644 --- a/shared/test/unit_test/xe_hpg_core/arl/linux/product_helper_tests_arl.cpp +++ b/shared/test/unit_test/xe_hpg_core/arl/linux/product_helper_tests_arl.cpp @@ -98,8 +98,3 @@ ARLTEST_F(ArlProductHelperLinux, givenBooleanUncachedWhenCallOverridePatIndexThe EXPECT_EQ(0u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::buffer)); EXPECT_EQ(3u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::commandBuffer)); } - -ARLTEST_F(ArlProductHelperLinux, givenProductHelperThenCompressionIsNotAllowed) { - auto hwInfo = *defaultHwInfo; - EXPECT_TRUE(productHelper->isCompressionForbidden(hwInfo)); -} diff --git a/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl_linux.cpp b/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl_linux.cpp index 1e76d47ee7..2ed9db2bad 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl_linux.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/linux/product_helper_tests_mtl_linux.cpp @@ -73,8 +73,3 @@ MTLTEST_F(MtlProductHelperLinux, givenBooleanUncachedWhenCallOverridePatIndexThe EXPECT_EQ(0u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::buffer)); EXPECT_EQ(3u, productHelper->overridePatIndex(isUncached, patIndex, AllocationType::commandBuffer)); } - -MTLTEST_F(MtlProductHelperLinux, givenProductHelperThenCompressionIsNotAllowed) { - auto hwInfo = *defaultHwInfo; - EXPECT_TRUE(productHelper->isCompressionForbidden(hwInfo)); -}