From f27dcbfb859adb82999c7b973766bc358c300c1c Mon Sep 17 00:00:00 2001 From: Andrzej Koska Date: Thu, 10 Nov 2022 22:13:46 +0000 Subject: [PATCH] Unify RCS exposure The goal is to standardize RCS exposure for all types of hardware Related-To: NEO-7224 Signed-off-by: Andrzej Koska --- shared/source/os_interface/hw_info_config.h | 2 ++ shared/source/os_interface/hw_info_config.inl | 8 ++++++ .../linux/hw_info_config_xe_hp_sdv.cpp | 5 +--- .../windows/hw_info_config_xe_hp_sdv.cpp | 5 +--- .../linux/hw_info_config_xe_hpc_core.inl | 5 +--- .../windows/hw_info_config_pvc.cpp | 6 +---- .../dg2/os_agnostic_hw_info_config_dg2.inl | 7 ----- .../xe_hpg_core/linux/hw_info_config_dg2.cpp | 2 +- .../windows/hw_info_config_dg2.cpp | 2 +- .../unit_test/helpers/hw_helper_tests.cpp | 27 +++++++++++++++++++ 10 files changed, 43 insertions(+), 26 deletions(-) diff --git a/shared/source/os_interface/hw_info_config.h b/shared/source/os_interface/hw_info_config.h index 90fa5f28cf..632007f500 100644 --- a/shared/source/os_interface/hw_info_config.h +++ b/shared/source/os_interface/hw_info_config.h @@ -53,6 +53,7 @@ class HwInfoConfig { virtual int configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const = 0; virtual void adjustPlatformForProductFamily(HardwareInfo *hwInfo) = 0; virtual void adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) = 0; + virtual void disableRcsExposure(HardwareInfo *hwInfo) const = 0; virtual uint64_t getHostMemCapabilities(const HardwareInfo *hwInfo) = 0; virtual uint64_t getDeviceMemCapabilities() = 0; virtual uint64_t getSingleDeviceSharedMemCapabilities() = 0; @@ -189,6 +190,7 @@ class HwInfoConfigHw : public HwInfoConfig { int configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const override; void adjustPlatformForProductFamily(HardwareInfo *hwInfo) override; void adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) override; + void disableRcsExposure(HardwareInfo *hwInfo) const override; uint64_t getHostMemCapabilities(const HardwareInfo *hwInfo) override; uint64_t getDeviceMemCapabilities() override; uint64_t getSingleDeviceSharedMemCapabilities() override; diff --git a/shared/source/os_interface/hw_info_config.inl b/shared/source/os_interface/hw_info_config.inl index 693dbe8245..0e802526db 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -57,6 +57,14 @@ void HwInfoConfigHw::enableBlitterOperationsSupport(HardwareInfo *hw } } +template +void HwInfoConfigHw::disableRcsExposure(HardwareInfo *hwInfo) const { + hwInfo->featureTable.flags.ftrRcsNode = false; + if ((DebugManager.flags.NodeOrdinal.get() == static_cast(aub_stream::EngineType::ENGINE_RCS)) || (DebugManager.flags.NodeOrdinal.get() == static_cast(aub_stream::EngineType::ENGINE_CCCS))) { + hwInfo->featureTable.flags.ftrRcsNode = true; + } +} + template uint64_t HwInfoConfigHw::getDeviceMemCapabilities() { uint64_t capabilities = UNIFIED_SHARED_MEMORY_ACCESS | UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS; 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 abda82b257..f208947967 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 @@ -36,10 +36,7 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OS enableCompression(hwInfo); } - hwInfo->featureTable.flags.ftrRcsNode = false; - if (DebugManager.flags.NodeOrdinal.get() == static_cast(aub_stream::EngineType::ENGINE_RCS)) { - hwInfo->featureTable.flags.ftrRcsNode = true; - } + disableRcsExposure(hwInfo); enableBlitterOperationsSupport(hwInfo); 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 3545fb2c95..aa249f754a 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 @@ -26,10 +26,7 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OS enableCompression(hwInfo); } - hwInfo->featureTable.flags.ftrRcsNode = false; - if (DebugManager.flags.NodeOrdinal.get() == static_cast(aub_stream::EngineType::ENGINE_RCS)) { - hwInfo->featureTable.flags.ftrRcsNode = true; - } + disableRcsExposure(hwInfo); enableBlitterOperationsSupport(hwInfo); return 0; diff --git a/shared/source/xe_hpc_core/linux/hw_info_config_xe_hpc_core.inl b/shared/source/xe_hpc_core/linux/hw_info_config_xe_hpc_core.inl index 5353eff47c..d7a1b6d55a 100644 --- a/shared/source/xe_hpc_core/linux/hw_info_config_xe_hpc_core.inl +++ b/shared/source/xe_hpc_core/linux/hw_info_config_xe_hpc_core.inl @@ -18,10 +18,7 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OS enableBlitterOperationsSupport(hwInfo); - hwInfo->featureTable.flags.ftrRcsNode = false; - if (DebugManager.flags.NodeOrdinal.get() == static_cast(aub_stream::EngineType::ENGINE_CCCS)) { - hwInfo->featureTable.flags.ftrRcsNode = true; - } + disableRcsExposure(hwInfo); auto &kmdNotifyProperties = hwInfo->capabilityTable.kmdNotifyProperties; kmdNotifyProperties.enableKmdNotify = true; diff --git a/shared/source/xe_hpc_core/windows/hw_info_config_pvc.cpp b/shared/source/xe_hpc_core/windows/hw_info_config_pvc.cpp index 72ce0f8d0d..d5c8cd0440 100644 --- a/shared/source/xe_hpc_core/windows/hw_info_config_pvc.cpp +++ b/shared/source/xe_hpc_core/windows/hw_info_config_pvc.cpp @@ -24,11 +24,7 @@ template <> int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) const { enableCompression(hwInfo); enableBlitterOperationsSupport(hwInfo); - - hwInfo->featureTable.flags.ftrRcsNode = false; - if (DebugManager.flags.NodeOrdinal.get() == static_cast(aub_stream::EngineType::ENGINE_CCCS)) { - hwInfo->featureTable.flags.ftrRcsNode = true; - } + disableRcsExposure(hwInfo); return 0; } diff --git a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl index 80b7dc3055..7aecd16690 100644 --- a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl +++ b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl @@ -204,10 +204,3 @@ bool HwInfoConfigHw::isStorageInfoAdjustmentRequired() const { return false; } } - -void adjustRcsExposure(HardwareInfo *hwInfo) { - hwInfo->featureTable.flags.ftrRcsNode = false; - if (DebugManager.flags.NodeOrdinal.get() == static_cast(aub_stream::EngineType::ENGINE_RCS)) { - hwInfo->featureTable.flags.ftrRcsNode = true; - } -} diff --git a/shared/source/xe_hpg_core/linux/hw_info_config_dg2.cpp b/shared/source/xe_hpg_core/linux/hw_info_config_dg2.cpp index f8c139540c..16b915188f 100644 --- a/shared/source/xe_hpg_core/linux/hw_info_config_dg2.cpp +++ b/shared/source/xe_hpg_core/linux/hw_info_config_dg2.cpp @@ -37,7 +37,7 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OS DG2::adjustHardwareInfo(hwInfo); enableBlitterOperationsSupport(hwInfo); - adjustRcsExposure(hwInfo); + disableRcsExposure(hwInfo); auto &kmdNotifyProperties = hwInfo->capabilityTable.kmdNotifyProperties; kmdNotifyProperties.enableKmdNotify = true; diff --git a/shared/source/xe_hpg_core/windows/hw_info_config_dg2.cpp b/shared/source/xe_hpg_core/windows/hw_info_config_dg2.cpp index 13c34c87d4..dada043dc3 100644 --- a/shared/source/xe_hpg_core/windows/hw_info_config_dg2.cpp +++ b/shared/source/xe_hpg_core/windows/hw_info_config_dg2.cpp @@ -33,7 +33,7 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OS DG2::adjustHardwareInfo(hwInfo); enableBlitterOperationsSupport(hwInfo); - adjustRcsExposure(hwInfo); + disableRcsExposure(hwInfo); return 0; } diff --git a/shared/test/unit_test/helpers/hw_helper_tests.cpp b/shared/test/unit_test/helpers/hw_helper_tests.cpp index 0ac7066cb3..75638aafe4 100644 --- a/shared/test/unit_test/helpers/hw_helper_tests.cpp +++ b/shared/test/unit_test/helpers/hw_helper_tests.cpp @@ -965,6 +965,33 @@ HWTEST2_F(HwInfoConfigCommonTest, givenBlitterPreferenceWhenEnablingBlitterOpera EXPECT_EQ(expectedBlitterSupport, hardwareInfo.capabilityTable.blitterOperationsSupported); } +HWTEST2_F(HwInfoConfigCommonTest, givenHardwareInfoWhendisableRcsExposureIsCalledThenFtrRcsNodeIsFalse, IsAtLeastGen12lp) { + HardwareInfo hwInfo = *defaultHwInfo; + auto &productHelper = getHelper(); + productHelper.disableRcsExposure(&hwInfo); + EXPECT_FALSE(hwInfo.featureTable.flags.ftrRcsNode); +} + +HWTEST2_F(HwInfoConfigCommonTest, givenHardwareInfoAndDebugVariableNodeOrdinalEqualsRcsWhenDisableRcsExposureIsCalledThenFtrRcsNodeIsTrue, IsAtLeastGen12lp) { + HardwareInfo hwInfo = *defaultHwInfo; + auto &productHelper = getHelper(); + DebugManagerStateRestore restore; + DebugManager.flags.NodeOrdinal.set(static_cast(aub_stream::EngineType::ENGINE_RCS)); + + productHelper.disableRcsExposure(&hwInfo); + EXPECT_TRUE(hwInfo.featureTable.flags.ftrRcsNode); +} + +HWTEST2_F(HwInfoConfigCommonTest, givenHardwareInfoAndDebugVariableNodeOrdinalEqualsCccsWhenDisableRcsExposureIsCalledThenFtrRcsNodeIsTrue, IsAtLeastGen12lp) { + HardwareInfo hwInfo = *defaultHwInfo; + auto &productHelper = getHelper(); + DebugManagerStateRestore restore; + DebugManager.flags.NodeOrdinal.set(static_cast(aub_stream::EngineType::ENGINE_CCCS)); + + productHelper.disableRcsExposure(&hwInfo); + EXPECT_TRUE(hwInfo.featureTable.flags.ftrRcsNode); +} + HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForIsaSystemMemoryPlacementThenReturnFalseIfLocalMemorySupported) { DebugManagerStateRestore restorer; HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);