Move stepping getter functions from HwHelper to HwInfoConfig

Signed-off-by: Rafal Maziejuk <rafal.maziejuk@intel.com>
Related-To: NEO-4541
This commit is contained in:
Rafal Maziejuk 2021-08-27 13:30:39 +00:00 committed by Compute-Runtime-Automation
parent 13bea69877
commit a651e30aa1
28 changed files with 231 additions and 157 deletions

View File

@ -8,6 +8,7 @@
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/helpers/register_offsets.h"
#include "shared/source/helpers/state_base_address.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
@ -128,8 +129,8 @@ HWTEST2_F(CommandListCreate, GivenHostMemoryInSvmManagerWhenAppendingMemoryBarri
{
using L3_FLUSH_EVICTION_POLICY = typename FamilyType::L3_FLUSH_ADDRESS_RANGE::L3_FLUSH_EVICTION_POLICY;
auto cmd = genCmdCast<L3_CONTROL *>(*itorPC);
auto &hwHelper = NEO::HwHelper::get(device->getHwInfo().platform.eRenderCoreFamily);
auto isA0Stepping = (hwHelper.getSteppingFromHwRevId(device->getHwInfo()) == REVISION_A0);
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(device->getHwInfo().platform.eProductFamily);
auto isA0Stepping = (hwInfoConfig.getSteppingFromHwRevId(device->getHwInfo()) == REVISION_A0);
auto maskedAddress = cmd->getL3FlushAddressRange().getAddress(isA0Stepping);
EXPECT_NE(maskedAddress, 0u);
@ -191,8 +192,8 @@ HWTEST2_F(CommandListCreate, GivenHostMemoryWhenAppendingMemoryBarrierThenAddres
{
using L3_FLUSH_EVICTION_POLICY = typename FamilyType::L3_FLUSH_ADDRESS_RANGE::L3_FLUSH_EVICTION_POLICY;
auto cmd = genCmdCast<L3_CONTROL *>(*itorPC);
auto &hwHelper = NEO::HwHelper::get(device->getHwInfo().platform.eRenderCoreFamily);
auto isA0Stepping = (hwHelper.getSteppingFromHwRevId(device->getHwInfo()) == REVISION_A0);
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(device->getHwInfo().platform.eProductFamily);
auto isA0Stepping = (hwInfoConfig.getSteppingFromHwRevId(device->getHwInfo()) == REVISION_A0);
auto maskedAddress = cmd->getL3FlushAddressRange().getAddress(isA0Stepping);
EXPECT_NE(maskedAddress, 0u);

View File

@ -25,6 +25,7 @@
#include "shared/source/memory_manager/graphics_allocation.h"
#include "shared/source/memory_manager/memory_banks.h"
#include "shared/source/memory_manager/os_agnostic_memory_manager.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/os_context.h"
#include "opencl/source/command_stream/aub_command_stream_receiver_hw.h"
@ -147,8 +148,8 @@ void AUBCommandStreamReceiverHw<GfxFamily>::initFile(const std::string &fileName
}
// Add the file header
auto &hwInfo = this->peekHwInfo();
auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
stream->init(hwHelper.getAubStreamSteppingFromHwRevId(hwInfo), aubDeviceId);
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
stream->init(hwInfoConfig.getAubStreamSteppingFromHwRevId(hwInfo), aubDeviceId);
}
}

View File

@ -10,6 +10,7 @@
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/api_specific_config.h"
#include "shared/source/helpers/ptr_math.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "opencl/source/command_stream/aub_command_stream_receiver_hw.h"
#include "test.h"
@ -44,8 +45,8 @@ void setupAUB(const NEO::Device *pDevice, aub_stream::EngineType engineType) {
// Header
auto &hwInfo = pDevice->getHardwareInfo();
auto deviceId = hwInfo.capabilityTable.aubDeviceId;
auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
aubFile.init(hwHelper.getAubStreamSteppingFromHwRevId(hwInfo), deviceId);
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
aubFile.init(hwInfoConfig.getAubStreamSteppingFromHwRevId(hwInfo), deviceId);
aubFile.writeMMIO(mmioBase + 0x229c, 0xffff8280);

View File

@ -30,8 +30,8 @@ void setupAUBWithBatchBuffer(const NEO::Device *pDevice, aub_stream::EngineType
// Header
auto &hwInfo = pDevice->getHardwareInfo();
auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
aubFile.init(hwHelper.getAubStreamSteppingFromHwRevId(hwInfo), AUB::Traits::device);
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
aubFile.init(hwInfoConfig.getAubStreamSteppingFromHwRevId(hwInfo), AUB::Traits::device);
aubFile.writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x229c), 0xffff8280);

View File

@ -30,8 +30,8 @@ void setupAUBWithBatchBuffer(const NEO::Device *pDevice, aub_stream::EngineType
// Header
auto &hwInfo = pDevice->getHardwareInfo();
auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
aubFile.init(hwHelper.getAubStreamSteppingFromHwRevId(hwInfo), AUB::Traits::device);
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
aubFile.init(hwInfoConfig.getAubStreamSteppingFromHwRevId(hwInfo), AUB::Traits::device);
aubFile.writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x229c), 0xffff8280);

View File

@ -7,7 +7,6 @@
#pragma once
#include "shared/source/aub/aub_helper.h"
#include "shared/source/helpers/hw_helper.h"
#include "opencl/test/unit_test/aub_tests/command_stream/aub_mem_dump_tests.h"
@ -32,8 +31,8 @@ void setupAUBWithBatchBuffer(const NEO::Device *pDevice, aub_stream::EngineType
// Header
auto &hwInfo = pDevice->getHardwareInfo();
auto deviceId = hwInfo.capabilityTable.aubDeviceId;
auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
aubFile.init(hwHelper.getAubStreamSteppingFromHwRevId(hwInfo), deviceId);
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
aubFile.init(hwInfoConfig.getAubStreamSteppingFromHwRevId(hwInfo), deviceId);
aubFile.writeMMIO(AubMemDump::computeRegisterOffset(mmioBase, 0x229c), 0xffff8280);

View File

@ -944,50 +944,6 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, givenDefaultHwHelperHwWhenIsWorkaround
EXPECT_FALSE(helper.isWorkaroundRequired(REVISION_A0, REVISION_B, hardwareInfo));
}
HWTEST_F(HwHelperTest, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect) {
auto &helper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
for (uint32_t testValue = 0; testValue < 0x10; testValue++) {
auto hwRevIdFromStepping = hwInfoConfig.getHwRevIdFromStepping(testValue, hardwareInfo);
if (hwRevIdFromStepping != CommonConstants::invalidStepping) {
hardwareInfo.platform.usRevId = hwRevIdFromStepping;
EXPECT_EQ(testValue, helper.getSteppingFromHwRevId(hardwareInfo));
}
hardwareInfo.platform.usRevId = testValue;
auto steppingFromHwRevId = helper.getSteppingFromHwRevId(hardwareInfo);
if (steppingFromHwRevId != CommonConstants::invalidStepping) {
EXPECT_EQ(testValue, hwInfoConfig.getHwRevIdFromStepping(steppingFromHwRevId, hardwareInfo));
}
}
}
HWTEST_F(HwHelperTest, givenVariousValuesWhenGettingAubStreamSteppingFromHwRevIdThenReturnValuesAreCorrect) {
struct MockHwHelper : HwHelperHw<FamilyType> {
uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const override {
return returnedStepping;
}
uint32_t returnedStepping = 0;
};
MockHwHelper mockHwHelper;
mockHwHelper.returnedStepping = REVISION_A0;
EXPECT_EQ(AubMemDump::SteppingValues::A, mockHwHelper.getAubStreamSteppingFromHwRevId(hardwareInfo));
mockHwHelper.returnedStepping = REVISION_A1;
EXPECT_EQ(AubMemDump::SteppingValues::A, mockHwHelper.getAubStreamSteppingFromHwRevId(hardwareInfo));
mockHwHelper.returnedStepping = REVISION_A3;
EXPECT_EQ(AubMemDump::SteppingValues::A, mockHwHelper.getAubStreamSteppingFromHwRevId(hardwareInfo));
mockHwHelper.returnedStepping = REVISION_B;
EXPECT_EQ(AubMemDump::SteppingValues::B, mockHwHelper.getAubStreamSteppingFromHwRevId(hardwareInfo));
mockHwHelper.returnedStepping = REVISION_C;
EXPECT_EQ(AubMemDump::SteppingValues::C, mockHwHelper.getAubStreamSteppingFromHwRevId(hardwareInfo));
mockHwHelper.returnedStepping = REVISION_D;
EXPECT_EQ(AubMemDump::SteppingValues::D, mockHwHelper.getAubStreamSteppingFromHwRevId(hardwareInfo));
mockHwHelper.returnedStepping = REVISION_K;
EXPECT_EQ(AubMemDump::SteppingValues::K, mockHwHelper.getAubStreamSteppingFromHwRevId(hardwareInfo));
mockHwHelper.returnedStepping = CommonConstants::invalidStepping;
EXPECT_EQ(AubMemDump::SteppingValues::A, mockHwHelper.getAubStreamSteppingFromHwRevId(hardwareInfo));
}
HWTEST_F(HwHelperTest, givenDefaultHwHelperHwWhenIsForceEmuInt32DivRemSPWARequiredCalledThenFalseIsReturned) {
if (hardwareInfo.platform.eRenderCoreFamily == IGFX_GEN12LP_CORE) {
GTEST_SKIP();

View File

@ -159,3 +159,46 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedForPageTableManagerSupportT
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
EXPECT_EQ(hwInfoConfig.isPageTableManagerSupported(pInHwInfo), UnitTestHelper<FamilyType>::isPageTableManagerSupported(pInHwInfo));
}
HWTEST_F(HwInfoConfigTest, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect) {
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
for (uint32_t testValue = 0; testValue < 0x10; testValue++) {
auto hwRevIdFromStepping = hwInfoConfig.getHwRevIdFromStepping(testValue, pInHwInfo);
if (hwRevIdFromStepping != CommonConstants::invalidStepping) {
pInHwInfo.platform.usRevId = hwRevIdFromStepping;
EXPECT_EQ(testValue, hwInfoConfig.getSteppingFromHwRevId(pInHwInfo));
}
pInHwInfo.platform.usRevId = testValue;
auto steppingFromHwRevId = hwInfoConfig.getSteppingFromHwRevId(pInHwInfo);
if (steppingFromHwRevId != CommonConstants::invalidStepping) {
EXPECT_EQ(testValue, hwInfoConfig.getHwRevIdFromStepping(steppingFromHwRevId, pInHwInfo));
}
}
}
HWTEST_F(HwInfoConfigTest, givenVariousValuesWhenGettingAubStreamSteppingFromHwRevIdThenReturnValuesAreCorrect) {
struct MockHwInfoConfig : HwInfoConfigHw<IGFX_UNKNOWN> {
uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const override {
return returnedStepping;
}
uint32_t returnedStepping = 0;
};
MockHwInfoConfig mockHwInfoConfig;
mockHwInfoConfig.returnedStepping = REVISION_A0;
EXPECT_EQ(AubMemDump::SteppingValues::A, mockHwInfoConfig.getAubStreamSteppingFromHwRevId(pInHwInfo));
mockHwInfoConfig.returnedStepping = REVISION_A1;
EXPECT_EQ(AubMemDump::SteppingValues::A, mockHwInfoConfig.getAubStreamSteppingFromHwRevId(pInHwInfo));
mockHwInfoConfig.returnedStepping = REVISION_A3;
EXPECT_EQ(AubMemDump::SteppingValues::A, mockHwInfoConfig.getAubStreamSteppingFromHwRevId(pInHwInfo));
mockHwInfoConfig.returnedStepping = REVISION_B;
EXPECT_EQ(AubMemDump::SteppingValues::B, mockHwInfoConfig.getAubStreamSteppingFromHwRevId(pInHwInfo));
mockHwInfoConfig.returnedStepping = REVISION_C;
EXPECT_EQ(AubMemDump::SteppingValues::C, mockHwInfoConfig.getAubStreamSteppingFromHwRevId(pInHwInfo));
mockHwInfoConfig.returnedStepping = REVISION_D;
EXPECT_EQ(AubMemDump::SteppingValues::D, mockHwInfoConfig.getAubStreamSteppingFromHwRevId(pInHwInfo));
mockHwInfoConfig.returnedStepping = REVISION_K;
EXPECT_EQ(AubMemDump::SteppingValues::K, mockHwInfoConfig.getAubStreamSteppingFromHwRevId(pInHwInfo));
mockHwInfoConfig.returnedStepping = CommonConstants::invalidStepping;
EXPECT_EQ(AubMemDump::SteppingValues::A, mockHwInfoConfig.getAubStreamSteppingFromHwRevId(pInHwInfo));
}

View File

@ -126,6 +126,30 @@ template <>
uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
switch (getSteppingFromHwRevId(hwInfo)) {
default:
case REVISION_A0:
case REVISION_A1:
case REVISION_A3:
return AubMemDump::SteppingValues::A;
case REVISION_B:
return AubMemDump::SteppingValues::B;
case REVISION_C:
return AubMemDump::SteppingValues::C;
case REVISION_D:
return AubMemDump::SteppingValues::D;
case REVISION_K:
return AubMemDump::SteppingValues::K;
}
}
} // namespace NEO
struct DummyHwConfig : HwInfoConfigHw<IGFX_UNKNOWN> {
@ -651,3 +675,8 @@ HWTEST_F(HwInfoConfigTestLinuxDummy, givenHardwareInfoWhenCallingIsPageTableMana
bool ret = hwConfig.isPageTableManagerSupported(outHwInfo);
EXPECT_FALSE(ret);
}
HWTEST_F(HwInfoConfigTestLinuxDummy, givenHardwareInfoWhenCallingGetSteppingFromHwRevIdThenInvalidSteppingIsReturned) {
uint32_t ret = hwConfig.getSteppingFromHwRevId(outHwInfo);
EXPECT_EQ(CommonConstants::invalidStepping, ret);
}

View File

@ -106,6 +106,30 @@ uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getHwRevIdFromStepping(uint32_t stepping,
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
switch (getSteppingFromHwRevId(hwInfo)) {
default:
case REVISION_A0:
case REVISION_A1:
case REVISION_A3:
return AubMemDump::SteppingValues::A;
case REVISION_B:
return AubMemDump::SteppingValues::B;
case REVISION_C:
return AubMemDump::SteppingValues::C;
case REVISION_D:
return AubMemDump::SteppingValues::D;
case REVISION_K:
return AubMemDump::SteppingValues::K;
}
}
HwInfoConfigTestWindows::HwInfoConfigTestWindows() {
this->executionEnvironment = std::make_unique<MockExecutionEnvironment>();
this->rootDeviceEnvironment = std::make_unique<RootDeviceEnvironment>(*executionEnvironment);
@ -193,4 +217,9 @@ HWTEST_F(HwInfoConfigTestWindows, givenHardwareInfoWhenCallingIsPageTableManager
EXPECT_FALSE(ret);
}
HWTEST_F(HwInfoConfigTestWindows, givenHardwareInfoWhenCallingGetSteppingFromHwRevIdThenInvalidSteppingIsReturned) {
uint32_t ret = hwConfig.getSteppingFromHwRevId(outHwInfo);
EXPECT_EQ(CommonConstants::invalidStepping, ret);
}
} // namespace NEO

View File

@ -380,9 +380,9 @@ XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenBufferWhenProgrammingBltCommandThenS
DebugManager.flags.ForceLocalMemoryAccessMode.set(1);
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
PLATFORM platform = clDevice->getHardwareInfo().platform;
auto &hwHelper = HwHelper::get(platform.eRenderCoreFamily);
const auto &hwInfoConfig = *HwInfoConfig::get(platform.eProductFamily);
const bool isXeHPRev0 = (platform.eProductFamily == IGFX_XE_HP_SDV) &&
(hwHelper.getSteppingFromHwRevId(clDevice->getHardwareInfo()) < REVISION_B);
(hwInfoConfig.getSteppingFromHwRevId(clDevice->getHardwareInfo()) < REVISION_B);
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver);
MockContext context(clDevice.get());

View File

@ -11,6 +11,7 @@
#include "shared/source/debug_settings/debug_settings_manager.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 "third_party/aub_stream/headers/aub_manager.h"
#include "third_party/aub_stream/headers/aubstream.h"
@ -30,7 +31,8 @@ AubCenter::AubCenter(const HardwareInfo *pHwInfo, const GmmHelper &gmmHelper, bo
aubStreamMode = getAubStreamMode(aubFileName, type);
auto &hwHelper = HwHelper::get(pHwInfo->platform.eRenderCoreFamily);
stepping = hwHelper.getAubStreamSteppingFromHwRevId(*pHwInfo);
const auto &hwInfoConfig = *HwInfoConfig::get(pHwInfo->platform.eProductFamily);
stepping = hwInfoConfig.getAubStreamSteppingFromHwRevId(*pHwInfo);
aub_stream::MMIOList extraMmioList = hwHelper.getExtraMmioList(*pHwInfo, gmmHelper);
aub_stream::MMIOList debugMmioList = AubHelper::getAdditionalMmioList();

View File

@ -24,6 +24,7 @@
#include "shared/source/memory_manager/graphics_allocation.h"
#include "shared/source/memory_manager/memory_banks.h"
#include "shared/source/memory_manager/physical_address_allocator.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/os_context.h"
#include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h"
@ -162,6 +163,7 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw<GfxFamily>::create(const std::
TbxCommandStreamReceiverHw<GfxFamily> *csr;
auto &hwInfo = *(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo());
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
if (withAubDump) {
auto localMemoryEnabled = hwHelper.getEnableLocalMemory(hwInfo);
auto fullName = AUBCommandStreamReceiver::createFullFilePath(hwInfo, baseName, rootDeviceIndex);
@ -197,7 +199,7 @@ CommandStreamReceiver *TbxCommandStreamReceiverHw<GfxFamily>::create(const std::
csr->stream->open(nullptr);
// Add the file header.
bool streamInitialized = csr->stream->init(hwHelper.getAubStreamSteppingFromHwRevId(hwInfo), csr->aubDeviceId);
bool streamInitialized = csr->stream->init(hwInfoConfig.getAubStreamSteppingFromHwRevId(hwInfo), csr->aubDeviceId);
csr->streamInitialized = streamInitialized;
}
return csr;

View File

@ -24,7 +24,6 @@ enum class LocalMemoryAccessMode;
namespace Gen12LPHelpers {
bool pipeControlWaRequired(PRODUCT_FAMILY productFamily);
uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo);
bool imagePitchAlignmentWaRequired(PRODUCT_FAMILY productFamily);
void adjustCoherencyFlag(PRODUCT_FAMILY productFamily, bool &coherencyFlag);
bool isLocalMemoryEnabled(const HardwareInfo &hwInfo);

View File

@ -19,18 +19,6 @@ bool pipeControlWaRequired(PRODUCT_FAMILY productFamily) {
return (productFamily == IGFX_TIGERLAKE_LP) || (productFamily == IGFX_DG1);
}
uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) {
if (hwInfo.platform.eProductFamily == PRODUCT_FAMILY::IGFX_DG1) {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x1:
return REVISION_B;
}
}
return CommonConstants::invalidStepping;
}
bool imagePitchAlignmentWaRequired(PRODUCT_FAMILY productFamily) {
return (productFamily == IGFX_TIGERLAKE_LP) || (productFamily == IGFX_DG1);
}

View File

@ -69,38 +69,6 @@ bool HwHelperHw<Family>::isLocalMemoryEnabled(const HardwareInfo &hwInfo) const
return Gen12LPHelpers::isLocalMemoryEnabled(hwInfo);
}
template <>
uint32_t HwHelperHw<Family>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
if (hwInfo.platform.eProductFamily == PRODUCT_FAMILY::IGFX_TIGERLAKE_LP) {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x1:
return REVISION_B;
case 0x3:
return REVISION_C;
}
} else if (hwInfo.platform.eProductFamily == PRODUCT_FAMILY::IGFX_ROCKETLAKE) {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x1:
return REVISION_B;
case 0x4:
return REVISION_C;
}
} else if ((hwInfo.platform.eProductFamily == PRODUCT_FAMILY::IGFX_ALDERLAKE_S) ||
(hwInfo.platform.eProductFamily == PRODUCT_FAMILY::IGFX_ALDERLAKE_P)) {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x4:
return REVISION_B;
}
}
return Gen12LPHelpers::getSteppingFromHwRevId(hwInfo);
}
template <>
bool HwHelperHw<Family>::isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const {
if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) {

View File

@ -15,3 +15,14 @@ uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, c
}
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x4:
return REVISION_B;
}
return CommonConstants::invalidStepping;
}

View File

@ -15,3 +15,14 @@ uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, c
}
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x4:
return REVISION_B;
}
return CommonConstants::invalidStepping;
}

View File

@ -15,3 +15,14 @@ uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, c
}
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x1:
return REVISION_B;
}
return CommonConstants::invalidStepping;
}

View File

@ -17,3 +17,16 @@ uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, c
}
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x1:
return REVISION_B;
case 0x4:
return REVISION_C;
}
return CommonConstants::invalidStepping;
}

View File

@ -17,3 +17,16 @@ uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, c
}
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x1:
return REVISION_B;
case 0x3:
return REVISION_C;
}
return CommonConstants::invalidStepping;
}

View File

@ -108,8 +108,6 @@ class HwHelper {
virtual bool isWaDisableRccRhwoOptimizationRequired() const = 0;
virtual bool isAdditionalFeatureFlagRequired(const FeatureTable *featureTable) const = 0;
virtual uint32_t getMinimalSIMDSize() = 0;
virtual uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const = 0;
virtual uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const = 0;
virtual bool isWorkaroundRequired(uint32_t lowestSteppingWithBug, uint32_t steppingWithFix, const HardwareInfo &hwInfo) const = 0;
virtual bool isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const = 0;
virtual bool is3DPipelineSelectWARequired(const HardwareInfo &hwInfo) const = 0;
@ -286,10 +284,6 @@ class HwHelperHw : public HwHelper {
static AuxTranslationMode getAuxTranslationMode(const HardwareInfo &hwInfo);
uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const override;
uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const override;
bool isWorkaroundRequired(uint32_t lowestSteppingWithBug, uint32_t steppingWithFix, const HardwareInfo &hwInfo) const override;
bool isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const override;

View File

@ -372,30 +372,6 @@ inline bool HwHelperHw<GfxFamily>::isOffsetToSkipSetFFIDGPWARequired(const Hardw
return false;
}
template <typename GfxFamily>
uint32_t HwHelperHw<GfxFamily>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
return CommonConstants::invalidStepping;
}
template <typename GfxFamily>
uint32_t HwHelperHw<GfxFamily>::getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
switch (getSteppingFromHwRevId(hwInfo)) {
default:
case REVISION_A0:
case REVISION_A1:
case REVISION_A3:
return AubMemDump::SteppingValues::A;
case REVISION_B:
return AubMemDump::SteppingValues::B;
case REVISION_C:
return AubMemDump::SteppingValues::C;
case REVISION_D:
return AubMemDump::SteppingValues::D;
case REVISION_K:
return AubMemDump::SteppingValues::K;
}
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isWorkaroundRequired(uint32_t lowestSteppingWithBug, uint32_t steppingWithFix, const HardwareInfo &hwInfo) const {
const auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);

View File

@ -173,7 +173,7 @@ bool MemorySynchronizationCommands<GfxFamily>::isPipeControlWArequired(const Har
template <typename GfxFamily>
inline bool HwHelperHw<GfxFamily>::preferSmallWorkgroupSizeForKernel(const size_t size, const HardwareInfo &hwInfo) const {
if (getSteppingFromHwRevId(hwInfo) >= REVISION_B) {
if (HwInfoConfig::get(hwInfo.platform.eProductFamily)->getSteppingFromHwRevId(hwInfo) >= REVISION_B) {
return false;
}

View File

@ -47,6 +47,8 @@ class HwInfoConfig {
virtual bool obtainBlitterPreference(const HardwareInfo &hwInfo) const = 0;
virtual bool isPageTableManagerSupported(const HardwareInfo &hwInfo) const = 0;
virtual uint32_t getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const = 0;
virtual uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const = 0;
virtual uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const = 0;
uint32_t threadsPerEu;
};
@ -77,6 +79,8 @@ class HwInfoConfigHw : public HwInfoConfig {
bool obtainBlitterPreference(const HardwareInfo &hwInfo) const override;
bool isPageTableManagerSupported(const HardwareInfo &hwInfo) const override;
uint32_t getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const override;
uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const override;
uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const override;
protected:
HwInfoConfigHw() = default;

View File

@ -108,4 +108,28 @@ template <PRODUCT_FAMILY gfxProduct>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
return CommonConstants::invalidStepping;
}
template <PRODUCT_FAMILY gfxProduct>
uint32_t HwInfoConfigHw<gfxProduct>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
return CommonConstants::invalidStepping;
}
template <PRODUCT_FAMILY gfxProduct>
uint32_t HwInfoConfigHw<gfxProduct>::getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
switch (getSteppingFromHwRevId(hwInfo)) {
default:
case REVISION_A0:
case REVISION_A1:
case REVISION_A3:
return AubMemDump::SteppingValues::A;
case REVISION_B:
return AubMemDump::SteppingValues::B;
case REVISION_C:
return AubMemDump::SteppingValues::C;
case REVISION_D:
return AubMemDump::SteppingValues::D;
case REVISION_K:
return AubMemDump::SteppingValues::K;
}
}
} // namespace NEO

View File

@ -61,21 +61,6 @@ bool HwHelperHw<Family>::isDirectSubmissionSupported(const HardwareInfo &hwInfo)
return true;
}
template <>
uint32_t HwHelperHw<Family>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
if (hwInfo.platform.eProductFamily == PRODUCT_FAMILY::IGFX_XE_HP_SDV) {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x1:
return REVISION_A1;
case 0x4:
return REVISION_B;
}
}
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwHelperHw<Family>::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) {
using SHARED_LOCAL_MEMORY_SIZE = typename Family::INTERFACE_DESCRIPTOR_DATA::SHARED_LOCAL_MEMORY_SIZE;
@ -178,7 +163,7 @@ bool HwHelperHw<Family>::isBlitterForImagesSupported(const HardwareInfo &hwInfo)
template <>
bool HwHelperHw<Family>::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const {
return (this->getSteppingFromHwRevId(hwInfo) >= REVISION_B);
return (HwInfoConfig::get(hwInfo.platform.eProductFamily)->getSteppingFromHwRevId(hwInfo) >= REVISION_B);
}
template <>

View File

@ -9,8 +9,8 @@ using namespace NEO;
template <>
bool HwInfoConfigHw<IGFX_XE_HP_SDV>::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const {
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
uint32_t stepping = hwHelper.getSteppingFromHwRevId(hwInfo);
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
uint32_t stepping = hwInfoConfig.getSteppingFromHwRevId(hwInfo);
return REVISION_B > stepping;
}
@ -26,6 +26,20 @@ uint32_t HwInfoConfigHw<IGFX_XE_HP_SDV>::getHwRevIdFromStepping(uint32_t steppin
}
return CommonConstants::invalidStepping;
}
template <>
uint32_t HwInfoConfigHw<IGFX_XE_HP_SDV>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
switch (hwInfo.platform.usRevId) {
case 0x0:
return REVISION_A0;
case 0x1:
return REVISION_A1;
case 0x4:
return REVISION_B;
}
return CommonConstants::invalidStepping;
}
template <>
void HwInfoConfigHw<IGFX_XE_HP_SDV>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) {
using SAMPLER_STATE = typename XeHpFamily::SAMPLER_STATE;