diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 853a6995ed..bcd0dd96eb 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -878,11 +878,6 @@ HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForTilingSupportThenReturnValidVal } } -HWTEST_F(HwHelperTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned) { - auto &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily); - EXPECT_TRUE(hwHelper.allowRenderCompression(hardwareInfo)); -} - HWTEST_F(HwHelperTest, WhenAllowStatelessCompressionIsCalledThenReturnCorrectValue) { DebugManagerStateRestore restore; diff --git a/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp b/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp index 539cf96efe..ff81f2ec90 100644 --- a/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp +++ b/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp @@ -220,3 +220,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HwInfoConfigTest, givenHwInfoConfigWhenAdditionalKer const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); EXPECT_FALSE(hwInfoConfig.isDisableOverdispatchAvailable(pInHwInfo)); } + +HWTEST_F(HwInfoConfigTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned) { + const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); + EXPECT_TRUE(hwInfoConfig.allowRenderCompression(pInHwInfo)); +} diff --git a/opencl/test/unit_test/xe_hp_core/excludes_xe_hp_core.cpp b/opencl/test/unit_test/xe_hp_core/excludes_xe_hp_core.cpp index bc2b55a6db..e32248e5ac 100644 --- a/opencl/test/unit_test/xe_hp_core/excludes_xe_hp_core.cpp +++ b/opencl/test/unit_test/xe_hp_core/excludes_xe_hp_core.cpp @@ -9,6 +9,6 @@ HWTEST_EXCLUDE_PRODUCT(BufferSetSurfaceTests, givenAlignedCacheableReadOnlyBufferThenChoseOclBufferPolicy, IGFX_XE_HP_CORE); HWTEST_EXCLUDE_PRODUCT(BufferSetSurfaceTests, givenBufferSetSurfaceThatMemoryIsUnalignedToCachelineButReadOnlyThenL3CacheShouldBeStillOn, IGFX_XE_HP_CORE); -HWTEST_EXCLUDE_PRODUCT(HwHelperTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned, IGFX_XE_HP_CORE); +HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned, IGFX_XE_HP_CORE); HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHardwareInfoWhenCallingIsMaxThreadsForWorkgroupWARequiredThenFalseIsReturned, IGFX_XE_HP_CORE); HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenCallingGetDeviceMemoryNameThenDdrIsReturned, IGFX_XE_HP_CORE); diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl index fd89c22908..7bed180286 100644 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl +++ b/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl @@ -77,14 +77,14 @@ XEHPTEST_F(XeHPHwInfoConfig, givenXeHpWhenCallingGetDeviceMemoryNameThenHbmIsRet using XeHPHwHelperTest = HwHelperTest; XEHPTEST_F(XeHPHwHelperTest, givenXeHPMultiConfigWhenAllowRenderCompressionIsCalledThenCorrectValueIsReturned) { - auto &helper = HwHelper::get(renderCoreFamily); + auto hwInfoConfig = HwInfoConfig::get(productFamily); HardwareInfo hwInfo = *defaultHwInfo; hwInfo.gtSystemInfo.EUCount = 512u; - EXPECT_TRUE(helper.allowRenderCompression(hwInfo)); + EXPECT_TRUE(hwInfoConfig->allowRenderCompression(hwInfo)); hwInfo.gtSystemInfo.EUCount = 256u; - EXPECT_FALSE(helper.allowRenderCompression(hwInfo)); + EXPECT_FALSE(hwInfoConfig->allowRenderCompression(hwInfo)); } XEHPTEST_F(XeHPHwInfoConfig, givenHwInfoConfigWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index 2c36896745..3f80789730 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -67,7 +67,6 @@ class HwHelper { virtual bool preferSmallWorkgroupSizeForKernel(const size_t size, const HardwareInfo &hwInfo) const = 0; virtual bool isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const = 0; virtual bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) = 0; - virtual bool allowRenderCompression(const HardwareInfo &hwInfo) const = 0; virtual bool allowStatelessCompression(const HardwareInfo &hwInfo) const = 0; virtual bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const = 0; virtual LocalMemoryAccessMode getLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0; @@ -313,8 +312,6 @@ class HwHelperHw : public HwHelper { void setExtraAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const HardwareInfo &hwInfo) const override; - bool allowRenderCompression(const HardwareInfo &hwInfo) const override; - bool allowStatelessCompression(const HardwareInfo &hwInfo) const override; bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const override; diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 02f4af3ca7..1020975eb6 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -413,11 +413,6 @@ inline bool HwHelperHw::isSpecialWorkgroupSizeRequired(const Hardware return false; } -template -inline bool HwHelperHw::allowRenderCompression(const HardwareInfo &hwInfo) const { - return true; -} - template inline bool HwHelperHw::allowStatelessCompression(const HardwareInfo &hwInfo) const { if (DebugManager.flags.EnableStatelessCompression.get() != -1) { diff --git a/shared/source/os_interface/hw_info_config.h b/shared/source/os_interface/hw_info_config.h index 064bf5eea8..f8f0852b88 100644 --- a/shared/source/os_interface/hw_info_config.h +++ b/shared/source/os_interface/hw_info_config.h @@ -54,6 +54,7 @@ class HwInfoConfig { virtual bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const = 0; virtual std::string getDeviceMemoryName() const = 0; virtual bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const = 0; + virtual bool allowRenderCompression(const HardwareInfo &hwInfo) const = 0; uint32_t threadsPerEu; }; @@ -90,6 +91,7 @@ class HwInfoConfigHw : public HwInfoConfig { bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const override; std::string getDeviceMemoryName() const override; bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const override; + bool allowRenderCompression(const HardwareInfo &hwInfo) const override; protected: HwInfoConfigHw() = default; diff --git a/shared/source/os_interface/hw_info_config.inl b/shared/source/os_interface/hw_info_config.inl index 6d54792291..72d5f64b7d 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -150,4 +150,9 @@ template bool HwInfoConfigHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { return false; } + +template +bool HwInfoConfigHw::allowRenderCompression(const HardwareInfo &hwInfo) const { + return true; +} } // namespace NEO diff --git a/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp b/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp index 8ad45096c7..d141bb0df4 100644 --- a/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp +++ b/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp @@ -79,15 +79,6 @@ template <> void HwHelperHw::setL1CachePolicy(bool useL1Cache, typename Family::RENDER_SURFACE_STATE *surfaceState, const HardwareInfo *hwInfo) { } -template <> -inline bool HwHelperHw::allowRenderCompression(const HardwareInfo &hwInfo) const { - if (hwInfo.gtSystemInfo.EUCount == 256u) { - return false; - } - - return true; -} - template <> inline bool HwHelperHw::allowStatelessCompression(const HardwareInfo &hwInfo) const { if (!NEO::ApiSpecificConfig::isStatelessCompressionSupported()) { diff --git a/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp b/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp index 86f3f98a8e..3aa80fef2f 100644 --- a/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp @@ -19,9 +19,7 @@ constexpr static auto gfxProduct = IGFX_XE_HP_SDV; template <> int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) { - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); - - if (hwHelper.allowRenderCompression(*hwInfo)) { + if (allowRenderCompression(*hwInfo)) { enableRenderCompression(hwInfo); } diff --git a/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl b/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl index d477f75ec5..aeef00dfd6 100644 --- a/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl +++ b/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl @@ -58,3 +58,11 @@ template <> bool HwInfoConfigHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { return getSteppingFromHwRevId(hwInfo) >= REVISION_B; } + +template <> +bool HwInfoConfigHw::allowRenderCompression(const HardwareInfo &hwInfo) const { + if (hwInfo.gtSystemInfo.EUCount == 256u) { + return false; + } + return true; +} diff --git a/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp b/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp index ad9ce8a7bb..5c2aa7a0d7 100644 --- a/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp @@ -20,9 +20,7 @@ constexpr static auto gfxProduct = IGFX_XE_HP_SDV; template <> int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) { - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); - - if (hwHelper.allowRenderCompression(*hwInfo)) { + if (allowRenderCompression(*hwInfo)) { enableRenderCompression(hwInfo); } diff --git a/shared/test/unit_test/os_interface/os_agnostic_hw_info_config_tests.cpp b/shared/test/unit_test/os_interface/os_agnostic_hw_info_config_tests.cpp index 24768ecc68..e018778b04 100644 --- a/shared/test/unit_test/os_interface/os_agnostic_hw_info_config_tests.cpp +++ b/shared/test/unit_test/os_interface/os_agnostic_hw_info_config_tests.cpp @@ -136,6 +136,11 @@ bool HwInfoConfigHw::isDisableOverdispatchAvailable(const Hardware return false; } +template <> +bool HwInfoConfigHw::allowRenderCompression(const HardwareInfo &hwInfo) const { + return false; +} + void OsAgnosticHwInfoConfigTest::SetUp() { DeviceFixture::SetUp(); }