@@ -39,20 +39,34 @@ extern GMM_MA_LIB_CONTEXT *pGmmMALibContext;
39
39
// ///////////////////////////////////////////////////////////////////////////////////
40
40
GmmLib::GmmClientContext::GmmClientContext (GMM_CLIENT ClientType, Context *pLibContext)
41
41
: ClientType(),
42
- pUmdAdapter (),
42
+ pClientContextAilFlags (),
43
43
pGmmUmdContext(),
44
44
DeviceCB(),
45
45
IsDeviceCbReceived(0 )
46
46
{
47
47
this ->ClientType = ClientType;
48
48
this ->pGmmLibContext = pLibContext;
49
+
50
+ if (NULL != (pClientContextAilFlags = (GMM_AIL_STRUCT *)malloc (sizeof (GMM_AIL_STRUCT))))
51
+ {
52
+ memset (pClientContextAilFlags, 0 , sizeof (GMM_AIL_STRUCT));
53
+ }
54
+ else
55
+ {
56
+ pClientContextAilFlags = NULL ;
57
+ }
49
58
}
50
59
// ///////////////////////////////////////////////////////////////////////////////////
51
60
// / Destructor to free GmmLib::GmmClientContext object memory
52
61
// ///////////////////////////////////////////////////////////////////////////////////
53
62
GmmLib::GmmClientContext::~GmmClientContext ()
54
63
{
55
64
pGmmLibContext = NULL ;
65
+ if (pClientContextAilFlags)
66
+ {
67
+ free (pClientContextAilFlags);
68
+ pClientContextAilFlags = NULL ;
69
+ }
56
70
}
57
71
58
72
// ///////////////////////////////////////////////////////////////////////////////////
@@ -128,6 +142,35 @@ uint8_t GMM_STDCALL GmmLib::GmmClientContext::GetSurfaceStateL1CachePolicy(GMM_R
128
142
return pGmmLibContext->GetCachePolicyObj ()->GetSurfaceStateL1CachePolicy (Usage);
129
143
}
130
144
145
+ // //////////////////////////////////////////////////////////////////////////////////
146
+ // / Member function to get the AIL flags associated with Client Context
147
+ // / @param[in] None
148
+ // / @return GMM_AIL_STRUCT associated with the ClientContext
149
+
150
+ const uint64_t * GMM_STDCALL GmmLib::GmmClientContext::GmmGetAIL ()
151
+ {
152
+ return (uint64_t *)(this ->pClientContextAilFlags );
153
+ }
154
+
155
+ // //////////////////////////////////////////////////////////////////////////////////
156
+ // / Member function to Set the AIL flags associated with Client Context
157
+ // /
158
+ // / @param[in] GMM_AIL_STRUCT: Pointer to AIL struct
159
+ // / @return void
160
+ void GMM_STDCALL GmmLib::GmmClientContext::GmmSetAIL (GMM_AIL_STRUCT* pAilFlags)
161
+ {
162
+ // Cache the AilXe2CompressionRequest value
163
+ bool IsClientAilXe2Compression = this ->pClientContextAilFlags ->AilDisableXe2CompressionRequest ;
164
+
165
+ memcpy (this ->pClientContextAilFlags , pAilFlags, sizeof (GMM_AIL_STRUCT));
166
+
167
+ // Update the Current ClientContext flags with whatever was cached earlier before copy
168
+ this ->pClientContextAilFlags ->AilDisableXe2CompressionRequest = IsClientAilXe2Compression;
169
+
170
+ return ;
171
+ }
172
+
173
+
131
174
// ///////////////////////////////////////////////////////////////////////////////////
132
175
// / Member function of ClientContext class to return Swizzle Descriptor
133
176
// / given Swizzle name , ResType and bpe
@@ -952,19 +995,34 @@ GMM_STATUS GMM_STDCALL GmmLib::GmmClientContext::GmmSetDeviceInfo(GMM_DEVICE_INF
952
995
// / @see Class GmmLib::GmmClientContext
953
996
// /
954
997
// / @param[in] ClientType : describles the UMD clients such as OCL, DX, OGL, Vulkan etc
955
- // / @param[in] sBDF: Adapter's BDF info
998
+ // / @param[in] sBDF: Adapter's BDF info@param[in] sBDF: Adapter's BDF info
999
+ // / @param[in] _pSkuTable: SkuTable Pointer
956
1000
// /
957
1001
// / @return Pointer to GmmClientContext, if Context is created
958
1002
// ///////////////////////////////////////////////////////////////////////////////////
959
- extern " C" GMM_CLIENT_CONTEXT *GMM_STDCALL GmmCreateClientContextForAdapter (GMM_CLIENT ClientType,
960
- ADAPTER_BDF sBdf )
1003
+ extern " C" GMM_CLIENT_CONTEXT *GMM_STDCALL GmmCreateClientContextForAdapter (GMM_CLIENT ClientType,
1004
+ ADAPTER_BDF sBdf ,
1005
+ const void *_pSkuTable)
961
1006
{
962
1007
GMM_CLIENT_CONTEXT *pGmmClientContext = nullptr ;
963
1008
GMM_LIB_CONTEXT * pLibContext = pGmmMALibContext->GetAdapterLibContext (sBdf );
1009
+ SKU_FEATURE_TABLE *pSkuTable;
964
1010
965
1011
if (pLibContext)
966
1012
{
967
1013
pGmmClientContext = new GMM_CLIENT_CONTEXT (ClientType, pLibContext);
1014
+
1015
+ if (pGmmClientContext)
1016
+ {
1017
+ pSkuTable = (SKU_FEATURE_TABLE *)_pSkuTable;
1018
+ if (GFX_GET_CURRENT_RENDERCORE (pLibContext->GetPlatformInfo ().Platform ) >= IGFX_XE2_HPG_CORE && pLibContext->GetSkuTable ().FtrXe2Compression && !pSkuTable->FtrXe2Compression )
1019
+ {
1020
+
1021
+ GMM_AIL_STRUCT *pClientAilFlags = (GMM_AIL_STRUCT *)pGmmClientContext->GmmGetAIL ();
1022
+
1023
+ pClientAilFlags->AilDisableXe2CompressionRequest = true ;
1024
+ }
1025
+ }
968
1026
969
1027
}
970
1028
return pGmmClientContext;
0 commit comments