@@ -247,6 +247,14 @@ struct StateSaveAreaHeader Xe2SIPCSRDebugBindlessDebugHeader =
247
247
}
248
248
};
249
249
250
+
251
+ // wmtp LNL SIP
252
+ struct StateSaveAreaHeaderV4 Xe2SIP_WMTP_CSRDebugBindlessDebugHeader =
253
+ {
254
+ {" tssarea" , 0 , {4 , 0 , 0 }, sizeof (StateSaveAreaHeaderV4) / 8 , {0 , 0 , 0 }}, // versionHeader
255
+ 0 // total_wmtp_data_size
256
+ };
257
+
250
258
// Debug surface area for all XeHPC+ architectures
251
259
struct XeHPCDebugSurfaceLayout
252
260
{
@@ -868,7 +876,7 @@ bool CSystemThread::CreateSystemThreadKernel(
868
876
869
877
if ( pKernelProgram )
870
878
{
871
- pKernelProgram->Create ( platform, mode, bindlessMode, SLM_ANY );
879
+ pKernelProgram->Create ( platform, mode, bindlessMode);
872
880
873
881
pSystemThreadKernelOutput->m_KernelProgramSize = pKernelProgram->GetProgramSize ();
874
882
pSystemThreadKernelOutput->m_StateSaveAreaHeaderSize = pKernelProgram->GetStateSaveHeaderSize ();
@@ -958,108 +966,6 @@ void CSystemThread::DeleteSystemThreadKernel(
958
966
pSystemThreadKernelOutput = nullptr ;
959
967
}
960
968
961
- bool
962
- CSystemThread::CreateSystemThreadKernel_v2 (const PLATFORM &platform, const IGC::SCompilerHwCaps &Caps,
963
- const GT_SYSTEM_INFO &sysInfo, const SYSTEM_THREAD_MODE mode,
964
- USC::SSystemThreadKernelOutput *&pSystemThreadKernelOutput,
965
- SLM_SIZE_SUPPORTED slmSize)
966
- {
967
- if (!SIPSuppoertedOnPlatformFamily (platform.eRenderCoreFamily ))
968
- {
969
- return false ;
970
- }
971
-
972
- bool success = true ;
973
-
974
- // Check if the System Thread mode in the correct range.
975
- // SYSTEM_THREAD_MODE_CSR_64B is not yet supported.
976
- if (!(mode & SYSTEM_THREAD_MODE_CSR))
977
- {
978
- success = false ;
979
- }
980
-
981
- // Create System Thread kernel program.
982
- if (success)
983
- {
984
- CGenSystemInstructionKernelProgram *pKernelProgram = new CGenSystemInstructionKernelProgram (mode);
985
- success = pKernelProgram ? true : false ;
986
- // Allocate memory for SSystemThreadKernelOutput.
987
- if (success)
988
- {
989
- pSystemThreadKernelOutput = new SSystemThreadKernelOutput;
990
-
991
- success = (pSystemThreadKernelOutput != nullptr );
992
-
993
- if (success)
994
- {
995
- memset (pSystemThreadKernelOutput, 0 , sizeof (SSystemThreadKernelOutput));
996
- }
997
- }
998
-
999
- const unsigned int DQWORD_SIZE = 2 * sizeof (unsigned long long );
1000
-
1001
- if (pKernelProgram)
1002
- {
1003
- pKernelProgram->Create (platform, mode, true , slmSize);
1004
-
1005
- pSystemThreadKernelOutput->m_KernelProgramSize = pKernelProgram->GetProgramSize ();
1006
- pSystemThreadKernelOutput->m_StateSaveAreaHeaderSize = pKernelProgram->GetStateSaveHeaderSize ();
1007
-
1008
- if (mode & SYSTEM_THREAD_MODE_CSR)
1009
- pSystemThreadKernelOutput->m_SystemThreadScratchSpace =
1010
- Caps.KernelHwCaps .CsrSizeInMb * sizeof (MEGABYTE);
1011
-
1012
- if (mode & (SYSTEM_THREAD_MODE_DEBUG | SYSTEM_THREAD_MODE_DEBUG_LOCAL))
1013
- pSystemThreadKernelOutput->m_SystemThreadResourceSize =
1014
- Caps.KernelHwCaps .CsrSizeInMb * 2 * sizeof (MEGABYTE);
1015
-
1016
- pSystemThreadKernelOutput->m_pKernelProgram =
1017
- IGC::aligned_malloc (pSystemThreadKernelOutput->m_KernelProgramSize , DQWORD_SIZE);
1018
-
1019
- if (pSystemThreadKernelOutput->m_StateSaveAreaHeaderSize )
1020
- pSystemThreadKernelOutput->m_pStateSaveAreaHeader =
1021
- IGC::aligned_malloc (pSystemThreadKernelOutput->m_StateSaveAreaHeaderSize , DQWORD_SIZE);
1022
-
1023
- success = (pSystemThreadKernelOutput->m_pKernelProgram != nullptr );
1024
- if (pSystemThreadKernelOutput->m_StateSaveAreaHeaderSize )
1025
- success &= (pSystemThreadKernelOutput->m_pStateSaveAreaHeader != nullptr );
1026
- }
1027
-
1028
- if (success)
1029
- {
1030
- const void *pStartAddress = pKernelProgram->GetLinearAddress ();
1031
- const void *pStateSaveAddress = pKernelProgram->GetStateSaveHeaderAddress ();
1032
-
1033
- if (!pStartAddress || (pSystemThreadKernelOutput->m_StateSaveAreaHeaderSize && !pStateSaveAddress))
1034
- {
1035
- success = false ;
1036
- }
1037
-
1038
- if (success)
1039
- {
1040
- memcpy_s (pSystemThreadKernelOutput->m_pKernelProgram , pSystemThreadKernelOutput->m_KernelProgramSize ,
1041
- pStartAddress, pSystemThreadKernelOutput->m_KernelProgramSize );
1042
-
1043
- if (pSystemThreadKernelOutput->m_StateSaveAreaHeaderSize )
1044
- memcpy_s (pSystemThreadKernelOutput->m_pStateSaveAreaHeader ,
1045
- pSystemThreadKernelOutput->m_StateSaveAreaHeaderSize , pStateSaveAddress,
1046
- pSystemThreadKernelOutput->m_StateSaveAreaHeaderSize );
1047
- }
1048
- }
1049
- else
1050
- {
1051
- success = false ;
1052
- }
1053
-
1054
- if (pKernelProgram)
1055
- {
1056
- pKernelProgram->Delete (pKernelProgram);
1057
- delete pKernelProgram;
1058
- }
1059
- }
1060
- return success;
1061
- }
1062
-
1063
969
// populate the SIPKernelInfo map with starting address and size of every SIP kernels
1064
970
void populateSIPKernelInfo (const IGC::CPlatform &platform,
1065
971
std::map< unsigned char , std::tuple<void *, unsigned int , void *, unsigned int > > &SIPKernelInfo)
@@ -1197,25 +1103,25 @@ void populateSIPKernelInfo(const IGC::CPlatform &platform,
1197
1103
// LNL 1x4 128
1198
1104
SIPKernelInfo[XE2_CSR_DEBUG_BINDLESS_LNL_1x4_128] = std::make_tuple (
1199
1105
(void *)&XE2_LNL_1x4_128, (int )sizeof (XE2_LNL_1x4_128),
1200
- (void *)&XE2_LNL_1x4_128, XE2_CSR_DEBUG_BINDLESS_LNL_1x4_128_WMTP_DATA_SIZE );
1106
+ (void *)&Xe2SIP_WMTP_CSRDebugBindlessDebugHeader, ( int ) sizeof (Xe2SIP_WMTP_CSRDebugBindlessDebugHeader) );
1201
1107
1202
1108
// LNL 1x4 160
1203
1109
SIPKernelInfo[XE2_CSR_DEBUG_BINDLESS_LNL_1x4_160] = std::make_tuple (
1204
1110
(void *)&XE2_LNL_1x4_160, (int )sizeof (XE2_LNL_1x4_160),
1205
- (void *)&XE2_LNL_1x4_160, XE2_CSR_DEBUG_BINDLESS_LNL_1x4_160_WMTP_DATA_SIZE );
1111
+ (void *)&Xe2SIP_WMTP_CSRDebugBindlessDebugHeader, ( int ) sizeof (Xe2SIP_WMTP_CSRDebugBindlessDebugHeader) );
1206
1112
1207
1113
1208
1114
1209
1115
// LNL 2x4 128
1210
1116
SIPKernelInfo[XE2_CSR_DEBUG_BINDLESS_LNL_2x4_128] =
1211
1117
std::make_tuple ((void *)&XE2_LNL_2x4_128,
1212
1118
(int )sizeof (XE2_LNL_2x4_128),
1213
- (void *)&XE2_LNL_2x4_128, XE2_CSR_DEBUG_BINDLESS_LNL_2x4_128_WMTP_DATA_SIZE );
1119
+ (void *)&Xe2SIP_WMTP_CSRDebugBindlessDebugHeader, ( int ) sizeof (Xe2SIP_WMTP_CSRDebugBindlessDebugHeader) );
1214
1120
1215
1121
// LNL 2x4 160
1216
1122
SIPKernelInfo[XE2_CSR_DEBUG_BINDLESS_LNL_2x4_160] = std::make_tuple (
1217
1123
(void *)&XE2_LNL_2x4_160, (int )sizeof (XE2_LNL_2x4_160),
1218
- (void *)&XE2_LNL_2x4_160, XE2_CSR_DEBUG_BINDLESS_LNL_2x4_160_WMTP_DATA_SIZE );
1124
+ (void *)&Xe2SIP_WMTP_CSRDebugBindlessDebugHeader, ( int ) sizeof (Xe2SIP_WMTP_CSRDebugBindlessDebugHeader) );
1219
1125
1220
1126
}
1221
1127
@@ -1224,10 +1130,9 @@ void populateSIPKernelInfo(const IGC::CPlatform &platform,
1224
1130
CGenSystemInstructionKernelProgram* CGenSystemInstructionKernelProgram::Create (
1225
1131
const IGC::CPlatform &platform,
1226
1132
const SYSTEM_THREAD_MODE mode,
1227
- const bool bindlessMode,
1228
- SLM_SIZE_SUPPORTED slmSize)
1133
+ const bool bindlessMode)
1229
1134
{
1230
- unsigned char SIPIndex = 0 ;
1135
+ unsigned char SIPIndex = GEN_SIP_MAX_INDEX ;
1231
1136
std::map< unsigned char , std::tuple<void *, unsigned int , void *, unsigned int > > SIPKernelInfo;
1232
1137
populateSIPKernelInfo (platform, SIPKernelInfo);
1233
1138
@@ -1357,6 +1262,8 @@ CGenSystemInstructionKernelProgram* CGenSystemInstructionKernelProgram::Create(
1357
1262
}
1358
1263
else if (mode == SYSTEM_THREAD_MODE_CSR)
1359
1264
{
1265
+ uint32_t slices = sysInfo.MaxSlicesSupported ;
1266
+ uint32_t subslices_per_slice =(sysInfo.MaxSlicesSupported > 0 ? (sysInfo.MaxSubSlicesSupported / sysInfo.MaxSlicesSupported ) : sysInfo.MaxSubSlicesSupported );
1360
1267
switch (platform.getPlatformInfo ().eProductFamily )
1361
1268
{
1362
1269
case IGFX_TIGERLAKE_LP:
@@ -1375,27 +1282,43 @@ CGenSystemInstructionKernelProgram* CGenSystemInstructionKernelProgram::Create(
1375
1282
case IGFX_METEORLAKE:
1376
1283
case IGFX_ARROWLAKE:
1377
1284
case IGFX_LUNARLAKE:
1378
- if (sysInfo. SliceCount == 1 && sysInfo. SubSliceCount == 4 )
1285
+ if (slices == 1 && subslices_per_slice == 4 )
1379
1286
{
1380
- if (slmSize == SLM_128)
1287
+ if (sysInfo. SLMSizeInKb == SLM_128)
1381
1288
{
1382
1289
SIPIndex = XE2_CSR_DEBUG_BINDLESS_LNL_1x4_128;
1290
+ Xe2SIP_WMTP_CSRDebugBindlessDebugHeader.total_wmtp_data_size = XE2_CSR_DEBUG_BINDLESS_LNL_1x4_128_WMTP_DATA_SIZE;
1383
1291
}
1384
- else if (slmSize == SLM_160)
1292
+ else if (sysInfo. SLMSizeInKb == SLM_160)
1385
1293
{
1386
1294
SIPIndex = XE2_CSR_DEBUG_BINDLESS_LNL_1x4_160;
1295
+ Xe2SIP_WMTP_CSRDebugBindlessDebugHeader.total_wmtp_data_size = XE2_CSR_DEBUG_BINDLESS_LNL_1x4_160_WMTP_DATA_SIZE;
1296
+ }
1297
+ else
1298
+ {
1299
+ IGC_ASSERT (false );
1387
1300
}
1388
1301
}
1389
- else if (sysInfo. SliceCount == 2 && sysInfo. SubSliceCount == 4 )
1302
+ else if (slices == 2 && subslices_per_slice == 4 )
1390
1303
{
1391
- if (slmSize == SLM_128)
1304
+ if (sysInfo. SLMSizeInKb == SLM_128)
1392
1305
{
1393
1306
SIPIndex = XE2_CSR_DEBUG_BINDLESS_LNL_2x4_128;
1307
+ Xe2SIP_WMTP_CSRDebugBindlessDebugHeader.total_wmtp_data_size = XE2_CSR_DEBUG_BINDLESS_LNL_2x4_128_WMTP_DATA_SIZE;
1394
1308
}
1395
- else if (slmSize == SLM_160)
1309
+ else if (sysInfo. SLMSizeInKb == SLM_160)
1396
1310
{
1397
1311
SIPIndex = XE2_CSR_DEBUG_BINDLESS_LNL_2x4_160;
1312
+ Xe2SIP_WMTP_CSRDebugBindlessDebugHeader.total_wmtp_data_size = XE2_CSR_DEBUG_BINDLESS_LNL_2x4_160_WMTP_DATA_SIZE;
1398
1313
}
1314
+ else
1315
+ {
1316
+ IGC_ASSERT (false );
1317
+ }
1318
+ }
1319
+ else
1320
+ {
1321
+ IGC_ASSERT (false );
1399
1322
}
1400
1323
break ;
1401
1324
0 commit comments