@@ -48,11 +48,13 @@ int32_t GmmLib::GmmGen12dGPUCachePolicy::IsSpecialMOCSUsage(GMM_RESOURCE_USAGE_T
4848 switch (Usage)
4949 {
5050 case GMM_RESOURCE_USAGE_CCS:
51- __GMM_ASSERT (pCachePolicy[Usage].L3 == 0 ) // Architecturally, CCS isn't L3-cacheable.
51+ __GMM_ASSERT (pCachePolicy[Usage].L3 == 0 && // Architecturally, CCS isn't L3-cacheable.
52+ pCachePolicy[Usage].UcLookup == 0 ); // On DG1/XE_HP_SDV, CCS Resource is never cached in L3, so LookUp is N/A
5253 MocsIdx = 60 ;
5354 break ;
5455 case GMM_RESOURCE_USAGE_MOCS_62:
55- __GMM_ASSERT (pCachePolicy[Usage].L3 == 0 ); // Architecturally, TR/Aux-TT node isn't L3-cacheable.
56+ __GMM_ASSERT (pCachePolicy[Usage].L3 == 0 &&
57+ pCachePolicy[Usage].UcLookup == 0 ); // Architecturally, TR/Aux-TT node isn't L3-cacheable.
5658 MocsIdx = 62 ;
5759 break ;
5860 case GMM_RESOURCE_USAGE_L3_EVICTION:
@@ -87,7 +89,7 @@ GMM_STATUS GmmLib::GmmGen12dGPUCachePolicy::InitCachePolicy()
8789
8890 __GMM_ASSERTPTR (pCachePolicy, GMM_ERROR);
8991
90- #define DEFINE_CACHE_ELEMENT (usage, l3, l3_scc, hdcl1 ) DEFINE_CP_ELEMENT(usage, 0 , 0 , l3, 0 , 0 , 0 , 0 , l3_scc, 0 , 0 , 0 , hdcl1, 0 , 0 , 0 , 0 )
92+ #define DEFINE_CACHE_ELEMENT (usage, l3, l3_scc, hdcl1, go, uclookup ) DEFINE_CP_ELEMENT(usage, 0 , 0 , l3, 0 , 0 , 0 , 0 , l3_scc, 0 , 0 , 0 , hdcl1, 0 , 0 , go, uclookup )
9193
9294#include " GmmGen12dGPUCachePolicy.h"
9395
@@ -131,6 +133,7 @@ GMM_STATUS GmmLib::GmmGen12dGPUCachePolicy::InitCachePolicy()
131133 switch (GFX_GET_CURRENT_PRODUCT (pGmmGlobalContext->GetPlatformInfo ().Platform ))
132134 {
133135 case IGFX_DG1:
136+ case IGFX_XE_HP_SDV:
134137 StartMocsIdx = 1 ; // Index 0 is reserved for Error
135138 break ;
136139 default :
@@ -139,14 +142,14 @@ GMM_STATUS GmmLib::GmmGen12dGPUCachePolicy::InitCachePolicy()
139142 }
140143
141144 // No Special MOCS handling for next platform
142- if (GFX_GET_CURRENT_PRODUCT (pGmmGlobalContext->GetPlatformInfo ().Platform ) <= IGFX_DG1 )
145+ if (GFX_GET_CURRENT_PRODUCT (pGmmGlobalContext->GetPlatformInfo ().Platform ) <= IGFX_XE_HP_SDV )
143146 {
144147 CPTblIdx = IsSpecialMOCSUsage ((GMM_RESOURCE_USAGE_TYPE)Usage, SpecialMOCS);
145148 }
146149
147150 // Applicable upto only
148151 if (pCachePolicy[Usage].HDCL1 &&
149- (GFX_GET_CURRENT_PRODUCT (pGmmGlobalContext->GetPlatformInfo ().Platform ) <= IGFX_DG1 ))
152+ (GFX_GET_CURRENT_PRODUCT (pGmmGlobalContext->GetPlatformInfo ().Platform ) <= IGFX_XE_HP_SDV ))
150153 {
151154 UsageEle.HDCL1 = 1 ;
152155 }
@@ -163,6 +166,22 @@ GMM_STATUS GmmLib::GmmGen12dGPUCachePolicy::InitCachePolicy()
163166 UsageEle.L3 .SCC = (uint16_t )pCachePolicy[Usage].L3_SCC ;
164167 }
165168
169+ // Go/Lookup
170+ // N/A for SpecialMOCS
171+ // N/A for DG1, RKL
172+ // Applicable for IGFX_XE_HP_SDV only
173+ if (!SpecialMOCS &&
174+ (FROMPRODUCT (XE_HP_SDV)))
175+ {
176+ if (pCachePolicy[Usage].L3 == 0 )
177+ {
178+ UsageEle.L3 .GlobalGo = pCachePolicy[Usage].GlbGo ;
179+ }
180+ UsageEle.L3 .UCLookup = pCachePolicy[Usage].UcLookup ;
181+ __GMM_ASSERT ((pCachePolicy[Usage].UcLookup ) || (pCachePolicy[Usage].L3 == 0 && pCachePolicy[Usage].UcLookup == 0 ));
182+ }
183+
184+
166185 // Special-case MOCS handling for MOCS Table Index 60-63
167186 if (CPTblIdx >= GMM_GEN12_MAX_NUMBER_MOCS_INDEXES)
168187 {
@@ -194,7 +213,9 @@ GMM_STATUS GmmLib::GmmGen12dGPUCachePolicy::InitCachePolicy()
194213 {
195214 for (j = StartMocsIdx; j <= CurrentMaxMocsIndex; j++)
196215 {
197- if (pCachePolicy[Usage].L3 == 0 )
216+ if (pCachePolicy[Usage].L3 == 0 &&
217+ pCachePolicy[Usage].GlbGo == 0 &&
218+ pCachePolicy[Usage].UcLookup == 0 )
198219 {
199220 CPTblIdx = StartMocsIdx;
200221 break ;
@@ -270,11 +291,13 @@ void GmmLib::GmmGen12dGPUCachePolicy::SetUpMOCSTable()
270291 CurrentMaxL1HdcMocsIndex = 0 ;
271292 CurrentMaxSpecialMocsIndex = 0 ;
272293
273- #define GMM_DEFINE_MOCS (Index, L3_ESC, L3_SCC, L3_CC, _HDCL1 ) \
294+ #define GMM_DEFINE_MOCS (Index, L3_ESC, L3_SCC, L3_CC, L3_Go, L3_LookUp, _HDCL1 ) \
274295 { \
275296 pCachePolicyTlbElement[Index].L3 .ESC = L3_ESC; \
276297 pCachePolicyTlbElement[Index].L3 .SCC = L3_SCC; \
277298 pCachePolicyTlbElement[Index].L3 .Cacheability = L3_CC; \
299+ pCachePolicyTlbElement[Index].L3 .GlobalGo = L3_Go; \
300+ pCachePolicyTlbElement[Index].L3 .UCLookup = L3_LookUp; \
278301 pCachePolicyTlbElement[Index].LeCC .Cacheability = 1 ; \
279302 pCachePolicyTlbElement[Index].LeCC .TargetCache = 0 ; \
280303 pCachePolicyTlbElement[Index].LeCC .LRUM = 0 ; \
@@ -294,31 +317,58 @@ void GmmLib::GmmGen12dGPUCachePolicy::SetUpMOCSTable()
294317 {
295318 // Default MOCS Table
296319 for (int index = 0 ; index < GMM_MAX_NUMBER_MOCS_INDEXES; index++)
297- { // Index ESC SCC L3CC HDCL1
298- GMM_DEFINE_MOCS ( index , 0 , 0 , 3 , 0 )
320+ { // Index ESC SCC L3CC Go LookUp HDCL1
321+ GMM_DEFINE_MOCS ( index , 0 , 0 , 3 , 0 , 0 , 0 )
299322 }
300323 // Fixed MOCS Table
301- // Index ESC SCC L3CC HDCL1
302- GMM_DEFINE_MOCS ( 1 , 0 , 0 , 1 , 0 )
303- GMM_DEFINE_MOCS ( 2 , 0 , 0 , 0 , 0 )
304- GMM_DEFINE_MOCS ( 3 , 0 , 0 , 0 , 0 )
305- GMM_DEFINE_MOCS ( 4 , 0 , 0 , 0 , 0 )
306- GMM_DEFINE_MOCS ( 5 , 0 , 0 , 3 , 0 )
307- GMM_DEFINE_MOCS ( 6 , 1 , 1 , 3 , 0 )
308- GMM_DEFINE_MOCS ( 7 , 1 , 3 , 3 , 0 )
309- GMM_DEFINE_MOCS ( 8 , 1 , 7 , 3 , 0 )
310- GMM_DEFINE_MOCS ( 48 , 0 , 0 , 3 , 1 )
311- GMM_DEFINE_MOCS ( 49 , 0 , 0 , 1 , 1 )
312- GMM_DEFINE_MOCS ( 60 , 0 , 0 , 1 , 0 )
313- GMM_DEFINE_MOCS ( 61 , 0 , 0 , 1 , 0 )
314- GMM_DEFINE_MOCS ( 62 , 0 , 0 , 1 , 0 )
315- GMM_DEFINE_MOCS ( 63 , 0 , 0 , 1 , 0 )
324+ // Index ESC SCC L3CC Go LookUp HDCL1
325+ GMM_DEFINE_MOCS ( 0 , 0 , 0 , 1 , 0 , 0 , 0 )
326+ GMM_DEFINE_MOCS ( 1 , 0 , 0 , 1 , 0 , 0 , 0 )
327+ GMM_DEFINE_MOCS ( 2 , 0 , 0 , 0 , 0 , 0 , 0 )
328+ GMM_DEFINE_MOCS ( 3 , 0 , 0 , 0 , 0 , 0 , 0 )
329+ GMM_DEFINE_MOCS ( 4 , 0 , 0 , 0 , 0 , 0 , 0 )
330+ GMM_DEFINE_MOCS ( 5 , 0 , 0 , 3 , 0 , 0 , 0 )
331+ GMM_DEFINE_MOCS ( 6 , 1 , 1 , 3 , 0 , 0 , 0 )
332+ GMM_DEFINE_MOCS ( 7 , 1 , 3 , 3 , 0 , 0 , 0 )
333+ GMM_DEFINE_MOCS ( 8 , 1 , 7 , 3 , 0 , 0 , 0 )
334+ GMM_DEFINE_MOCS ( 48 , 0 , 0 , 3 , 0 , 0 , 1 )
335+ GMM_DEFINE_MOCS ( 49 , 0 , 0 , 1 , 0 , 0 , 1 )
336+ GMM_DEFINE_MOCS ( 60 , 0 , 0 , 1 , 0 , 0 , 0 )
337+ GMM_DEFINE_MOCS ( 61 , 0 , 0 , 1 , 0 , 0 , 0 )
338+ GMM_DEFINE_MOCS ( 62 , 0 , 0 , 1 , 0 , 0 , 0 )
339+ GMM_DEFINE_MOCS ( 63 , 0 , 0 , 1 , 0 , 0 , 0 )
316340
317341 CurrentMaxMocsIndex = 8 ;
318342 CurrentMaxL1HdcMocsIndex = 49 ;
319343 CurrentMaxSpecialMocsIndex = 63 ;
320344
321345 }
346+ else if (GFX_GET_CURRENT_PRODUCT (pGmmGlobalContext->GetPlatformInfo ().Platform ) == IGFX_XE_HP_SDV)
347+ {
348+ // Default MOCS Table
349+ for (int index = 0 ; index < GMM_MAX_NUMBER_MOCS_INDEXES; index++)
350+ { // Index ESC SCC L3CC Go LookUp HDCL1
351+ GMM_DEFINE_MOCS ( index , 0 , 0 , 3 , 0 , 1 , 0 )
352+ }
353+ // Fixed MOCS Table
354+ // Index ESC SCC L3CC Go LookUp HDCL1
355+ GMM_DEFINE_MOCS ( 1 , 0 , 0 , 1 , 0 , 1 , 0 )
356+ GMM_DEFINE_MOCS ( 2 , 0 , 0 , 1 , 1 , 1 , 0 )
357+ GMM_DEFINE_MOCS ( 3 , 0 , 0 , 1 , 1 , 0 , 0 )
358+ GMM_DEFINE_MOCS ( 4 , 0 , 0 , 1 , 0 , 0 , 0 )
359+ GMM_DEFINE_MOCS ( 5 , 0 , 0 , 3 , 0 , 1 , 0 )
360+ GMM_DEFINE_MOCS ( 48 , 0 , 0 , 3 , 0 , 1 , 1 )
361+ GMM_DEFINE_MOCS ( 49 , 0 , 0 , 1 , 0 , 1 , 1 )
362+ GMM_DEFINE_MOCS ( 60 , 0 , 0 , 1 , 0 , 0 , 0 )
363+ GMM_DEFINE_MOCS ( 61 , 0 , 0 , 1 , 0 , 0 , 0 )
364+ GMM_DEFINE_MOCS ( 62 , 0 , 0 , 1 , 0 , 0 , 0 )
365+ GMM_DEFINE_MOCS ( 63 , 0 , 0 , 1 , 0 , 0 , 0 )
366+
367+ CurrentMaxMocsIndex = 5 ;
368+ CurrentMaxL1HdcMocsIndex = 49 ;
369+ CurrentMaxSpecialMocsIndex = 63 ;
370+
371+ }
322372
323373// clang-format on
324374
0 commit comments