xref: /aosp_15_r20/external/gmmlib/Source/GmmLib/CachePolicy/GmmCachePolicyConditionals.h (revision 35ffd701415c9e32e53136d61a677a8d0a8fc4a5)
1*35ffd701SAndroid Build Coastguard Worker /*==============================================================================
2*35ffd701SAndroid Build Coastguard Worker Copyright(c) 2017 Intel Corporation
3*35ffd701SAndroid Build Coastguard Worker 
4*35ffd701SAndroid Build Coastguard Worker Permission is hereby granted, free of charge, to any person obtaining a
5*35ffd701SAndroid Build Coastguard Worker copy of this software and associated documentation files(the "Software"),
6*35ffd701SAndroid Build Coastguard Worker to deal in the Software without restriction, including without limitation
7*35ffd701SAndroid Build Coastguard Worker the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*35ffd701SAndroid Build Coastguard Worker and / or sell copies of the Software, and to permit persons to whom the
9*35ffd701SAndroid Build Coastguard Worker Software is furnished to do so, subject to the following conditions:
10*35ffd701SAndroid Build Coastguard Worker 
11*35ffd701SAndroid Build Coastguard Worker The above copyright notice and this permission notice shall be included
12*35ffd701SAndroid Build Coastguard Worker in all copies or substantial portions of the Software.
13*35ffd701SAndroid Build Coastguard Worker 
14*35ffd701SAndroid Build Coastguard Worker THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15*35ffd701SAndroid Build Coastguard Worker OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*35ffd701SAndroid Build Coastguard Worker FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17*35ffd701SAndroid Build Coastguard Worker THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*35ffd701SAndroid Build Coastguard Worker OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*35ffd701SAndroid Build Coastguard Worker ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*35ffd701SAndroid Build Coastguard Worker OTHER DEALINGS IN THE SOFTWARE.
21*35ffd701SAndroid Build Coastguard Worker ============================================================================*/
22*35ffd701SAndroid Build Coastguard Worker 
23*35ffd701SAndroid Build Coastguard Worker #define ISPRODUCT(X)  (GFX_GET_CURRENT_PRODUCT(pGmmLibContext->GetPlatformInfo().Platform) == IGFX_##X)
24*35ffd701SAndroid Build Coastguard Worker 
25*35ffd701SAndroid Build Coastguard Worker #define FROMPRODUCT(X)  (GFX_GET_CURRENT_PRODUCT(pGmmLibContext->GetPlatformInfo().Platform) >= IGFX_##X)
26*35ffd701SAndroid Build Coastguard Worker 
27*35ffd701SAndroid Build Coastguard Worker #define SKU(FtrXxx) (pGmmLibContext->GetSkuTable().FtrXxx != 0)
28*35ffd701SAndroid Build Coastguard Worker 
29*35ffd701SAndroid Build Coastguard Worker #define WA(WaXxx)   (pGmmLibContext->GetWaTable().WaXxx != 0)
30*35ffd701SAndroid Build Coastguard Worker 
31*35ffd701SAndroid Build Coastguard Worker // Underscored to prevent name collision with the GMM_CACHE_POLICY_ELEMENT fields named L3 and LLC
32*35ffd701SAndroid Build Coastguard Worker #define _L3           (pGmmLibContext->GetGtSysInfo()->L3CacheSizeInKb)
33*35ffd701SAndroid Build Coastguard Worker #define _LLC          (pGmmLibContext->GetGtSysInfo()->LLCCacheSizeInKb)
34*35ffd701SAndroid Build Coastguard Worker #define _ELLC         (pGmmLibContext->GetGtSysInfo()->EdramSizeInKb)
35*35ffd701SAndroid Build Coastguard Worker #define CAM$          (SKU(FtrCameraCaptureCaching))
36*35ffd701SAndroid Build Coastguard Worker 
37*35ffd701SAndroid Build Coastguard Worker // Units are already in KB in the system information, so these helper macros need to account for that
38*35ffd701SAndroid Build Coastguard Worker #define KB(N)         (N)
39*35ffd701SAndroid Build Coastguard Worker #define MB(N)         (1024 * KB(N))
40