1 /*
2  * Copyright (C) 2020-2021 Intel Corporation
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  */
7 
8 #include "shared/source/aub_mem_dump/definitions/aub_services.h"
9 #include "shared/source/gen12lp/hw_cmds.h"
10 #include "shared/source/helpers/constants.h"
11 
12 #include "engine_node.h"
13 
14 namespace NEO {
15 
16 const char *HwMapper<IGFX_ALDERLAKE_S>::abbreviation = "adls";
17 
isSimulationADLS(unsigned short deviceId)18 bool isSimulationADLS(unsigned short deviceId) {
19     return false;
20 };
21 
22 const PLATFORM ADLS::platform = {
23     IGFX_ALDERLAKE_S,
24     PCH_UNKNOWN,
25     IGFX_GEN12LP_CORE,
26     IGFX_GEN12LP_CORE,
27     PLATFORM_NONE, // default init
28     0,             // usDeviceID
29     0,             // usRevId. 0 sets the stepping to A0
30     0,             // usDeviceID_PCH
31     0,             // usRevId_PCH
32     GTTYPE_UNDEFINED};
33 
34 const RuntimeCapabilityTable ADLS::capabilityTable{
35     EngineDirectSubmissionInitVec{
36         {aub_stream::ENGINE_RCS, {true, true}},
37         {aub_stream::ENGINE_CCS, {true, true}}},    // directSubmissionEngines
38     {0, 0, 0, 0, false, false, false, false},       // kmdNotifyProperties
39     MemoryConstants::max64BitAppAddress,            // gpuAddressSpace
40     0,                                              // sharedSystemMemCapabilities
41     83.333,                                         // defaultProfilingTimerResolution
42     MemoryConstants::pageSize,                      // requiredPreemptionSurfaceSize
43     &isSimulationADLS,                              // isSimulation
44     "lp",                                           // platformType
45     "",                                             // deviceName
46     PreemptionMode::MidThread,                      // defaultPreemptionMode
47     aub_stream::ENGINE_RCS,                         // defaultEngineType
48     0,                                              // maxRenderFrequency
49     30,                                             // clVersionSupport
50     CmdServicesMemTraceVersion::DeviceValues::Adls, // aubDeviceId
51     1,                                              // extraQuantityThreadsPerEU
52     64,                                             // slmSize
53     sizeof(ADLS::GRF),                              // grfSize
54     36u,                                            // timestampValidBits
55     32u,                                            // kernelTimestampValidBits
56     false,                                          // blitterOperationsSupported
57     true,                                           // ftrSupportsInteger64BitAtomics
58     false,                                          // ftrSupportsFP64
59     false,                                          // ftrSupports64BitMath
60     true,                                           // ftrSvm
61     false,                                          // ftrSupportsCoherency
62     false,                                          // ftrSupportsVmeAvcTextureSampler
63     false,                                          // ftrSupportsVmeAvcPreemption
64     false,                                          // ftrRenderCompressedBuffers
65     false,                                          // ftrRenderCompressedImages
66     true,                                           // instrumentationEnabled
67     true,                                           // ftr64KBpages
68     true,                                           // sourceLevelDebuggerSupported
69     false,                                          // supportsVme
70     false,                                          // supportCacheFlushAfterWalker
71     true,                                           // supportsImages
72     false,                                          // supportsDeviceEnqueue
73     false,                                          // supportsPipes
74     true,                                           // supportsOcl21Features
75     false,                                          // supportsOnDemandPageFaults
76     false,                                          // supportsIndependentForwardProgress
77     false,                                          // hostPtrTrackingEnabled
78     true,                                           // levelZeroSupported
79     true,                                           // isIntegratedDevice
80     true,                                           // supportsMediaBlock
81     true                                            // fusedEuEnabled
82 };
83 
84 WorkaroundTable ADLS::workaroundTable = {};
85 FeatureTable ADLS::featureTable = {};
86 
setupFeatureAndWorkaroundTable(HardwareInfo * hwInfo)87 void ADLS::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
88     FeatureTable *featureTable = &hwInfo->featureTable;
89     WorkaroundTable *workaroundTable = &hwInfo->workaroundTable;
90 
91     featureTable->flags.ftrL3IACoherency = true;
92     featureTable->flags.ftrPPGTT = true;
93     featureTable->flags.ftrSVM = true;
94     featureTable->flags.ftrIA32eGfxPTEs = true;
95     featureTable->flags.ftrStandardMipTailFormat = true;
96 
97     featureTable->flags.ftrTranslationTable = true;
98     featureTable->flags.ftrUserModeTranslationTable = true;
99     featureTable->flags.ftrTileMappedResource = true;
100     featureTable->flags.ftrEnableGuC = true;
101 
102     featureTable->flags.ftrFbc = true;
103     featureTable->flags.ftrFbc2AddressTranslation = true;
104     featureTable->flags.ftrFbcBlitterTracking = true;
105     featureTable->flags.ftrFbcCpuTracking = true;
106     featureTable->flags.ftrTileY = true;
107 
108     featureTable->flags.ftrAstcHdr2D = true;
109     featureTable->flags.ftrAstcLdr2D = true;
110 
111     featureTable->flags.ftr3dMidBatchPreempt = true;
112     featureTable->flags.ftrGpGpuMidBatchPreempt = true;
113     featureTable->flags.ftrGpGpuThreadGroupLevelPreempt = true;
114     featureTable->flags.ftrPerCtxtPreemptionGranularityControl = true;
115 
116     workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true;
117     workaroundTable->flags.waEnablePreemptionGranularityControlByUMD = true;
118     workaroundTable->flags.waUntypedBufferCompression = true;
119 };
120 
121 const HardwareInfo ADLS_HW_CONFIG::hwInfo = {
122     &ADLS::platform,
123     &ADLS::featureTable,
124     &ADLS::workaroundTable,
125     &ADLS_HW_CONFIG::gtSystemInfo,
126     ADLS::capabilityTable,
127 };
128 
129 GT_SYSTEM_INFO ADLS_HW_CONFIG::gtSystemInfo = {0};
setupHardwareInfo(HardwareInfo * hwInfo,bool setupFeatureTableAndWorkaroundTable)130 void ADLS_HW_CONFIG::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) {
131     GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo;
132     gtSysInfo->ThreadCount = gtSysInfo->EUCount * ADLS::threadsPerEu;
133     gtSysInfo->DualSubSliceCount = gtSysInfo->SubSliceCount;
134     gtSysInfo->L3CacheSizeInKb = 1920;
135     gtSysInfo->L3BankCount = 4;
136     gtSysInfo->MaxFillRate = 8;
137     gtSysInfo->TotalVsThreads = 0;
138     gtSysInfo->TotalHsThreads = 0;
139     gtSysInfo->TotalDsThreads = 0;
140     gtSysInfo->TotalGsThreads = 0;
141     gtSysInfo->TotalPsThreadsWindowerRange = 64;
142     gtSysInfo->CsrSizeInMb = 8;
143     gtSysInfo->MaxEuPerSubSlice = ADLS::maxEuPerSubslice;
144     gtSysInfo->MaxSlicesSupported = ADLS::maxSlicesSupported;
145     gtSysInfo->MaxSubSlicesSupported = 1;
146     gtSysInfo->MaxDualSubSlicesSupported = 2;
147     gtSysInfo->IsL3HashModeEnabled = false;
148     gtSysInfo->IsDynamicallyPopulated = false;
149 
150     gtSysInfo->CCSInfo.IsValid = true;
151     gtSysInfo->CCSInfo.NumberOfCCSEnabled = 1;
152     gtSysInfo->CCSInfo.Instances.CCSEnableMask = 0b1;
153 
154     if (setupFeatureTableAndWorkaroundTable) {
155         setupFeatureAndWorkaroundTable(hwInfo);
156     }
157 };
158 
159 const HardwareInfo ADLS::hwInfo = ADLS_HW_CONFIG::hwInfo;
160 const uint64_t ADLS::defaultHardwareInfoConfig = 0x100020010;
161 
setupADLSHardwareInfoImpl(HardwareInfo * hwInfo,bool setupFeatureTableAndWorkaroundTable,uint64_t hwInfoConfig)162 void setupADLSHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) {
163     ADLS_HW_CONFIG::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable);
164 }
165 
166 void (*ADLS::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupADLSHardwareInfoImpl;
167 } // namespace NEO
168