From 45139de33af69a8c56d5470c4b425b9aa180a680 Mon Sep 17 00:00:00 2001 From: Lukasz Jobczyk Date: Tue, 21 Feb 2023 14:27:13 +0000 Subject: [PATCH] Leave init builtin async only on post silicon Signed-off-by: Lukasz Jobczyk --- level_zero/core/source/dll/create_builtin_functions_lib.cpp | 3 ++- shared/source/os_interface/hw_info_config.h | 1 + shared/source/os_interface/hw_info_config_bdw_and_later.inl | 5 +++++ shared/source/os_interface/hw_info_config_xehp_and_later.inl | 5 +++++ shared/source/os_interface/product_helper_hw.h | 1 + .../xe_hpg_core/mtl/os_agnostic_product_helper_mtl.inl | 5 +++++ shared/test/common/mocks/mock_hw_info_config.cpp | 5 +++++ shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp | 4 ++++ .../unit_test/xe_hp_core/test_hw_info_config_xe_hp_core.cpp | 4 ++++ .../unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp | 4 ++++ .../unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp | 4 ++++ .../unit_test/xe_hpg_core/mtl/hw_info_config_tests_mtl.cpp | 4 ++++ 12 files changed, 44 insertions(+), 1 deletion(-) diff --git a/level_zero/core/source/dll/create_builtin_functions_lib.cpp b/level_zero/core/source/dll/create_builtin_functions_lib.cpp index e2df7d5f3b..a79a0d03c6 100644 --- a/level_zero/core/source/dll/create_builtin_functions_lib.cpp +++ b/level_zero/core/source/dll/create_builtin_functions_lib.cpp @@ -24,7 +24,8 @@ std::unique_ptr BuiltinFunctionsLib::create(Device *device, bool BuiltinFunctionsLibImpl::initBuiltinsAsyncEnabled(Device *device) { return device->getNEODevice()->getRootDeviceEnvironment().osInterface.get() && device->getNEODevice()->getRootDeviceEnvironment().osInterface->getDriverModel()->getDriverModelType() == NEO::DriverModelType::DRM && - device->getNEODevice()->getDefaultEngine().commandStreamReceiver->getType() == NEO::CommandStreamReceiverType::CSR_HW; + device->getNEODevice()->getDefaultEngine().commandStreamReceiver->getType() == NEO::CommandStreamReceiverType::CSR_HW && + device->getNEODevice()->getRootDeviceEnvironment().getProductHelper().isInitBuiltinAsyncSupported(device->getHwInfo()); } } // namespace L0 diff --git a/shared/source/os_interface/hw_info_config.h b/shared/source/os_interface/hw_info_config.h index 531918fc22..28e97725ef 100644 --- a/shared/source/os_interface/hw_info_config.h +++ b/shared/source/os_interface/hw_info_config.h @@ -125,6 +125,7 @@ class ProductHelper { virtual bool isFlushTaskAllowed() const = 0; virtual bool programAllStateComputeCommandFields() const = 0; virtual bool isSystolicModeConfigurable(const HardwareInfo &hwInfo) const = 0; + virtual bool isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isGlobalFenceInCommandStreamRequired(const HardwareInfo &hwInfo) const = 0; virtual bool isGlobalFenceInDirectSubmissionRequired(const HardwareInfo &hwInfo) const = 0; virtual bool isComputeDispatchAllWalkerEnableInComputeWalkerRequired(const HardwareInfo &hwInfo) const = 0; diff --git a/shared/source/os_interface/hw_info_config_bdw_and_later.inl b/shared/source/os_interface/hw_info_config_bdw_and_later.inl index 31f32956ee..193c25bc3b 100644 --- a/shared/source/os_interface/hw_info_config_bdw_and_later.inl +++ b/shared/source/os_interface/hw_info_config_bdw_and_later.inl @@ -55,6 +55,11 @@ void ProductHelperHw::setCapabilityCoherencyFlag(const HardwareInfo coherencyFlag = true; } +template +bool ProductHelperHw::isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const { + return true; +} + template bool ProductHelperHw::isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const { return true; diff --git a/shared/source/os_interface/hw_info_config_xehp_and_later.inl b/shared/source/os_interface/hw_info_config_xehp_and_later.inl index deb7ada30f..469f631a27 100644 --- a/shared/source/os_interface/hw_info_config_xehp_and_later.inl +++ b/shared/source/os_interface/hw_info_config_xehp_and_later.inl @@ -58,6 +58,11 @@ void ProductHelperHw::setCapabilityCoherencyFlag(const HardwareInfo coherencyFlag = false; } +template +bool ProductHelperHw::isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const { + return true; +} + template bool ProductHelperHw::isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const { return false; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 4e7e8687f3..f8881ebb3e 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -84,6 +84,7 @@ class ProductHelperHw : public ProductHelper { bool isFlushTaskAllowed() const override; bool programAllStateComputeCommandFields() const override; bool isSystolicModeConfigurable(const HardwareInfo &hwInfo) const override; + bool isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const override; bool isComputeDispatchAllWalkerEnableInComputeWalkerRequired(const HardwareInfo &hwInfo) const override; bool isCopyEngineSelectorEnabled(const HardwareInfo &hwInfo) const override; bool isGlobalFenceInCommandStreamRequired(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/xe_hpg_core/mtl/os_agnostic_product_helper_mtl.inl b/shared/source/xe_hpg_core/mtl/os_agnostic_product_helper_mtl.inl index e8fce719a1..0a9feccfda 100644 --- a/shared/source/xe_hpg_core/mtl/os_agnostic_product_helper_mtl.inl +++ b/shared/source/xe_hpg_core/mtl/os_agnostic_product_helper_mtl.inl @@ -106,6 +106,11 @@ bool ProductHelperHw::isAdjustWalkOrderAvailable(const HardwareInfo return (MTL::isLpg(hwInfo) == false); } +template <> +bool ProductHelperHw::isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const { + return false; +} + template <> bool ProductHelperHw::isEvictionIfNecessaryFlagSupported() const { return true; diff --git a/shared/test/common/mocks/mock_hw_info_config.cpp b/shared/test/common/mocks/mock_hw_info_config.cpp index 8ae12e9a7e..73c51230ed 100644 --- a/shared/test/common/mocks/mock_hw_info_config.cpp +++ b/shared/test/common/mocks/mock_hw_info_config.cpp @@ -215,6 +215,11 @@ template <> void ProductHelperHw::setCapabilityCoherencyFlag(const HardwareInfo &hwInfo, bool &coherencyFlag) { } +template <> +bool ProductHelperHw::isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const { + return false; +} + template <> bool ProductHelperHw::isAdditionalMediaSamplerProgrammingRequired() const { return false; diff --git a/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp b/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp index d74b52aa98..32b52c5843 100644 --- a/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp +++ b/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp @@ -35,6 +35,10 @@ SKLTEST_F(SklProductHelper, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsRe EXPECT_EQ(0u, gtSystemInfo.EUCount); } +SKLTEST_F(SklProductHelper, givenSklProductHelperWhenIsInitBuiltinAsyncSupportedThenReturnTrue) { + EXPECT_TRUE(productHelper->isInitBuiltinAsyncSupported(*defaultHwInfo)); +} + SKLTEST_F(SklProductHelper, givenBoolWhenCallSklHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { uint64_t configs[] = { 0x100030008, diff --git a/shared/test/unit_test/xe_hp_core/test_hw_info_config_xe_hp_core.cpp b/shared/test/unit_test/xe_hp_core/test_hw_info_config_xe_hp_core.cpp index c547c824ef..2fbe38e2e2 100644 --- a/shared/test/unit_test/xe_hp_core/test_hw_info_config_xe_hp_core.cpp +++ b/shared/test/unit_test/xe_hp_core/test_hw_info_config_xe_hp_core.cpp @@ -51,6 +51,10 @@ XEHPTEST_F(XeHpProductHelper, givenProductHelperWhenRevisionIsAtLeastBThenAllowS } } +XEHPTEST_F(XeHpProductHelper, givenXeHpProductHelperWhenIsInitBuiltinAsyncSupportedThenReturnTrue) { + EXPECT_TRUE(productHelper->isInitBuiltinAsyncSupported(*defaultHwInfo)); +} + XEHPTEST_F(XeHpProductHelper, givenXeHpCoreProductHelperWhenCheckDirectSubmissionSupportedThenTrueIsReturned) { auto hwInfo = *defaultHwInfo; diff --git a/shared/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp index 16f5554e6d..16b3efc365 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp @@ -87,6 +87,10 @@ PVCTEST_F(PvcProductHelper, givenPvcProductHelperWhenIsStatefulAddressingModeSup EXPECT_FALSE(productHelper->isStatefulAddressingModeSupported()); } +PVCTEST_F(PvcProductHelper, givenPvcProductHelperWhenIsInitBuiltinAsyncSupportedThenReturnTrue) { + EXPECT_TRUE(productHelper->isInitBuiltinAsyncSupported(*defaultHwInfo)); +} + PVCTEST_F(PvcProductHelper, givenPvcSteppingWhenQueryIsComputeDispatchAllWalkerEnableInCfeStateRequiredThenAppropriateValueIsReturned) { auto hwInfo = *defaultHwInfo; diff --git a/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp index e8eef1a62e..f3384c6bf1 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp @@ -55,6 +55,10 @@ DG2TEST_F(ProductHelperTestDg2, givenDg2ConfigWhenSetupHardwareInfoThenGtSystemI EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); } +DG2TEST_F(ProductHelperTestDg2, givenDg2ProductHelperWhenIsInitBuiltinAsyncSupportedThenReturnTrue) { + EXPECT_TRUE(productHelper->isInitBuiltinAsyncSupported(*defaultHwInfo)); +} + DG2TEST_F(ProductHelperTestDg2, givenG10DevIdWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { HardwareInfo myHwInfo = *defaultHwInfo; myHwInfo.platform.usDeviceID = dg2G10DeviceIds[0]; diff --git a/shared/test/unit_test/xe_hpg_core/mtl/hw_info_config_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/hw_info_config_tests_mtl.cpp index a0dd1e9554..dc894c7955 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/hw_info_config_tests_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/hw_info_config_tests_mtl.cpp @@ -62,6 +62,10 @@ MTLTEST_F(MtlProductHelper, whenGettingAubstreamProductFamilyThenProperEnumValue EXPECT_EQ(aub_stream::ProductFamily::Mtl, productHelper->getAubStreamProductFamily()); } +MTLTEST_F(MtlProductHelper, givenMtlProductHelperWhenIsInitBuiltinAsyncSupportedThenReturnFalse) { + EXPECT_FALSE(productHelper->isInitBuiltinAsyncSupported(*defaultHwInfo)); +} + MTLTEST_F(MtlProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported()); }