From 4c2d92890f127e8e925a4752b60be982d6e4d0bf Mon Sep 17 00:00:00 2001 From: Piotr Zdunowski Date: Thu, 8 Oct 2020 15:40:40 +0200 Subject: [PATCH] Opensource ADLS. Resolves: NEO-5092 Change-Id: I544247a057a667ce6423f2e59ba4ca769e866479 Signed-off-by: Piotr Zdunowski --- cmake/setup_platform_flags.cmake | 13 +- opencl/source/dll/linux/devices/device_ids.h | 6 +- .../source/dll/linux/devices/devices_base.inl | 5 + opencl/source/gen12lp/hw_info_adls.inl | 168 ++++++++++++++++++ opencl/source/gen12lp/hw_info_config_adls.inl | 26 +++ opencl/source/gen12lp/hw_info_gen12lp.cpp | 3 + .../gen12lp/linux/hw_info_config_adls.inl | 29 +++ .../gen12lp/linux/hw_info_config_gen12lp.cpp | 3 + .../windows/hw_info_config_gen12lp.cpp | 17 ++ .../unit_test/gen12lp/adls/CMakeLists.txt | 18 ++ .../unit_test/gen12lp/adls/excludes_adls.cpp | 28 +++ .../gen12lp/adls/linux/CMakeLists.txt | 14 ++ .../gen12lp/adls/linux/dll/CMakeLists.txt | 11 ++ .../adls/linux/dll/device_id_tests_adls.cpp | 41 +++++ .../adls/linux/hw_info_config_tests_adls.cpp | 104 +++++++++++ .../gen12lp/adls/test_device_caps_adls.cpp | 43 +++++ .../gen12lp/adls/test_hw_info_config_adls.cpp | 63 +++++++ .../gen12lp/adls/windows/CMakeLists.txt | 13 ++ .../windows/hw_info_config_tests_adls.cpp | 27 +++ .../gen12lp/hw_helper_tests_gen12lp.inl | 44 +++++ .../gen12lp/special_ult_helper_gen12lp.cpp | 4 +- shared/source/aub_mem_dump/aub_services.h | 3 +- shared/source/gen12lp/enable_gen12lp.cpp | 4 +- .../gen12lp/enable_hw_info_config_gen12lp.cpp | 3 + shared/source/gen12lp/hw_cmds.h | 3 + shared/source/gen12lp/hw_cmds_adls.h | 35 ++++ shared/source/gen12lp/hw_helper_gen12lp.cpp | 14 ++ shared/source/gen12lp/hw_info.h | 3 + shared/source/gen12lp/hw_info_adls.h | 23 +++ .../gen12lp/hw_cmds_generated_gen12lp.inl | 8 +- .../test/unit_test/test_macros/header/test.h | 11 ++ target_unit_tests/gen12lp/adls/CMakeLists.txt | 10 ++ 32 files changed, 790 insertions(+), 7 deletions(-) create mode 100644 opencl/source/gen12lp/hw_info_adls.inl create mode 100644 opencl/source/gen12lp/hw_info_config_adls.inl create mode 100644 opencl/source/gen12lp/linux/hw_info_config_adls.inl create mode 100644 opencl/test/unit_test/gen12lp/adls/CMakeLists.txt create mode 100644 opencl/test/unit_test/gen12lp/adls/excludes_adls.cpp create mode 100644 opencl/test/unit_test/gen12lp/adls/linux/CMakeLists.txt create mode 100644 opencl/test/unit_test/gen12lp/adls/linux/dll/CMakeLists.txt create mode 100644 opencl/test/unit_test/gen12lp/adls/linux/dll/device_id_tests_adls.cpp create mode 100644 opencl/test/unit_test/gen12lp/adls/linux/hw_info_config_tests_adls.cpp create mode 100644 opencl/test/unit_test/gen12lp/adls/test_device_caps_adls.cpp create mode 100644 opencl/test/unit_test/gen12lp/adls/test_hw_info_config_adls.cpp create mode 100644 opencl/test/unit_test/gen12lp/adls/windows/CMakeLists.txt create mode 100644 opencl/test/unit_test/gen12lp/adls/windows/hw_info_config_tests_adls.cpp create mode 100644 shared/source/gen12lp/hw_cmds_adls.h create mode 100644 shared/source/gen12lp/hw_info_adls.h create mode 100644 target_unit_tests/gen12lp/adls/CMakeLists.txt diff --git a/cmake/setup_platform_flags.cmake b/cmake/setup_platform_flags.cmake index b89f1dd1f7..0a39d3dc0f 100644 --- a/cmake/setup_platform_flags.cmake +++ b/cmake/setup_platform_flags.cmake @@ -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() diff --git a/opencl/source/dll/linux/devices/device_ids.h b/opencl/source/dll/linux/devices/device_ids.h index 713d418e88..8892863cd0 100644 --- a/opencl/source/dll/linux/devices/device_ids.h +++ b/opencl/source/dll/linux/devices/device_ids.h @@ -12,4 +12,8 @@ #define DEVICE_ID_4C8B 0x4C8B #define DEVICE_ID_4C8C 0x4C8C #define DEVICE_ID_4C90 0x4C90 -#define DEVICE_ID_4C9A 0x4C9A \ No newline at end of file +#define DEVICE_ID_4C9A 0x4C9A + +#define DEVICE_ID_4600 0x4600 +#define DEVICE_ID_4680 0x4680 +#define DEVICE_ID_46FF 0x46FF diff --git a/opencl/source/dll/linux/devices/devices_base.inl b/opencl/source/dll/linux/devices/devices_base.inl index 6ec364119f..b2a34ed544 100644 --- a/opencl/source/dll/linux/devices/devices_base.inl +++ b/opencl/source/dll/linux/devices/devices_base.inl @@ -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 diff --git a/opencl/source/gen12lp/hw_info_adls.inl b/opencl/source/gen12lp/hw_info_adls.inl new file mode 100644 index 0000000000..60362a5bb4 --- /dev/null +++ b/opencl/source/gen12lp/hw_info_adls.inl @@ -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::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 diff --git a/opencl/source/gen12lp/hw_info_config_adls.inl b/opencl/source/gen12lp/hw_info_config_adls.inl new file mode 100644 index 0000000000..0e38101da5 --- /dev/null +++ b/opencl/source/gen12lp/hw_info_config_adls.inl @@ -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::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; +} // namespace NEO diff --git a/opencl/source/gen12lp/hw_info_gen12lp.cpp b/opencl/source/gen12lp/hw_info_gen12lp.cpp index acf6fcef71..c31bcc075c 100644 --- a/opencl/source/gen12lp/hw_info_gen12lp.cpp +++ b/opencl/source/gen12lp/hw_info_gen12lp.cpp @@ -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" diff --git a/opencl/source/gen12lp/linux/hw_info_config_adls.inl b/opencl/source/gen12lp/linux/hw_info_config_adls.inl new file mode 100644 index 0000000000..c00682fcf3 --- /dev/null +++ b/opencl/source/gen12lp/linux/hw_info_config_adls.inl @@ -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::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) { + hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.ftrE2ECompression; + hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.ftrE2ECompression; + + return 0; +} + +template <> +void HwInfoConfigHw::adjustPlatformForProductFamily(HardwareInfo *hwInfo) { + PLATFORM *platform = &hwInfo->platform; + platform->eRenderCoreFamily = IGFX_GEN12LP_CORE; + platform->eDisplayCoreFamily = IGFX_GEN12LP_CORE; +} + +template class HwInfoConfigHw; +} // namespace NEO diff --git a/opencl/source/gen12lp/linux/hw_info_config_gen12lp.cpp b/opencl/source/gen12lp/linux/hw_info_config_gen12lp.cpp index 780bc14b18..4fc07bd5b7 100644 --- a/opencl/source/gen12lp/linux/hw_info_config_gen12lp.cpp +++ b/opencl/source/gen12lp/linux/hw_info_config_gen12lp.cpp @@ -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 \ No newline at end of file diff --git a/opencl/source/gen12lp/windows/hw_info_config_gen12lp.cpp b/opencl/source/gen12lp/windows/hw_info_config_gen12lp.cpp index 3c1d782a23..e17de92b60 100644 --- a/opencl/source/gen12lp/windows/hw_info_config_gen12lp.cpp +++ b/opencl/source/gen12lp/windows/hw_info_config_gen12lp.cpp @@ -77,5 +77,22 @@ void HwInfoConfigHw::adjustPlatformForProductFamily(HardwareInf template class HwInfoConfigHw; #endif +#ifdef SUPPORT_ADLS +template <> +int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) { + hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.ftrE2ECompression; + hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.ftrE2ECompression; + return 0; +} + +template <> +void HwInfoConfigHw::adjustPlatformForProductFamily(HardwareInfo *hwInfo) { + PLATFORM *platform = &hwInfo->platform; + platform->eRenderCoreFamily = IGFX_GEN12LP_CORE; + platform->eDisplayCoreFamily = IGFX_GEN12LP_CORE; +} + +template class HwInfoConfigHw; +#endif } // namespace NEO diff --git a/opencl/test/unit_test/gen12lp/adls/CMakeLists.txt b/opencl/test/unit_test/gen12lp/adls/CMakeLists.txt new file mode 100644 index 0000000000..8f89d28b65 --- /dev/null +++ b/opencl/test/unit_test/gen12lp/adls/CMakeLists.txt @@ -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() diff --git a/opencl/test/unit_test/gen12lp/adls/excludes_adls.cpp b/opencl/test/unit_test/gen12lp/adls/excludes_adls.cpp new file mode 100644 index 0000000000..12b37acf43 --- /dev/null +++ b/opencl/test/unit_test/gen12lp/adls/excludes_adls.cpp @@ -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); diff --git a/opencl/test/unit_test/gen12lp/adls/linux/CMakeLists.txt b/opencl/test/unit_test/gen12lp/adls/linux/CMakeLists.txt new file mode 100644 index 0000000000..662c71496f --- /dev/null +++ b/opencl/test/unit_test/gen12lp/adls/linux/CMakeLists.txt @@ -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() diff --git a/opencl/test/unit_test/gen12lp/adls/linux/dll/CMakeLists.txt b/opencl/test/unit_test/gen12lp/adls/linux/dll/CMakeLists.txt new file mode 100644 index 0000000000..c7488abb7b --- /dev/null +++ b/opencl/test/unit_test/gen12lp/adls/linux/dll/CMakeLists.txt @@ -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}) diff --git a/opencl/test/unit_test/gen12lp/adls/linux/dll/device_id_tests_adls.cpp b/opencl/test/unit_test/gen12lp/adls/linux/dll/device_id_tests_adls.cpp new file mode 100644 index 0000000000..5bc4b1a0a2 --- /dev/null +++ b/opencl/test/unit_test/gen12lp/adls/linux/dll/device_id_tests_adls.cpp @@ -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 + +using namespace NEO; + +TEST(AdlsDeviceIdTest, supportedDeviceId) { + std::array 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++; + } +} diff --git a/opencl/test/unit_test/gen12lp/adls/linux/hw_info_config_tests_adls.cpp b/opencl/test/unit_test/gen12lp/adls/linux/hw_info_config_tests_adls.cpp new file mode 100644 index 0000000000..5bb595c1c9 --- /dev/null +++ b/opencl/test/unit_test/gen12lp/adls/linux/hw_info_config_tests_adls.cpp @@ -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(drm->StoredDeviceID), outHwInfo.platform.usDeviceID); + EXPECT_EQ(static_cast(drm->StoredDeviceRevID), outHwInfo.platform.usRevId); + EXPECT_EQ(static_cast(drm->StoredEUVal), outHwInfo.gtSystemInfo.EUCount); + EXPECT_EQ(static_cast(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->prepareRootDeviceEnvironments(1); + executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get()); + DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); + GT_SYSTEM_INFO >SystemInfo = 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); +} diff --git a/opencl/test/unit_test/gen12lp/adls/test_device_caps_adls.cpp b/opencl/test/unit_test/gen12lp/adls/test_device_caps_adls.cpp new file mode 100644 index 0000000000..ef162ffede --- /dev/null +++ b/opencl/test/unit_test/gen12lp/adls/test_device_caps_adls.cpp @@ -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; + +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); +} diff --git a/opencl/test/unit_test/gen12lp/adls/test_hw_info_config_adls.cpp b/opencl/test/unit_test/gen12lp/adls/test_hw_info_config_adls.cpp new file mode 100644 index 0000000000..c37cc72246 --- /dev/null +++ b/opencl/test/unit_test/gen12lp/adls/test_hw_info_config_adls.cpp @@ -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 >SystemInfo = 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); +} diff --git a/opencl/test/unit_test/gen12lp/adls/windows/CMakeLists.txt b/opencl/test/unit_test/gen12lp/adls/windows/CMakeLists.txt new file mode 100644 index 0000000000..6d30355f5d --- /dev/null +++ b/opencl/test/unit_test/gen12lp/adls/windows/CMakeLists.txt @@ -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() diff --git a/opencl/test/unit_test/gen12lp/adls/windows/hw_info_config_tests_adls.cpp b/opencl/test/unit_test/gen12lp/adls/windows/hw_info_config_tests_adls.cpp new file mode 100644 index 0000000000..78a6258458 --- /dev/null +++ b/opencl/test/unit_test/gen12lp/adls/windows/hw_info_config_tests_adls.cpp @@ -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); +} diff --git a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl index a6d880c932..a0d136c476 100644 --- a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl @@ -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 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 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)); + } + } +} diff --git a/opencl/test/unit_test/gen12lp/special_ult_helper_gen12lp.cpp b/opencl/test/unit_test/gen12lp/special_ult_helper_gen12lp.cpp index 3167817b73..032cc07806 100644 --- a/opencl/test/unit_test/gen12lp/special_ult_helper_gen12lp.cpp +++ b/opencl/test/unit_test/gen12lp/special_ult_helper_gen12lp.cpp @@ -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; } diff --git a/shared/source/aub_mem_dump/aub_services.h b/shared/source/aub_mem_dump/aub_services.h index 832703c866..48d1dde991 100644 --- a/shared/source/aub_mem_dump/aub_services.h +++ b/shared/source/aub_mem_dump/aub_services.h @@ -101,7 +101,8 @@ struct CmdServicesMemTraceVersion { Lkf = 25, Ehl = 28, Dg1 = 30, - Tgllp = 22 + Tgllp = 22, + Adls = 37 }; }; struct RecordingMethodValues { diff --git a/shared/source/gen12lp/enable_gen12lp.cpp b/shared/source/gen12lp/enable_gen12lp.cpp index 7f790b79a2..d002ece37f 100644 --- a/shared/source/gen12lp/enable_gen12lp.cpp +++ b/shared/source/gen12lp/enable_gen12lp.cpp @@ -21,5 +21,7 @@ static EnableGfxProductHw enableGfxProductHwDG1; #ifdef SUPPORT_RKL static EnableGfxProductHw enableGfxProductHwRKL; #endif - +#ifdef SUPPORT_ADLS +static EnableGfxProductHw enableGfxProductHwADLS; +#endif } // namespace NEO diff --git a/shared/source/gen12lp/enable_hw_info_config_gen12lp.cpp b/shared/source/gen12lp/enable_hw_info_config_gen12lp.cpp index d77dfdfb59..dedefff186 100644 --- a/shared/source/gen12lp/enable_hw_info_config_gen12lp.cpp +++ b/shared/source/gen12lp/enable_hw_info_config_gen12lp.cpp @@ -19,4 +19,7 @@ static EnableProductHwInfoConfig enableDG1; #ifdef SUPPORT_RKL static EnableProductHwInfoConfig enableRKL; #endif +#ifdef SUPPORT_ADLS +static EnableProductHwInfoConfig enableADLS; +#endif } // namespace NEO diff --git a/shared/source/gen12lp/hw_cmds.h b/shared/source/gen12lp/hw_cmds.h index 7061281921..e5ef818727 100644 --- a/shared/source/gen12lp/hw_cmds.h +++ b/shared/source/gen12lp/hw_cmds.h @@ -16,3 +16,6 @@ #ifdef SUPPORT_RKL #include "hw_cmds_rkl.h" #endif +#ifdef SUPPORT_ADLS +#include "hw_cmds_adls.h" +#endif diff --git a/shared/source/gen12lp/hw_cmds_adls.h b/shared/source/gen12lp/hw_cmds_adls.h new file mode 100644 index 0000000000..0ebf16b6ef --- /dev/null +++ b/shared/source/gen12lp/hw_cmds_adls.h @@ -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 diff --git a/shared/source/gen12lp/hw_helper_gen12lp.cpp b/shared/source/gen12lp/hw_helper_gen12lp.cpp index 36b4fb1673..337514d3c5 100644 --- a/shared/source/gen12lp/hw_helper_gen12lp.cpp +++ b/shared/source/gen12lp/hw_helper_gen12lp.cpp @@ -88,6 +88,13 @@ uint32_t HwHelperHw::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::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); } diff --git a/shared/source/gen12lp/hw_info.h b/shared/source/gen12lp/hw_info.h index fa56be62e1..46bf2ab00d 100644 --- a/shared/source/gen12lp/hw_info.h +++ b/shared/source/gen12lp/hw_info.h @@ -15,3 +15,6 @@ #ifdef SUPPORT_RKL #include "hw_info_rkl.h" #endif +#ifdef SUPPORT_ADLS +#include "hw_info_adls.h" +#endif diff --git a/shared/source/gen12lp/hw_info_adls.h b/shared/source/gen12lp/hw_info_adls.h new file mode 100644 index 0000000000..b6f1607fbc --- /dev/null +++ b/shared/source/gen12lp/hw_info_adls.h @@ -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 { + enum { gfxFamily = IGFX_GEN12LP_CORE }; + + static const char *abbreviation; + using GfxFamily = GfxFamilyMapper(gfxFamily)>::GfxFamily; + using GfxProduct = ADLS; +}; +} // namespace NEO diff --git a/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl b/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl index e746149247..439bb0050e 100644 --- a/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl +++ b/shared/source/generated/gen12lp/hw_cmds_generated_gen12lp.inl @@ -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; diff --git a/shared/test/unit_test/test_macros/header/test.h b/shared/test/unit_test/test_macros/header/test.h index 15d4a919fe..32b81a96ce 100644 --- a/shared/test/unit_test/test_macros/header/test.h +++ b/shared/test/unit_test/test_macros/header/test.h @@ -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(), \ + 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 \ @@ -1086,3 +1096,4 @@ using IsLKF = IsProduct; using IsSKL = IsProduct; using IsTGLLP = IsProduct; using IsRKL = IsProduct; +using IsADLS = IsProduct; diff --git a/target_unit_tests/gen12lp/adls/CMakeLists.txt b/target_unit_tests/gen12lp/adls/CMakeLists.txt new file mode 100644 index 0000000000..41b9df7545 --- /dev/null +++ b/target_unit_tests/gen12lp/adls/CMakeLists.txt @@ -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()