Skip to content

Commit 92dc998

Browse files
nlellaigcbot
authored andcommitted
Update functions to get wmtp SIP
Update functions to get wmtp SIP
1 parent 46c61c8 commit 92dc998

File tree

3 files changed

+49
-127
lines changed

3 files changed

+49
-127
lines changed

IGC/common/StateSaveAreaHeader.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,11 @@ struct StateSaveAreaHeaderV3
143143
struct intelgt_state_save_area_V3 regHeader;
144144
};
145145

146+
// versionHeader.version.major = 4
147+
struct StateSaveAreaHeaderV4
148+
{
149+
struct StateSaveArea versionHeader;
150+
uint64_t total_wmtp_data_size;
151+
};
152+
146153
} // namespace SIP

IGC/common/SystemThread.cpp

Lines changed: 39 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,14 @@ struct StateSaveAreaHeader Xe2SIPCSRDebugBindlessDebugHeader =
247247
}
248248
};
249249

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+
250258
// Debug surface area for all XeHPC+ architectures
251259
struct XeHPCDebugSurfaceLayout
252260
{
@@ -868,7 +876,7 @@ bool CSystemThread::CreateSystemThreadKernel(
868876

869877
if( pKernelProgram )
870878
{
871-
pKernelProgram->Create( platform, mode, bindlessMode, SLM_ANY);
879+
pKernelProgram->Create( platform, mode, bindlessMode);
872880

873881
pSystemThreadKernelOutput->m_KernelProgramSize = pKernelProgram->GetProgramSize();
874882
pSystemThreadKernelOutput->m_StateSaveAreaHeaderSize = pKernelProgram->GetStateSaveHeaderSize();
@@ -958,108 +966,6 @@ void CSystemThread::DeleteSystemThreadKernel(
958966
pSystemThreadKernelOutput = nullptr;
959967
}
960968

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-
1063969
//populate the SIPKernelInfo map with starting address and size of every SIP kernels
1064970
void populateSIPKernelInfo(const IGC::CPlatform &platform,
1065971
std::map< unsigned char, std::tuple<void*, unsigned int, void*, unsigned int> > &SIPKernelInfo)
@@ -1197,25 +1103,25 @@ void populateSIPKernelInfo(const IGC::CPlatform &platform,
11971103
// LNL 1x4 128
11981104
SIPKernelInfo[XE2_CSR_DEBUG_BINDLESS_LNL_1x4_128] = std::make_tuple(
11991105
(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));
12011107

12021108
// LNL 1x4 160
12031109
SIPKernelInfo[XE2_CSR_DEBUG_BINDLESS_LNL_1x4_160] = std::make_tuple(
12041110
(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));
12061112

12071113

12081114

12091115
// LNL 2x4 128
12101116
SIPKernelInfo[XE2_CSR_DEBUG_BINDLESS_LNL_2x4_128] =
12111117
std::make_tuple((void *)&XE2_LNL_2x4_128,
12121118
(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));
12141120

12151121
// LNL 2x4 160
12161122
SIPKernelInfo[XE2_CSR_DEBUG_BINDLESS_LNL_2x4_160] = std::make_tuple(
12171123
(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));
12191125

12201126
}
12211127

@@ -1224,10 +1130,9 @@ void populateSIPKernelInfo(const IGC::CPlatform &platform,
12241130
CGenSystemInstructionKernelProgram* CGenSystemInstructionKernelProgram::Create(
12251131
const IGC::CPlatform &platform,
12261132
const SYSTEM_THREAD_MODE mode,
1227-
const bool bindlessMode,
1228-
SLM_SIZE_SUPPORTED slmSize)
1133+
const bool bindlessMode)
12291134
{
1230-
unsigned char SIPIndex = 0;
1135+
unsigned char SIPIndex = GEN_SIP_MAX_INDEX;
12311136
std::map< unsigned char, std::tuple<void*, unsigned int, void*, unsigned int> > SIPKernelInfo;
12321137
populateSIPKernelInfo(platform, SIPKernelInfo);
12331138

@@ -1357,6 +1262,8 @@ CGenSystemInstructionKernelProgram* CGenSystemInstructionKernelProgram::Create(
13571262
}
13581263
else if (mode == SYSTEM_THREAD_MODE_CSR)
13591264
{
1265+
uint32_t slices = sysInfo.MaxSlicesSupported;
1266+
uint32_t subslices_per_slice =(sysInfo.MaxSlicesSupported > 0 ? (sysInfo.MaxSubSlicesSupported / sysInfo.MaxSlicesSupported) : sysInfo.MaxSubSlicesSupported);
13601267
switch (platform.getPlatformInfo().eProductFamily)
13611268
{
13621269
case IGFX_TIGERLAKE_LP:
@@ -1375,27 +1282,43 @@ CGenSystemInstructionKernelProgram* CGenSystemInstructionKernelProgram::Create(
13751282
case IGFX_METEORLAKE:
13761283
case IGFX_ARROWLAKE:
13771284
case IGFX_LUNARLAKE:
1378-
if (sysInfo.SliceCount == 1 && sysInfo.SubSliceCount == 4)
1285+
if (slices == 1 && subslices_per_slice == 4)
13791286
{
1380-
if (slmSize == SLM_128)
1287+
if (sysInfo.SLMSizeInKb == SLM_128)
13811288
{
13821289
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;
13831291
}
1384-
else if (slmSize == SLM_160)
1292+
else if (sysInfo.SLMSizeInKb == SLM_160)
13851293
{
13861294
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);
13871300
}
13881301
}
1389-
else if (sysInfo.SliceCount == 2 && sysInfo.SubSliceCount == 4)
1302+
else if (slices == 2 && subslices_per_slice == 4)
13901303
{
1391-
if (slmSize == SLM_128)
1304+
if (sysInfo.SLMSizeInKb == SLM_128)
13921305
{
13931306
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;
13941308
}
1395-
else if (slmSize == SLM_160)
1309+
else if (sysInfo.SLMSizeInKb == SLM_160)
13961310
{
13971311
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;
13981313
}
1314+
else
1315+
{
1316+
IGC_ASSERT(false);
1317+
}
1318+
}
1319+
else
1320+
{
1321+
IGC_ASSERT(false);
13991322
}
14001323
break;
14011324

IGC/common/SystemThread.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ namespace SIP
8383
enum SLM_SIZE_SUPPORTED
8484
{
8585
SLM_ANY,
86-
SLM_128,
87-
SLM_160
86+
SLM_128 = 128,
87+
SLM_160 = 160
8888
};
8989

9090
class CSystemThread
@@ -96,13 +96,6 @@ namespace SIP
9696
USC::SSystemThreadKernelOutput* &pSystemThread,
9797
bool bindlessmode = false);
9898

99-
static bool CreateSystemThreadKernel_v2(const PLATFORM &platform,
100-
const IGC::SCompilerHwCaps &Caps,
101-
const GT_SYSTEM_INFO &sysInfo,
102-
const USC::SYSTEM_THREAD_MODE mode,
103-
USC::SSystemThreadKernelOutput *&pSystemThread,
104-
SLM_SIZE_SUPPORTED slmSize);
105-
10699
static void DeleteSystemThreadKernel(
107100
USC::SSystemThreadKernelOutput* &pSystemThread );
108101

@@ -117,8 +110,7 @@ namespace SIP
117110
CGenSystemInstructionKernelProgram* Create(
118111
const IGC::CPlatform &platform,
119112
const USC::SYSTEM_THREAD_MODE mode,
120-
const bool bindlessMode,
121-
SLM_SIZE_SUPPORTED slmSize);
113+
const bool bindlessMode);
122114

123115
void Delete(CGenSystemInstructionKernelProgram* &pKernelProgram );
124116

0 commit comments

Comments
 (0)