diff --git a/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp b/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp index 083907f57f..3fa34948cb 100644 --- a/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp +++ b/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp @@ -286,27 +286,6 @@ XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenHwHelperWhenGettingThreadsPerEUCo EXPECT_EQ(8U, configs[1]); } -XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenXeHpCoreHelperWhenCheckDirectSubmissionSupportedThenTrueIsReturned) { - HardwareInfo hwInfo = *defaultHwInfo; - auto &helper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); - const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - - { - hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hwInfo); - EXPECT_FALSE(helper.isDirectSubmissionSupported(hwInfo)); - } - - { - hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A1, hwInfo); - EXPECT_FALSE(helper.isDirectSubmissionSupported(hwInfo)); - } - - { - hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); - EXPECT_TRUE(helper.isDirectSubmissionSupported(hwInfo)); - } -} - XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIpVersion) { EXPECT_EQ(ClHwHelperMock::makeDeviceIpVersion(12, 5, 1), ClHwHelper::get(renderCoreFamily).getDeviceIpVersion(*defaultHwInfo)); } diff --git a/opencl/test/unit_test/xe_hpg_core/dg2/test_hw_info_config_dg2.cpp b/opencl/test/unit_test/xe_hpg_core/dg2/test_hw_info_config_dg2.cpp index 797062f4f7..d7cfacdd4b 100644 --- a/opencl/test/unit_test/xe_hpg_core/dg2/test_hw_info_config_dg2.cpp +++ b/opencl/test/unit_test/xe_hpg_core/dg2/test_hw_info_config_dg2.cpp @@ -29,6 +29,12 @@ DG2TEST_F(Dg2HwInfoConfig, givenHwInfoErrorneousConfigStringThenThrow) { EXPECT_EQ(0u, gtSystemInfo.EUCount); } +DG2TEST_F(Dg2HwInfoConfig, givenDg2HwInfoConfigWhenCheckDirectSubmissionSupportedThenTrueIsReturned) { + const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); + auto hwInfo = *defaultHwInfo; + EXPECT_TRUE(hwInfoConfig.isDirectSubmissionSupported(hwInfo)); +} + DG2TEST_F(Dg2HwInfoConfig, givenHwInfoConfigWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); auto hwInfo = *defaultHwInfo; diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index bf44015ef6..37c198a235 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -119,7 +119,6 @@ class HwHelper { virtual bool isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const = 0; virtual bool isKmdMigrationSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isCooperativeEngineSupported(const HardwareInfo &hwInfo) const = 0; - virtual bool isDirectSubmissionSupported(const HardwareInfo &hwInfo) const = 0; virtual aub_stream::MMIOList getExtraMmioList(const HardwareInfo &hwInfo, const GmmHelper &gmmHelper) const = 0; virtual uint32_t getDefaultRevisionId(const HardwareInfo &hwInfo) const = 0; virtual uint32_t getNumCacheRegions() const = 0; @@ -332,8 +331,6 @@ class HwHelperHw : public HwHelper { bool isCooperativeEngineSupported(const HardwareInfo &hwInfo) const override; - bool isDirectSubmissionSupported(const HardwareInfo &hwInfo) const override; - bool isCopyOnlyEngineType(EngineGroupType type) const override; bool isSipWANeeded(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 1b68638745..da508f633e 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -625,11 +625,6 @@ bool HwHelperHw::isCooperativeEngineSupported(const HardwareInfo &hwI return false; } -template -bool HwHelperHw::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const { - return false; -} - template bool HwHelperHw::isCopyOnlyEngineType(EngineGroupType type) const { return NEO::EngineGroupType::Copy == type; diff --git a/shared/source/os_interface/hw_info_config.h b/shared/source/os_interface/hw_info_config.h index 6609e50d19..f51e27c232 100644 --- a/shared/source/os_interface/hw_info_config.h +++ b/shared/source/os_interface/hw_info_config.h @@ -62,6 +62,7 @@ class HwInfoConfig { virtual bool isAllocationSizeAdjustmentRequired(const HardwareInfo &hwInfo) const = 0; virtual bool isPrefetchDisablingRequired(const HardwareInfo &hwInfo) const = 0; virtual bool isNewResidencyModelSupported() const = 0; + virtual bool isDirectSubmissionSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs) const = 0; virtual bool heapInLocalMem(const HardwareInfo &hwInfo) const = 0; virtual void setCapabilityCoherencyFlag(const HardwareInfo &hwInfo, bool &coherencyFlag) = 0; @@ -123,6 +124,7 @@ class HwInfoConfigHw : public HwInfoConfig { bool isAllocationSizeAdjustmentRequired(const HardwareInfo &hwInfo) const override; bool isPrefetchDisablingRequired(const HardwareInfo &hwInfo) const override; bool isNewResidencyModelSupported() const override; + bool isDirectSubmissionSupported(const HardwareInfo &hwInfo) const override; bool isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs) const override; bool heapInLocalMem(const HardwareInfo &hwInfo) const override; void setCapabilityCoherencyFlag(const HardwareInfo &hwInfo, bool &coherencyFlag) override; diff --git a/shared/source/os_interface/hw_info_config.inl b/shared/source/os_interface/hw_info_config.inl index 5031a74a19..359cab8c36 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -231,6 +231,11 @@ bool HwInfoConfigHw::imagePitchAlignmentWARequired(const HardwareInf return false; } +template +bool HwInfoConfigHw::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const { + return false; +} + template bool HwInfoConfigHw::isForceEmuInt32DivRemSPWARequired(const HardwareInfo &hwInfo) const { return false; diff --git a/shared/source/os_interface/linux/os_context_linux.cpp b/shared/source/os_interface/linux/os_context_linux.cpp index 3627489f92..a3ab9766e4 100644 --- a/shared/source/os_interface/linux/os_context_linux.cpp +++ b/shared/source/os_interface/linux/os_context_linux.cpp @@ -11,8 +11,8 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/engine_node_helper.h" -#include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/hw_info.h" +#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/linux/drm_neo.h" #include "shared/source/os_interface/os_context.h" #include "shared/source/os_interface/os_interface.h" @@ -80,8 +80,8 @@ void OsContextLinux::initializeContext() { } bool OsContextLinux::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const { - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); - return this->getDrm().isVmBindAvailable() && hwHelper.isDirectSubmissionSupported(hwInfo); + auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily); + return this->getDrm().isVmBindAvailable() && hwInfoConfig->isDirectSubmissionSupported(hwInfo); } Drm &OsContextLinux::getDrm() const { 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 453d376fc8..a4ef41967d 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 @@ -48,14 +48,6 @@ inline bool HwHelperHw::isSpecialWorkgroupSizeRequired(const HardwareInf } } -template <> -bool HwHelperHw::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const { - if (hwInfo.platform.usRevId < HwInfoConfig::get(hwInfo.platform.eProductFamily)->getHwRevIdFromStepping(REVISION_B, hwInfo)) { - return false; - } - return true; -} - template <> uint32_t HwHelperHw::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) { using SHARED_LOCAL_MEMORY_SIZE = typename Family::INTERFACE_DESCRIPTOR_DATA::SHARED_LOCAL_MEMORY_SIZE; 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 3dd1621433..e9af4f4f88 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 @@ -54,6 +54,14 @@ std::string HwInfoConfigHw::getDeviceMemoryName() const { return "HBM"; } +template <> +bool HwInfoConfigHw::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const { + if (hwInfo.platform.usRevId < HwInfoConfig::get(hwInfo.platform.eProductFamily)->getHwRevIdFromStepping(REVISION_B, hwInfo)) { + return false; + } + return true; +} + template <> bool HwInfoConfigHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { return getSteppingFromHwRevId(hwInfo) >= REVISION_B; diff --git a/shared/source/xe_hpg_core/hw_info_dg2.cpp b/shared/source/xe_hpg_core/hw_info_dg2.cpp index 1d92a4a420..9c367c5f33 100644 --- a/shared/source/xe_hpg_core/hw_info_dg2.cpp +++ b/shared/source/xe_hpg_core/hw_info_dg2.cpp @@ -34,7 +34,7 @@ const PLATFORM DG2::platform = { const RuntimeCapabilityTable DG2::capabilityTable{ EngineDirectSubmissionInitVec{ - {aub_stream::ENGINE_RCS, {true, false, false, true}}, + {aub_stream::ENGINE_RCS, {false, false, false, false}}, {aub_stream::ENGINE_CCS, {true, false, false, true}}, {aub_stream::ENGINE_CCS1, {true, false, true, true}}, {aub_stream::ENGINE_CCS2, {true, false, true, true}}, diff --git a/shared/source/xe_hpg_core/os_agnostic_hw_info_config_dg2.inl b/shared/source/xe_hpg_core/os_agnostic_hw_info_config_dg2.inl index ed6c2e3281..fe2d8f8317 100644 --- a/shared/source/xe_hpg_core/os_agnostic_hw_info_config_dg2.inl +++ b/shared/source/xe_hpg_core/os_agnostic_hw_info_config_dg2.inl @@ -52,6 +52,11 @@ uint32_t HwInfoConfigHw::getSteppingFromHwRevId(const HardwareInfo & return CommonConstants::invalidStepping; } +template <> +bool HwInfoConfigHw::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const { + return true; +} + template <> bool HwInfoConfigHw::isAdditionalStateBaseAddressWARequired(const HardwareInfo &hwInfo) const { uint32_t stepping = getSteppingFromHwRevId(hwInfo); diff --git a/shared/test/common/mocks/mock_hw_info_config.cpp b/shared/test/common/mocks/mock_hw_info_config.cpp index 587d446fd0..a8ac873fd9 100644 --- a/shared/test/common/mocks/mock_hw_info_config.cpp +++ b/shared/test/common/mocks/mock_hw_info_config.cpp @@ -148,6 +148,11 @@ bool HwInfoConfigHw::allowStatelessCompression(const HardwareInfo return false; } +template <> +bool HwInfoConfigHw::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const { + return false; +} + template <> LocalMemoryAccessMode HwInfoConfigHw::getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const { return LocalMemoryAccessMode::Default; diff --git a/shared/test/common/xe_hp_core/test_hw_info_config_xe_hp_core.cpp b/shared/test/common/xe_hp_core/test_hw_info_config_xe_hp_core.cpp index 5b1ab57239..48daa045bd 100644 --- a/shared/test/common/xe_hp_core/test_hw_info_config_xe_hp_core.cpp +++ b/shared/test/common/xe_hp_core/test_hw_info_config_xe_hp_core.cpp @@ -52,6 +52,26 @@ XEHPTEST_F(TestXeHPHwInfoConfig, givenHwInfoConfigWhenRevisionIsAtLeastBThenAllo } } +XEHPTEST_F(TestXeHPHwInfoConfig, givenXeHpCoreHwInfoConfigWhenCheckDirectSubmissionSupportedThenTrueIsReturned) { + auto hwInfo = *defaultHwInfo; + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + + { + hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hwInfo); + EXPECT_FALSE(hwInfoConfig.isDirectSubmissionSupported(hwInfo)); + } + + { + hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A1, hwInfo); + EXPECT_FALSE(hwInfoConfig.isDirectSubmissionSupported(hwInfo)); + } + + { + hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); + EXPECT_TRUE(hwInfoConfig.isDirectSubmissionSupported(hwInfo)); + } +} + XEHPTEST_F(TestXeHPHwInfoConfig, givenHwInfoConfigWhenCreateMultipleSubDevicesThenDontAllowStatelessCompression) { DebugManagerStateRestore restore; DebugManager.flags.CreateMultipleSubDevices.set(2); diff --git a/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp b/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp index 919cd6ca3d..a6b3dfaf58 100644 --- a/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp +++ b/shared/test/unit_test/direct_submission/linux/drm_direct_submission_tests.cpp @@ -172,8 +172,8 @@ HWTEST_F(DrmDirectSubmissionTest, givenDisabledMonitorFenceWhenUpdateTagValueThe HWTEST_F(DrmDirectSubmissionTest, whenCheckForDirectSubmissionSupportThenProperValueIsReturned) { auto directSubmissionSupported = osContext->isDirectSubmissionSupported(device->getHardwareInfo()); - auto &hwHelper = HwHelper::get(device->getHardwareInfo().platform.eRenderCoreFamily); - EXPECT_EQ(directSubmissionSupported, hwHelper.isDirectSubmissionSupported(device->getHardwareInfo()) && executionEnvironment.rootDeviceEnvironments[0]->osInterface->getDriverModel()->as()->isVmBindAvailable()); + auto hwInfoConfig = HwInfoConfig::get(device->getHardwareInfo().platform.eProductFamily); + EXPECT_EQ(directSubmissionSupported, hwInfoConfig->isDirectSubmissionSupported(device->getHardwareInfo()) && executionEnvironment.rootDeviceEnvironments[0]->osInterface->getDriverModel()->as()->isVmBindAvailable()); } HWTEST_F(DrmDirectSubmissionTest, givenDirectSubmissionNewResourceTlbFlushWhenDispatchCommandBufferThenTlbIsFlushed) {