fix: use release helper to get ftrXe2Compression value

Related-To: NEO-13381, NEO-13526
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2024-12-23 09:39:18 +00:00
committed by Compute-Runtime-Automation
parent 5bc0633cdb
commit 54e62da553
16 changed files with 37 additions and 33 deletions

View File

@@ -152,7 +152,7 @@ void setupDefaultGtSysInfo(HardwareInfo *hwInfo, const ReleaseHelper *releaseHel
gtSysInfo->ThreadCount = gtSysInfo->EUCount * releaseHelper->getNumThreadsPerEu();
}
void setupDefaultFeatureTableAndWorkaroundTable(HardwareInfo *hwInfo) {
void setupDefaultFeatureTableAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper) {
FeatureTable *featureTable = &hwInfo->featureTable;
featureTable->flags.ftrAstcHdr2D = true;
@@ -172,6 +172,8 @@ void setupDefaultFeatureTableAndWorkaroundTable(HardwareInfo *hwInfo) {
featureTable->flags.ftrTranslationTable = true;
featureTable->flags.ftrUserModeTranslationTable = true;
featureTable->flags.ftrXe2Compression = releaseHelper.getFtrXe2Compression();
WorkaroundTable *workaroundTable = &hwInfo->workaroundTable;
workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true;

View File

@@ -168,7 +168,7 @@ void setHwInfoValuesFromConfig(const uint64_t hwInfoConfig, HardwareInfo &hwInfo
bool parseHwInfoConfigString(const std::string &hwInfoConfigStr, uint64_t &hwInfoConfig);
aub_stream::EngineType getChosenEngineType(const HardwareInfo &hwInfo);
void setupDefaultGtSysInfo(HardwareInfo *hwInfo, const ReleaseHelper *releaseHelper);
void setupDefaultFeatureTableAndWorkaroundTable(HardwareInfo *hwInfo);
void setupDefaultFeatureTableAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper);
uint32_t getNumSubSlicesPerSlice(const HardwareInfo &hwInfo);
} // namespace NEO

View File

@@ -18,7 +18,7 @@ struct BMG : public Xe2HpgCoreFamily {
static WorkaroundTable workaroundTable;
static const RuntimeCapabilityTable capabilityTable;
static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const ReleaseHelper *releaseHelper);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper);
static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper);
static void adjustHardwareInfo(HardwareInfo *hwInfo);

View File

@@ -18,7 +18,7 @@ struct LNL : public Xe2HpgCoreFamily {
static WorkaroundTable workaroundTable;
static const RuntimeCapabilityTable capabilityTable;
static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const ReleaseHelper *releaseHelper);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper);
static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper);
static void adjustHardwareInfo(HardwareInfo *hwInfo);

View File

@@ -86,8 +86,8 @@ const RuntimeCapabilityTable BMG::capabilityTable{
0 // cxlType
};
void BMG::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo);
void BMG::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo, releaseHelper);
FeatureTable *featureTable = &hwInfo->featureTable;
featureTable->flags.ftrLocalMemory = true;
@@ -95,7 +95,6 @@ void BMG::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
featureTable->flags.ftrE2ECompression = true;
featureTable->flags.ftrTile64Optimization = true;
featureTable->flags.ftrWalkerMTP = true;
featureTable->flags.ftrXe2Compression = true;
featureTable->flags.ftrXe2PlusTiling = true;
featureTable->flags.ftrL3TransientDataFlush = true;
featureTable->flags.ftrPml5Support = true;
@@ -122,7 +121,7 @@ void BMG::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndW
BMG::adjustHardwareInfo(hwInfo);
if (setupFeatureTableAndWorkaroundTable) {
BMG::setupFeatureAndWorkaroundTable(hwInfo);
BMG::setupFeatureAndWorkaroundTable(hwInfo, *releaseHelper);
}
}

View File

@@ -84,8 +84,8 @@ const RuntimeCapabilityTable LNL::capabilityTable{
0 // cxlType
};
void LNL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo);
void LNL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo, releaseHelper);
FeatureTable *featureTable = &hwInfo->featureTable;
featureTable->flags.ftrFlatPhysCCS = true;
@@ -117,7 +117,7 @@ void LNL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndW
LNL::adjustHardwareInfo(hwInfo);
if (setupFeatureTableAndWorkaroundTable) {
LNL::setupFeatureAndWorkaroundTable(hwInfo);
LNL::setupFeatureAndWorkaroundTable(hwInfo, *releaseHelper);
}
}
void LnlHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper) {

View File

@@ -39,7 +39,7 @@ struct PVC : public XeHpcCoreFamily {
};
static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const ReleaseHelper *releaseHelper);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper);
static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper);
static void setupHardwareInfoMultiTileBase(HardwareInfo *hwInfo, bool setupMultiTile);
static void adjustHardwareInfo(HardwareInfo *hwInfo);

View File

@@ -96,8 +96,8 @@ const RuntimeCapabilityTable PVC::capabilityTable{
0 // cxlType
};
void PVC::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo);
void PVC::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo, releaseHelper);
FeatureTable *featureTable = &hwInfo->featureTable;
featureTable->flags.ftrLocalMemory = true;
@@ -118,7 +118,7 @@ void PVC::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndW
PVC::adjustHardwareInfo(hwInfo);
if (setupFeatureTableAndWorkaroundTable) {
setupFeatureAndWorkaroundTable(hwInfo);
setupFeatureAndWorkaroundTable(hwInfo, *releaseHelper);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Intel Corporation
* Copyright (C) 2023-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -18,7 +18,7 @@ struct ARL : public XeHpgCoreFamily {
static WorkaroundTable workaroundTable;
static const RuntimeCapabilityTable capabilityTable;
static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const ReleaseHelper *releaseHelper);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper);
static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper);
};

View File

@@ -27,7 +27,7 @@ struct DG2 : public XeHpgCoreFamily {
static WorkaroundTable workaroundTable;
static const RuntimeCapabilityTable capabilityTable;
static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const ReleaseHelper *releaseHelper);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper);
static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper);
static bool isG10(const HardwareInfo &hwInfo) {

View File

@@ -18,7 +18,7 @@ struct MTL : public XeHpgCoreFamily {
static WorkaroundTable workaroundTable;
static const RuntimeCapabilityTable capabilityTable;
static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const ReleaseHelper *releaseHelper);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper);
static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper);
};

View File

@@ -84,8 +84,8 @@ const RuntimeCapabilityTable ARL::capabilityTable{
WorkaroundTable ARL::workaroundTable = {};
FeatureTable ARL::featureTable = {};
void ARL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo);
void ARL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo, releaseHelper);
FeatureTable *featureTable = &hwInfo->featureTable;
WorkaroundTable *workaroundTable = &hwInfo->workaroundTable;
@@ -99,7 +99,7 @@ void ARL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndW
setupDefaultGtSysInfo(hwInfo, releaseHelper);
if (setupFeatureTableAndWorkaroundTable) {
setupFeatureAndWorkaroundTable(hwInfo);
setupFeatureAndWorkaroundTable(hwInfo, *releaseHelper);
}
}
@@ -115,7 +115,7 @@ void ArlHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable
ARL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper);
if (setupFeatureTableAndWorkaroundTable) {
ARL::setupFeatureAndWorkaroundTable(hwInfo);
ARL::setupFeatureAndWorkaroundTable(hwInfo, *releaseHelper);
}
};

View File

@@ -89,8 +89,8 @@ const RuntimeCapabilityTable DG2::capabilityTable{
WorkaroundTable DG2::workaroundTable = {};
FeatureTable DG2::featureTable = {};
void DG2::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo);
void DG2::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo, releaseHelper);
FeatureTable *featureTable = &hwInfo->featureTable;
featureTable->flags.ftrFlatPhysCCS = true;
@@ -105,7 +105,7 @@ void DG2::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndW
setupDefaultGtSysInfo(hwInfo, releaseHelper);
if (setupFeatureTableAndWorkaroundTable) {
setupFeatureAndWorkaroundTable(hwInfo);
setupFeatureAndWorkaroundTable(hwInfo, *releaseHelper);
}
}

View File

@@ -85,8 +85,8 @@ const RuntimeCapabilityTable MTL::capabilityTable{
WorkaroundTable MTL::workaroundTable = {};
FeatureTable MTL::featureTable = {};
void MTL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo);
void MTL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo, const ReleaseHelper &releaseHelper) {
setupDefaultFeatureTableAndWorkaroundTable(hwInfo, releaseHelper);
FeatureTable *featureTable = &hwInfo->featureTable;
WorkaroundTable *workaroundTable = &hwInfo->workaroundTable;
@@ -100,7 +100,7 @@ void MTL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndW
setupDefaultGtSysInfo(hwInfo, releaseHelper);
if (setupFeatureTableAndWorkaroundTable) {
setupFeatureAndWorkaroundTable(hwInfo);
setupFeatureAndWorkaroundTable(hwInfo, *releaseHelper);
}
}
@@ -116,7 +116,7 @@ void MtlHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable
MTL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper);
if (setupFeatureTableAndWorkaroundTable) {
MTL::setupFeatureAndWorkaroundTable(hwInfo);
MTL::setupFeatureAndWorkaroundTable(hwInfo, *releaseHelper);
}
};

View File

@@ -35,6 +35,7 @@
#include "shared/test/common/mocks/mock_io_functions.h"
#include "shared/test/common/mocks/mock_memory_manager.h"
#include "shared/test/common/mocks/mock_product_helper.h"
#include "shared/test/common/mocks/mock_release_helper.h"
#include "shared/test/common/mocks/ult_device_factory.h"
#include "shared/test/common/test_macros/hw_test.h"
#include "shared/test/common/test_macros/test.h"
@@ -1930,9 +1931,9 @@ TEST_F(DeviceTests, givenNewUsmPoolingEnabledWhenDeviceInitializedThenUsmMemAllo
TEST(DeviceWithoutAILTest, givenNoAILWhenCreateDeviceThenDeviceIsCreated) {
DebugManagerStateRestore dbgRestorer;
debugManager.flags.EnableAIL.set(false);
MockReleaseHelper mockReleaseHelper;
auto hwInfo = *defaultHwInfo;
setupDefaultFeatureTableAndWorkaroundTable(&hwInfo);
setupDefaultFeatureTableAndWorkaroundTable(&hwInfo, mockReleaseHelper);
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
EXPECT_NE(nullptr, device.get());

View File

@@ -6,6 +6,7 @@
*/
#include "shared/source/helpers/hw_info.h"
#include "shared/test/common/mocks/mock_release_helper.h"
#include "shared/test/common/test_macros/test.h"
using namespace NEO;
@@ -14,6 +15,7 @@ TEST(HwInfoTest, whenSettingDefaultFeatureTableAndWorkaroundTableThenProperField
HardwareInfo hwInfo{};
FeatureTable expectedFeatureTable{};
WorkaroundTable expectedWorkaroundTable{};
MockReleaseHelper mockReleaseHelper;
expectedFeatureTable.flags.ftrAstcHdr2D = true;
expectedFeatureTable.flags.ftrAstcLdr2D = true;
@@ -34,7 +36,7 @@ TEST(HwInfoTest, whenSettingDefaultFeatureTableAndWorkaroundTableThenProperField
expectedWorkaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface = true;
setupDefaultFeatureTableAndWorkaroundTable(&hwInfo);
setupDefaultFeatureTableAndWorkaroundTable(&hwInfo, mockReleaseHelper);
EXPECT_EQ(expectedFeatureTable.asHash(), hwInfo.featureTable.asHash());
EXPECT_EQ(expectedWorkaroundTable.asHash(), hwInfo.workaroundTable.asHash());