Opensource ADLS.

Resolves: NEO-5092

Change-Id: I544247a057a667ce6423f2e59ba4ca769e866479
Signed-off-by: Piotr Zdunowski <piotr.zdunowski@intel.com>
This commit is contained in:
Piotr Zdunowski
2020-10-08 15:40:40 +02:00
committed by sys_ocldev
parent 9bb8700b62
commit 4c2d92890f
32 changed files with 790 additions and 7 deletions

View File

@@ -7,7 +7,7 @@
SET_FLAGS_FOR("GEN8" "BDW")
SET_FLAGS_FOR("GEN9" "SKL" "KBL" "BXT" "GLK" "CFL")
SET_FLAGS_FOR("GEN11" "ICLLP" "LKF" "EHL")
SET_FLAGS_FOR("GEN12LP" "TGLLP" "RKL")
SET_FLAGS_FOR("GEN12LP" "TGLLP" "RKL" "ADLS")
# Add supported and tested platforms
if(SUPPORT_GEN8)
@@ -171,4 +171,15 @@ if(SUPPORT_GEN12LP)
ADD_PRODUCT("TESTED" "RKL" "IGFX_ROCKETLAKE")
endif()
endif()
if(SUPPORT_ADLS)
ADD_PRODUCT("SUPPORTED" "ADLS" "IGFX_ALDERLAKE_S")
ADD_PLATFORM_FOR_GEN("SUPPORTED" "GEN12LP" "ADLS" "LP")
ADD_PLATFORM_FOR_GEN("SUPPORTED_2_0" "GEN12LP" "ADLS" "LP")
ADD_PLATFORM_FOR_GEN("SUPPORTED_IMAGES" "GEN12LP" "ADLS" "LP")
if(TESTS_ADLS)
ADD_ITEM_FOR_GEN("PLATFORMS" "TESTED" "GEN12LP" "ADLS")
ADD_PRODUCT("TESTED" "ADLS" "IGFX_ALDERLAKE_S")
endif()
endif()
endif()

View File

@@ -12,4 +12,8 @@
#define DEVICE_ID_4C8B 0x4C8B
#define DEVICE_ID_4C8C 0x4C8C
#define DEVICE_ID_4C90 0x4C90
#define DEVICE_ID_4C9A 0x4C9A
#define DEVICE_ID_4C9A 0x4C9A
#define DEVICE_ID_4600 0x4600
#define DEVICE_ID_4680 0x4680
#define DEVICE_ID_46FF 0x46FF

View File

@@ -33,6 +33,11 @@ DEVICE( DEVICE_ID_4C8C, RKL_HW_CONFIG, GTTYPE_GT0_5 )
DEVICE( DEVICE_ID_4C90, RKL_HW_CONFIG, GTTYPE_GT1 )
DEVICE( DEVICE_ID_4C9A, RKL_HW_CONFIG, GTTYPE_GT1 )
#endif
#ifdef SUPPORT_ADLS
DEVICE( DEVICE_ID_4680, ADLS_HW_CONFIG, GTTYPE_GT1 )
DEVICE( DEVICE_ID_46FF, ADLS_HW_CONFIG, GTTYPE_GT1 )
DEVICE( DEVICE_ID_4600, ADLS_HW_CONFIG, GTTYPE_GT1 )
#endif
#endif
#ifdef SUPPORT_GEN11

View File

@@ -0,0 +1,168 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/aub_mem_dump/aub_services.h"
#include "shared/source/gen12lp/hw_cmds.h"
#include "shared/source/helpers/constants.h"
#include "engine_node.h"
namespace NEO {
const char *HwMapper<IGFX_ALDERLAKE_S>::abbreviation = "adls";
bool isSimulationADLS(unsigned short deviceId) {
switch (deviceId) {
case 0x4680:
return true;
}
return false;
};
const PLATFORM ADLS::platform = {
IGFX_ALDERLAKE_S,
PCH_UNKNOWN,
IGFX_GEN12LP_CORE,
IGFX_GEN12LP_CORE,
PLATFORM_NONE, // default init
0, // usDeviceID
0, // usRevId. 0 sets the stepping to A0
0, // usDeviceID_PCH
0, // usRevId_PCH
GTTYPE_UNDEFINED};
const RuntimeCapabilityTable ADLS::capabilityTable{
EngineDirectSubmissionInitVec{
{aub_stream::ENGINE_RCS, {true, true}},
{aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines
{0, 0, 0, false, false, false}, // kmdNotifyProperties
MemoryConstants::max64BitAppAddress, // gpuAddressSpace
83.333, // defaultProfilingTimerResolution
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
&isSimulationADLS, // isSimulation
PreemptionMode::MidThread, // defaultPreemptionMode
aub_stream::ENGINE_RCS, // defaultEngineType
0, // maxRenderFrequency
30, // clVersionSupport
CmdServicesMemTraceVersion::DeviceValues::Adls, // aubDeviceId
1, // extraQuantityThreadsPerEU
64, // slmSize
sizeof(ADLS::GRF), // grfSize
36u, // timestampValidBits
32u, // kernelTimestampValidBits
false, // blitterOperationsSupported
true, // ftrSupportsInteger64BitAtomics
false, // ftrSupportsFP64
false, // ftrSupports64BitMath
true, // ftrSvm
false, // ftrSupportsCoherency
false, // ftrSupportsVmeAvcTextureSampler
false, // ftrSupportsVmeAvcPreemption
false, // ftrRenderCompressedBuffers
false, // ftrRenderCompressedImages
true, // instrumentationEnabled
true, // forceStatelessCompilationFor32Bit
true, // ftr64KBpages
"lp", // platformType
true, // sourceLevelDebuggerSupported
false, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
false, // supportsDeviceEnqueue
false, // supportsPipes
true, // supportsOcl21Features
false, // supportsOnDemandPageFaults
false, // supportsIndependentForwardProgress
false, // hostPtrTrackingEnabled
false, // levelZeroSupported
true // isIntegratedDevice
};
WorkaroundTable ADLS::workaroundTable = {};
FeatureTable ADLS::featureTable = {};
void ADLS::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
FeatureTable *featureTable = &hwInfo->featureTable;
WorkaroundTable *workaroundTable = &hwInfo->workaroundTable;
featureTable->ftrL3IACoherency = true;
featureTable->ftrPPGTT = true;
featureTable->ftrSVM = true;
featureTable->ftrIA32eGfxPTEs = true;
featureTable->ftrStandardMipTailFormat = true;
featureTable->ftrTranslationTable = true;
featureTable->ftrUserModeTranslationTable = true;
featureTable->ftrTileMappedResource = true;
featureTable->ftrEnableGuC = true;
featureTable->ftrFbc = true;
featureTable->ftrFbc2AddressTranslation = true;
featureTable->ftrFbcBlitterTracking = true;
featureTable->ftrFbcCpuTracking = true;
featureTable->ftrTileY = true;
featureTable->ftrAstcHdr2D = true;
featureTable->ftrAstcLdr2D = true;
featureTable->ftr3dMidBatchPreempt = true;
featureTable->ftrGpGpuMidBatchPreempt = true;
featureTable->ftrGpGpuThreadGroupLevelPreempt = true;
featureTable->ftrPerCtxtPreemptionGranularityControl = true;
workaroundTable->wa4kAlignUVOffsetNV12LinearSurface = true;
workaroundTable->waEnablePreemptionGranularityControlByUMD = true;
workaroundTable->waUntypedBufferCompression = true;
};
const HardwareInfo ADLS_HW_CONFIG::hwInfo = {
&ADLS::platform,
&ADLS::featureTable,
&ADLS::workaroundTable,
&ADLS_HW_CONFIG::gtSystemInfo,
ADLS::capabilityTable,
};
GT_SYSTEM_INFO ADLS_HW_CONFIG::gtSystemInfo = {0};
void ADLS_HW_CONFIG::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) {
GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo;
gtSysInfo->ThreadCount = gtSysInfo->EUCount * ADLS::threadsPerEu;
gtSysInfo->DualSubSliceCount = gtSysInfo->SubSliceCount / 2;
gtSysInfo->L3CacheSizeInKb = 1920;
gtSysInfo->L3BankCount = 4;
gtSysInfo->MaxFillRate = 8;
gtSysInfo->TotalVsThreads = 0;
gtSysInfo->TotalHsThreads = 0;
gtSysInfo->TotalDsThreads = 0;
gtSysInfo->TotalGsThreads = 0;
gtSysInfo->TotalPsThreadsWindowerRange = 64;
gtSysInfo->CsrSizeInMb = 8;
gtSysInfo->MaxEuPerSubSlice = ADLS::maxEuPerSubslice;
gtSysInfo->MaxSlicesSupported = ADLS::maxSlicesSupported;
gtSysInfo->MaxSubSlicesSupported = 1;
gtSysInfo->MaxDualSubSlicesSupported = 2;
gtSysInfo->IsL3HashModeEnabled = false;
gtSysInfo->IsDynamicallyPopulated = false;
gtSysInfo->CCSInfo.IsValid = true;
gtSysInfo->CCSInfo.NumberOfCCSEnabled = 1;
gtSysInfo->CCSInfo.Instances.CCSEnableMask = 0b1;
if (setupFeatureTableAndWorkaroundTable) {
setupFeatureAndWorkaroundTable(hwInfo);
}
};
const HardwareInfo ADLS::hwInfo = ADLS_HW_CONFIG::hwInfo;
const uint64_t ADLS::defaultHardwareInfoConfig = 0x100020016;
void setupADLSHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) {
ADLS_HW_CONFIG::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable);
}
void (*ADLS::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupADLSHardwareInfoImpl;
} // namespace NEO

View File

@@ -0,0 +1,26 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/hw_info_config.h"
namespace NEO {
template <>
int HwInfoConfigHw<IGFX_ALDERLAKE_S>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
if (nullptr == osIface) {
return 0;
}
GT_SYSTEM_INFO *gtSystemInfo = &hwInfo->gtSystemInfo;
gtSystemInfo->SliceCount = 1;
HwHelper &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
hwInfo->featureTable.ftrGpGpuMidThreadLevelPreempt = (hwInfo->platform.usRevId >= hwHelper.getHwRevIdFromStepping(REVISION_C, *hwInfo));
return 0;
}
template class HwInfoConfigHw<IGFX_ALDERLAKE_S>;
} // namespace NEO

View File

@@ -14,6 +14,9 @@
#ifdef SUPPORT_RKL
#include "hw_info_rkl.inl"
#endif
#ifdef SUPPORT_ADLS
#include "hw_info_adls.inl"
#endif
#include "shared/source/gen12lp/hw_info_gen12lp.h"

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/hw_info.h"
#include "shared/source/os_interface/hw_info_config.h"
namespace NEO {
template <>
int HwInfoConfigHw<IGFX_ALDERLAKE_S>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.ftrE2ECompression;
hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.ftrE2ECompression;
return 0;
}
template <>
void HwInfoConfigHw<IGFX_ALDERLAKE_S>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
PLATFORM *platform = &hwInfo->platform;
platform->eRenderCoreFamily = IGFX_GEN12LP_CORE;
platform->eDisplayCoreFamily = IGFX_GEN12LP_CORE;
}
template class HwInfoConfigHw<IGFX_ALDERLAKE_S>;
} // namespace NEO

View File

@@ -16,4 +16,7 @@
#endif
#ifdef SUPPORT_RKL
#include "hw_info_config_rkl.inl"
#endif
#ifdef SUPPORT_ADLS
#include "hw_info_config_adls.inl"
#endif

View File

@@ -77,5 +77,22 @@ void HwInfoConfigHw<IGFX_ROCKETLAKE>::adjustPlatformForProductFamily(HardwareInf
template class HwInfoConfigHw<IGFX_ROCKETLAKE>;
#endif
#ifdef SUPPORT_ADLS
template <>
int HwInfoConfigHw<IGFX_ALDERLAKE_S>::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) {
hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.ftrE2ECompression;
hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.ftrE2ECompression;
return 0;
}
template <>
void HwInfoConfigHw<IGFX_ALDERLAKE_S>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
PLATFORM *platform = &hwInfo->platform;
platform->eRenderCoreFamily = IGFX_GEN12LP_CORE;
platform->eDisplayCoreFamily = IGFX_GEN12LP_CORE;
}
template class HwInfoConfigHw<IGFX_ALDERLAKE_S>;
#endif
} // namespace NEO

View File

@@ -0,0 +1,18 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_ADLS)
set(IGDRCL_SRCS_tests_gen12lp_adls
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_adls.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_adls.cpp
${CMAKE_CURRENT_SOURCE_DIR}/excludes_adls.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen12lp_adls})
add_subdirectories()
neo_copy_test_files_with_revision(copy_test_files_adls_0 adls 0)
add_dependencies(copy_test_files_per_product copy_test_files_adls_0)
endif()

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "test.h"
namespace NEO {
HWCMDTEST_EXCLUDE_FAMILY(ProfilingTests, GivenCommandQueueBlockedWithProfilingWhenWalkerIsDispatchedThenMiStoreRegisterMemIsPresentInCS, IGFX_ALDERLAKE_S);
HWCMDTEST_EXCLUDE_FAMILY(ProfilingTests, GivenCommandQueueWithProflingWhenWalkerIsDispatchedThenMiStoreRegisterMemIsPresentInCS, IGFX_ALDERLAKE_S);
HWCMDTEST_EXCLUDE_FAMILY(EventProfilingTest, givenEventWhenCompleteIsZeroThenCalcProfilingDataSetsEndTimestampInCompleteTimestampAndDoesntCallOsTimeMethods, IGFX_ALDERLAKE_S);
HWCMDTEST_EXCLUDE_FAMILY(EventProfilingTests, givenRawTimestampsDebugModeWhenDataIsQueriedThenRawDataIsReturned, IGFX_ALDERLAKE_S);
HWCMDTEST_EXCLUDE_FAMILY(EventProfilingTest, givenRawTimestampsDebugModeWhenStartTimeStampLTQueueTimeStampThenIncreaseStartTimeStamp, IGFX_ALDERLAKE_S);
HWCMDTEST_EXCLUDE_FAMILY(ProfilingWithPerfCountersTests, GivenCommandQueueWithProfilingPerfCountersWhenWalkerIsDispatchedThenRegisterStoresArePresentInCS, IGFX_ALDERLAKE_S);
HWCMDTEST_EXCLUDE_FAMILY(TimestampEventCreate, givenEventTimestampsWhenQueryKernelTimestampThenCorrectDataAreSet, IGFX_ALDERLAKE_S);
} // namespace NEO
HWCMDTEST_EXCLUDE_FAMILY(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsTakenThenTimeStampAddressIsProgrammedCorrectly, IGFX_ALDERLAKE_S);
HWCMDTEST_EXCLUDE_FAMILY(ProfilingCommandsTest, givenKernelWhenProfilingCommandStartIsNotTakenThenTimeStampAddressIsProgrammedCorrectly, IGFX_ALDERLAKE_S);

View File

@@ -0,0 +1,14 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
set(IGDRCL_SRCS_tests_gen12_adls_linux
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests_adls.cpp
)
if(UNIX)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen12_adls_linux})
add_subdirectory(dll)
endif()

View File

@@ -0,0 +1,11 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
set(IGDRCL_SRCS_linux_dll_tests_gen12_adls
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/device_id_tests_adls.cpp
)
target_sources(igdrcl_linux_dll_tests PRIVATE ${IGDRCL_SRCS_linux_dll_tests_gen12_adls})

View File

@@ -0,0 +1,41 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen12lp/hw_cmds_adls.h"
#include "shared/source/os_interface/linux/drm_neo.h"
#include "opencl/source/dll/linux/devices/device_ids.h"
#include "test.h"
#include <array>
using namespace NEO;
TEST(AdlsDeviceIdTest, supportedDeviceId) {
std::array<DeviceDescriptor, 3> expectedDescriptors = {{
{DEVICE_ID_4680, &ADLS_HW_CONFIG::hwInfo, &ADLS_HW_CONFIG::setupHardwareInfo, GTTYPE_GT1},
{DEVICE_ID_46FF, &ADLS_HW_CONFIG::hwInfo, &ADLS_HW_CONFIG::setupHardwareInfo, GTTYPE_GT1},
{DEVICE_ID_4600, &ADLS_HW_CONFIG::hwInfo, &ADLS_HW_CONFIG::setupHardwareInfo, GTTYPE_GT1},
}};
auto compareStructs = [](const DeviceDescriptor *first, const DeviceDescriptor *second) {
return first->deviceId == second->deviceId && first->pHwInfo == second->pHwInfo &&
first->setupHardwareInfo == second->setupHardwareInfo && first->eGtType == second->eGtType;
};
size_t startIndex = 0;
while (!compareStructs(&expectedDescriptors[0], &deviceDescriptorTable[startIndex]) &&
deviceDescriptorTable[startIndex].deviceId != 0) {
startIndex++;
};
EXPECT_NE(0u, deviceDescriptorTable[startIndex].deviceId);
for (auto &expected : expectedDescriptors) {
EXPECT_TRUE(compareStructs(&expected, &deviceDescriptorTable[startIndex]));
startIndex++;
}
}

View File

@@ -0,0 +1,104 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/linux/os_interface.h"
#include "opencl/test/unit_test/helpers/gtest_helpers.h"
#include "opencl/test/unit_test/os_interface/linux/drm_mock.h"
#include "opencl/test/unit_test/os_interface/linux/hw_info_config_linux_tests.h"
using namespace NEO;
struct HwInfoConfigTestLinuxAdls : HwInfoConfigTestLinux {
void SetUp() override {
HwInfoConfigTestLinux::SetUp();
drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]);
osInterface->get()->setDrm(drm);
drm->StoredDeviceID = IGFX_ALDERLAKE_S;
drm->setGtType(GTTYPE_GT1);
}
};
ADLSTEST_F(HwInfoConfigTestLinuxAdls, configureHwInfoAdls) {
auto hwInfoConfig = HwInfoConfig::get(productFamily);
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
EXPECT_EQ(0, ret);
EXPECT_EQ(static_cast<unsigned short>(drm->StoredDeviceID), outHwInfo.platform.usDeviceID);
EXPECT_EQ(static_cast<unsigned short>(drm->StoredDeviceRevID), outHwInfo.platform.usRevId);
EXPECT_EQ(static_cast<uint32_t>(drm->StoredEUVal), outHwInfo.gtSystemInfo.EUCount);
EXPECT_EQ(static_cast<uint32_t>(drm->StoredSSVal), outHwInfo.gtSystemInfo.SubSliceCount);
EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount);
EXPECT_EQ(GTTYPE_GT1, outHwInfo.platform.eGTType);
EXPECT_TRUE(outHwInfo.featureTable.ftrGT1);
EXPECT_FALSE(outHwInfo.featureTable.ftrGT1_5);
EXPECT_FALSE(outHwInfo.featureTable.ftrGT2);
EXPECT_FALSE(outHwInfo.featureTable.ftrGT3);
EXPECT_FALSE(outHwInfo.featureTable.ftrGT4);
EXPECT_FALSE(outHwInfo.featureTable.ftrGTA);
EXPECT_FALSE(outHwInfo.featureTable.ftrGTC);
EXPECT_FALSE(outHwInfo.featureTable.ftrGTX);
EXPECT_FALSE(outHwInfo.featureTable.ftrTileY);
}
ADLSTEST_F(HwInfoConfigTestLinuxAdls, whenCallAdjustPlatformThenDoNothing) {
auto hwInfoConfig = HwInfoConfig::get(productFamily);
outHwInfo = pInHwInfo;
hwInfoConfig->adjustPlatformForProductFamily(&outHwInfo);
int ret = memcmp(&outHwInfo.platform, &pInHwInfo.platform, sizeof(PLATFORM));
EXPECT_EQ(0, ret);
}
ADLSTEST_F(HwInfoConfigTestLinuxAdls, negative) {
auto hwInfoConfig = HwInfoConfig::get(productFamily);
drm->StoredRetValForDeviceID = -1;
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
EXPECT_EQ(-1, ret);
drm->StoredRetValForDeviceID = 0;
drm->StoredRetValForDeviceRevID = -1;
ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
EXPECT_EQ(-1, ret);
drm->StoredRetValForDeviceRevID = 0;
drm->failRetTopology = true;
drm->StoredRetValForEUVal = -1;
ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
EXPECT_EQ(-1, ret);
drm->StoredRetValForEUVal = 0;
drm->StoredRetValForSSVal = -1;
ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
EXPECT_EQ(-1, ret);
}
TEST(AdlsHwInfoTests, gtSetupIsCorrect) {
HardwareInfo hwInfo;
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
DeviceDescriptor device = {0, &hwInfo, &ADLS_HW_CONFIG::setupHardwareInfo, GTTYPE_GT1};
int ret = drm.setupHardwareInfo(&device, false);
EXPECT_EQ(ret, 0);
EXPECT_GT(gtSystemInfo.EUCount, 0u);
EXPECT_GT(gtSystemInfo.ThreadCount, 0u);
EXPECT_GT(gtSystemInfo.SliceCount, 0u);
EXPECT_GT(gtSystemInfo.SubSliceCount, 0u);
EXPECT_GT_VAL(gtSystemInfo.L3CacheSizeInKb, 0u);
EXPECT_EQ(gtSystemInfo.CsrSizeInMb, 8u);
EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated);
EXPECT_GT(gtSystemInfo.DualSubSliceCount, 0u);
EXPECT_GT(gtSystemInfo.MaxDualSubSlicesSupported, 0u);
}

View File

@@ -0,0 +1,43 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/source/dll/linux/devices/device_ids.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
#include "test.h"
using namespace NEO;
using AdlsUsDeviceIdTest = Test<ClDeviceFixture>;
ADLSTEST_F(AdlsUsDeviceIdTest, isSimulationCap) {
unsigned short adlsSimulationIds[2] = {
DEVICE_ID_4680,
0, // default, non-simulation
};
NEO::MockDevice *mockDevice = nullptr;
for (auto id : adlsSimulationIds) {
mockDevice = createWithUsDeviceId(id);
ASSERT_NE(mockDevice, nullptr);
if (id == 0)
EXPECT_FALSE(mockDevice->isSimulation());
else
EXPECT_TRUE(mockDevice->isSimulation());
delete mockDevice;
}
}
ADLSTEST_F(AdlsUsDeviceIdTest, givenADLSWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
}
ADLSTEST_F(AdlsUsDeviceIdTest, givenAdlsWhenRequestedVmeFlagsThenReturnFalse) {
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsVme);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcTextureSampler);
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcPreemption);
}

View File

@@ -0,0 +1,63 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/hw_helper.h"
#include "opencl/source/helpers/hardware_commands_helper.h"
#include "test.h"
using namespace NEO;
using AdlsHwInfo = ::testing::Test;
ADLSTEST_F(AdlsHwInfo, givenBoolWhenCallAdlsHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
static bool boolValue[]{
true, false};
HardwareInfo hwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
uint64_t config = 0x100020016;
for (auto setParamBool : boolValue) {
gtSystemInfo = {0};
featureTable = {};
workaroundTable = {};
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
EXPECT_EQ(setParamBool, featureTable.ftrL3IACoherency);
EXPECT_EQ(setParamBool, featureTable.ftrPPGTT);
EXPECT_EQ(setParamBool, featureTable.ftrSVM);
EXPECT_EQ(setParamBool, featureTable.ftrIA32eGfxPTEs);
EXPECT_EQ(setParamBool, featureTable.ftrStandardMipTailFormat);
EXPECT_EQ(setParamBool, featureTable.ftrTranslationTable);
EXPECT_EQ(setParamBool, featureTable.ftrUserModeTranslationTable);
EXPECT_EQ(setParamBool, featureTable.ftrTileMappedResource);
EXPECT_EQ(setParamBool, featureTable.ftrEnableGuC);
EXPECT_EQ(setParamBool, featureTable.ftrFbc);
EXPECT_EQ(setParamBool, featureTable.ftrFbc2AddressTranslation);
EXPECT_EQ(setParamBool, featureTable.ftrFbcBlitterTracking);
EXPECT_EQ(setParamBool, featureTable.ftrFbcCpuTracking);
EXPECT_EQ(setParamBool, featureTable.ftrTileY);
EXPECT_EQ(setParamBool, featureTable.ftrAstcHdr2D);
EXPECT_EQ(setParamBool, featureTable.ftrAstcLdr2D);
EXPECT_EQ(setParamBool, featureTable.ftr3dMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.ftrGpGpuMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.ftrGpGpuThreadGroupLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.ftrPerCtxtPreemptionGranularityControl);
EXPECT_EQ(setParamBool, workaroundTable.wa4kAlignUVOffsetNV12LinearSurface);
EXPECT_EQ(setParamBool, workaroundTable.waEnablePreemptionGranularityControlByUMD);
EXPECT_EQ(setParamBool, workaroundTable.waUntypedBufferCompression);
}
}
ADLSTEST_F(AdlsHwInfo, whenPlatformIsAdlsThenExpectSvmIsSet) {
const HardwareInfo &hardwareInfo = ADLS::hwInfo;
EXPECT_TRUE(hardwareInfo.capabilityTable.ftrSvm);
}

View File

@@ -0,0 +1,13 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
set(IGDRCL_SRCS_tests_gen12_adls_windows
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests_adls.cpp
)
if(WIN32)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen12_adls_windows})
endif()

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/windows/os_interface.h"
#include "opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.h"
using namespace NEO;
using HwInfoConfigTestWindowsAdls = HwInfoConfigTestWindows;
ADLSTEST_F(HwInfoConfigTestWindowsAdls, whenCallAdjustPlatformThenDoNothing) {
EXPECT_EQ(IGFX_ALDERLAKE_S, productFamily);
auto hwInfoConfig = HwInfoConfig::get(productFamily);
PLATFORM *testPlatform = &outHwInfo.platform;
testPlatform->eDisplayCoreFamily = IGFX_GEN11_CORE;
testPlatform->eRenderCoreFamily = IGFX_GEN11_CORE;
hwInfoConfig->adjustPlatformForProductFamily(&outHwInfo);
EXPECT_EQ(IGFX_GEN12LP_CORE, testPlatform->eRenderCoreFamily);
EXPECT_EQ(IGFX_GEN12LP_CORE, testPlatform->eDisplayCoreFamily);
}

View File

@@ -424,3 +424,47 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenL1ForceDisabledWhenRequestingMocsThenPro
EXPECT_EQ(mocsL3, helper.getMocsIndex(*gmmHelper, true, false));
EXPECT_EQ(mocsL3, helper.getMocsIndex(*gmmHelper, true, true));
}
HWTEST2_F(HwHelperTestGen12Lp, givenRevisionEnumThenProperValueForIsWorkaroundRequiredIsReturned, IsRKL) {
std::vector<unsigned short> steppings;
HardwareInfo hardwareInfo = *defaultHwInfo;
steppings.push_back(0x0); //A0
steppings.push_back(0x4); //B0
steppings.push_back(0x5); //undefined
for (auto stepping : steppings) {
hardwareInfo.platform.usRevId = stepping;
HwHelper &hwHelper = HwHelper::get(renderCoreFamily);
if (stepping == 0x0) {
EXPECT_TRUE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, hardwareInfo));
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_B, REVISION_A0, hardwareInfo));
} else if (stepping == 0x1 || stepping == 0x5) {
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_D, hardwareInfo));
}
}
}
HWTEST2_F(HwHelperTestGen12Lp, givenRevisionEnumThenProperValueForIsWorkaroundRequiredIsReturned, IsADLS) {
std::vector<unsigned short> steppings;
HardwareInfo hardwareInfo = *defaultHwInfo;
steppings.push_back(0x0); //A0
steppings.push_back(0x4); //B0
steppings.push_back(0x5); //undefined
for (auto stepping : steppings) {
hardwareInfo.platform.usRevId = stepping;
HwHelper &hwHelper = HwHelper::get(renderCoreFamily);
if (stepping == 0x0) {
EXPECT_TRUE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, hardwareInfo));
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_B, REVISION_A0, hardwareInfo));
} else if (stepping == 0x4 || stepping == 0x5) {
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_D, hardwareInfo));
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, hardwareInfo));
EXPECT_FALSE(hwHelper.isWorkaroundRequired(REVISION_B, REVISION_A0, hardwareInfo));
}
}
}

View File

@@ -16,7 +16,7 @@ bool SpecialUltHelperGen12lp::additionalCoherencyCheck(PRODUCT_FAMILY productFam
}
bool SpecialUltHelperGen12lp::shouldPerformimagePitchAlignment(PRODUCT_FAMILY productFamily) {
if (productFamily == IGFX_ROCKETLAKE) {
if (productFamily == IGFX_ROCKETLAKE || productFamily == IGFX_ALDERLAKE_S) {
return false;
}
@@ -28,7 +28,7 @@ bool SpecialUltHelperGen12lp::shouldTestDefaultImplementationOfSetupHardwareCapa
}
bool SpecialUltHelperGen12lp::isPipeControlWArequired(PRODUCT_FAMILY productFamily) {
if (productFamily == IGFX_ROCKETLAKE) {
if (productFamily == IGFX_ROCKETLAKE || productFamily == IGFX_ALDERLAKE_S) {
return false;
}

View File

@@ -101,7 +101,8 @@ struct CmdServicesMemTraceVersion {
Lkf = 25,
Ehl = 28,
Dg1 = 30,
Tgllp = 22
Tgllp = 22,
Adls = 37
};
};
struct RecordingMethodValues {

View File

@@ -21,5 +21,7 @@ static EnableGfxProductHw<IGFX_DG1> enableGfxProductHwDG1;
#ifdef SUPPORT_RKL
static EnableGfxProductHw<IGFX_ROCKETLAKE> enableGfxProductHwRKL;
#endif
#ifdef SUPPORT_ADLS
static EnableGfxProductHw<IGFX_ALDERLAKE_S> enableGfxProductHwADLS;
#endif
} // namespace NEO

View File

@@ -19,4 +19,7 @@ static EnableProductHwInfoConfig<IGFX_DG1> enableDG1;
#ifdef SUPPORT_RKL
static EnableProductHwInfoConfig<IGFX_ROCKETLAKE> enableRKL;
#endif
#ifdef SUPPORT_ADLS
static EnableProductHwInfoConfig<IGFX_ALDERLAKE_S> enableADLS;
#endif
} // namespace NEO

View File

@@ -16,3 +16,6 @@
#ifdef SUPPORT_RKL
#include "hw_cmds_rkl.h"
#endif
#ifdef SUPPORT_ADLS
#include "hw_cmds_adls.h"
#endif

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/gen12lp/hw_cmds_base.h"
namespace NEO {
struct ADLS : public TGLLPFamily {
static const PLATFORM platform;
static const HardwareInfo hwInfo;
static const uint64_t defaultHardwareInfoConfig;
static FeatureTable featureTable;
static WorkaroundTable workaroundTable;
static const uint32_t threadsPerEu = 7;
static const uint32_t maxEuPerSubslice = 16;
static const uint32_t maxSlicesSupported = 1;
static const uint32_t maxSubslicesSupported = 6;
static const uint32_t maxDualSubslicesSupported = 12;
static const RuntimeCapabilityTable capabilityTable;
static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig);
static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo);
};
class ADLS_HW_CONFIG : public ADLS {
public:
static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable);
static const HardwareInfo hwInfo;
private:
static GT_SYSTEM_INFO gtSystemInfo;
};
} // namespace NEO

View File

@@ -88,6 +88,13 @@ uint32_t HwHelperHw<Family>::getHwRevIdFromStepping(uint32_t stepping, const Har
case REVISION_C:
return 0x4;
}
} else if (hwInfo.platform.eProductFamily == PRODUCT_FAMILY::IGFX_ALDERLAKE_S) {
switch (stepping) {
case REVISION_A0:
return 0x0;
case REVISION_B:
return 0x4;
}
}
return Gen12LPHelpers::getHwRevIdFromStepping(stepping, hwInfo);
}
@@ -112,6 +119,13 @@ uint32_t HwHelperHw<Family>::getSteppingFromHwRevId(uint32_t hwRevId, const Hard
case 0x4:
return REVISION_C;
}
} else if (hwInfo.platform.eProductFamily == PRODUCT_FAMILY::IGFX_ALDERLAKE_S) {
switch (hwRevId) {
case 0x0:
return REVISION_A0;
case 0x4:
return REVISION_B;
}
}
return Gen12LPHelpers::getSteppingFromHwRevId(hwRevId, hwInfo);
}

View File

@@ -15,3 +15,6 @@
#ifdef SUPPORT_RKL
#include "hw_info_rkl.h"
#endif
#ifdef SUPPORT_ADLS
#include "hw_info_adls.h"
#endif

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "hw_info_gen12lp.h"
namespace NEO {
struct ADLS;
template <>
struct HwMapper<IGFX_ALDERLAKE_S> {
enum { gfxFamily = IGFX_GEN12LP_CORE };
static const char *abbreviation;
using GfxFamily = GfxFamilyMapper<static_cast<GFXCORE_FAMILY>(gfxFamily)>::GfxFamily;
using GfxProduct = ADLS;
};
} // namespace NEO

View File

@@ -1656,7 +1656,7 @@ typedef struct tagPIPELINE_SELECT {
uint32_t MediaSamplerDopClockGateEnable : BITFIELD_RANGE(4, 4);
uint32_t Reserved_5 : BITFIELD_RANGE(5, 5);
uint32_t MediaSamplerPowerClockGateDisable : BITFIELD_RANGE(6, 6);
uint32_t Reserved_7 : BITFIELD_RANGE(7, 7);
uint32_t SpecialModeEnable : BITFIELD_RANGE(7, 7); // ADL-only, patched
uint32_t MaskBits : BITFIELD_RANGE(8, 15);
uint32_t _3DCommandSubOpcode : BITFIELD_RANGE(16, 23);
uint32_t _3DCommandOpcode : BITFIELD_RANGE(24, 26);
@@ -1729,6 +1729,12 @@ typedef struct tagPIPELINE_SELECT {
inline bool getMediaSamplerPowerClockGateDisable(void) const {
return TheStructure.Common.MediaSamplerPowerClockGateDisable;
}
inline void setSpecialModeEnable(const bool value) {
TheStructure.Common.SpecialModeEnable = value;
}
inline bool getSpecialModeEnable(void) const {
return TheStructure.Common.SpecialModeEnable;
}
inline void setMaskBits(const uint32_t value) {
UNRECOVERABLE_IF(value > 0xff);
TheStructure.Common.MaskBits = value;

View File

@@ -929,6 +929,16 @@ extern GFXCORE_FAMILY renderCoreFamily;
IGFX_GEN12LP_CORE, \
IGFX_ROCKETLAKE)
#endif
#ifdef TESTS_ADLS
#define ADLSTEST_F(test_fixture, test_name) \
FAMILYTEST_TEST_(test_fixture, test_name, test_fixture, \
::testing::internal::GetTypeId<test_fixture>(), \
IGFX_GEN12LP_CORE, IGFX_ALDERLAKE_S)
#define ADLSTEST_P(test_suite_name, test_name) \
FAMILYTEST_TEST_P(test_suite_name, test_name, \
IGFX_GEN12LP_CORE, \
IGFX_ALDERLAKE_S)
#endif
#define HWTEST_TYPED_TEST(CaseName, TestName) \
CHECK_TEST_NAME_LENGTH(CaseName, TestName) \
template <typename gtest_TypeParam_> \
@@ -1086,3 +1096,4 @@ using IsLKF = IsProduct<IGFX_LAKEFIELD>;
using IsSKL = IsProduct<IGFX_SKYLAKE>;
using IsTGLLP = IsProduct<IGFX_TIGERLAKE_LP>;
using IsRKL = IsProduct<IGFX_ROCKETLAKE>;
using IsADLS = IsProduct<IGFX_ALDERLAKE_S>;

View File

@@ -0,0 +1,10 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_ADLS)
set(unit_test_config "adls/1/2/16/0")
include(${NEO_SOURCE_DIR}/cmake/run_ult_target.cmake)
endif()