Skip to content

Commit 99ff764

Browse files
johnbashdrprajap
authored andcommitted
Use exported APIs from ClientContext
[CP] dynamic gmm header file change copy from CL793947 Because certain ResourceInfo exported APIs are inlined, GmmLib is accidently exposing internal functions/class members. This is causing build issues with unresolved symbols when clients switch to dynamic linking. Fix is to use ClientContext exported APIs for UMD clients. Change-Id: I58db29d2f31c3f2586de80369f5ed085e14f06be Signed-off-by: drprajap <[email protected]>
1 parent 173b246 commit 99ff764

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

Source/GmmLib/inc/External/Common/GmmInfo.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,13 @@ extern "C" {
593593
#define GMM_OVERRIDE_PLATFORM_INFO(pTexInfo) (GmmGetPlatformInfo(pGmmGlobalContext))
594594
#define GMM_OVERRIDE_TEXTURE_CALC(pTexInfo) (GmmGetTextureCalc(pGmmGlobalContext))
595595

596-
// Reset packing alignment to project default
597-
#pragma pack(pop)
598-
596+
#ifdef __GMM_KMD__
597+
#define GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(pTexInfo) GMM_OVERRIDE_PLATFORM_INFO(pTexInfo)
598+
#define GMM_IS_PLANAR(Format) GmmIsPlanar(Format)
599+
#else
600+
#define GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(pTexInfo) (&pClientContext->GetPlatformInfo())
601+
#define GMM_IS_PLANAR(Format) (pClientContext->IsPlanar(Format))
602+
#endif
599603

604+
// Reset packing alignment to project default
605+
#pragma pack(pop)

Source/GmmLib/inc/External/Common/GmmResourceInfoCommon.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,11 @@ namespace GmmLib
388388
{
389389
const GMM_PLATFORM_INFO *pPlatform;
390390

391-
pPlatform = GMM_OVERRIDE_PLATFORM_INFO(&Surf);
391+
pPlatform = (GMM_PLATFORM_INFO *)GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(&Surf);
392392

393393
if (Surf.Flags.Gpu.UnifiedAuxSurface)
394394
{
395-
if (GmmIsPlanar(Surf.Format))
395+
if (GMM_IS_PLANAR(Surf.Format))
396396
{
397397
return static_cast<uint32_t>(AuxSurf.OffsetInfo.Plane.ArrayQPitch);
398398
}
@@ -421,10 +421,10 @@ namespace GmmLib
421421
uint32_t QPitch;
422422
const GMM_PLATFORM_INFO *pPlatform;
423423

424-
__GMM_ASSERT(GmmIsPlanar(Surf.Format));
424+
__GMM_ASSERT(GMM_IS_PLANAR(Surf.Format));
425425
GMM_UNREFERENCED_LOCAL_VARIABLE(Plane);
426426

427-
pPlatform = GMM_OVERRIDE_PLATFORM_INFO(&Surf);
427+
pPlatform = (GMM_PLATFORM_INFO *)GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(&Surf);
428428
__GMM_ASSERT(GFX_GET_CURRENT_RENDERCORE(pPlatform->Platform) >= IGFX_GEN8_CORE);
429429

430430
QPitch = static_cast<uint32_t>(Surf.OffsetInfo.Plane.ArrayQPitch / Surf.Pitch);
@@ -466,7 +466,7 @@ namespace GmmLib
466466
TileMode = Surf.TileMode;
467467
__GMM_ASSERT(TileMode < GMM_TILE_MODES);
468468

469-
pPlatform = GMM_OVERRIDE_PLATFORM_INFO(&Surf);
469+
pPlatform = (GMM_PLATFORM_INFO *)GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(&Surf);
470470
if (pPlatform->TileInfo[TileMode].LogicalTileWidth != 0)
471471
{
472472
// In case of Depth/Stencil buffer MSAA TileYs surface, the LogicalTileWidth/Height is smaller than non-MSAA ones
@@ -524,7 +524,7 @@ namespace GmmLib
524524

525525
__GMM_ASSERT(!AuxSurf.Flags.Info.Linear);
526526

527-
pPlatform = GMM_OVERRIDE_PLATFORM_INFO(&AuxSurf);
527+
pPlatform = (GMM_PLATFORM_INFO *)GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(&AuxSurf);
528528

529529
if (Surf.Flags.Gpu.UnifiedAuxSurface)
530530
{
@@ -742,7 +742,7 @@ namespace GmmLib
742742
GMM_GFX_SIZE_T Offset = 0;
743743

744744
__GMM_ASSERT(ArrayIndex < Surf.ArraySize);
745-
__GMM_ASSERT(GmmIsPlanar(Surf.Format));
745+
__GMM_ASSERT(GMM_IS_PLANAR(Surf.Format));
746746

747747
if (Surf.Flags.Gpu.UnifiedAuxSurface)
748748
{
@@ -786,7 +786,7 @@ namespace GmmLib
786786
{
787787
const __GMM_PLATFORM_RESOURCE *pPlatformResource;
788788
uint32_t HAlign;
789-
pPlatformResource = GMM_OVERRIDE_PLATFORM_INFO(&Surf);
789+
pPlatformResource = (GMM_PLATFORM_INFO *)GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(&Surf);
790790

791791
if ((GFX_GET_CURRENT_RENDERCORE(pPlatformResource->Platform) >= IGFX_GEN9_CORE) &&
792792
!(Surf.Flags.Info.TiledYf || Surf.Flags.Info.TiledYs))
@@ -809,7 +809,7 @@ namespace GmmLib
809809
{
810810
const __GMM_PLATFORM_RESOURCE *pPlatformResource;
811811
uint32_t VAlign;
812-
pPlatformResource = GMM_OVERRIDE_PLATFORM_INFO(&Surf);
812+
pPlatformResource = (GMM_PLATFORM_INFO *)GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(&Surf);
813813

814814
if ((GFX_GET_CURRENT_RENDERCORE(pPlatformResource->Platform) >= IGFX_GEN9_CORE) &&
815815
!(GetResFlags().Info.TiledYf || GetResFlags().Info.TiledYs))
@@ -976,7 +976,7 @@ namespace GmmLib
976976
/////////////////////////////////////////////////////////////////////////////////////
977977
GMM_INLINE_VIRTUAL GMM_INLINE_EXPORTED uint32_t GMM_STDCALL GetMaxGpuVirtualAddressBits()
978978
{
979-
const GMM_PLATFORM_INFO *pPlatform = GMM_OVERRIDE_PLATFORM_INFO(&Surf);
979+
const GMM_PLATFORM_INFO *pPlatform = (GMM_PLATFORM_INFO *)GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(&Surf);
980980
__GMM_ASSERTPTR(pPlatform, 0);
981981

982982
return pPlatform->MaxGpuVirtualAddressBitsPerResource;
@@ -991,7 +991,7 @@ namespace GmmLib
991991
{
992992
GMM_GFX_SIZE_T Offset = 0;
993993
const GMM_PLATFORM_INFO *pPlatform;
994-
pPlatform = GMM_OVERRIDE_PLATFORM_INFO(&Surf);
994+
pPlatform = (GMM_PLATFORM_INFO *)GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(&Surf);
995995
if (Surf.Flags.Gpu.UnifiedAuxSurface)
996996
{
997997
if ((GmmAuxType == GMM_AUX_CCS) || (GmmAuxType == GMM_AUX_SURF) || (GmmAuxType == GMM_AUX_Y_CCS)
@@ -1258,7 +1258,7 @@ namespace GmmLib
12581258
uint32_t HAlign;
12591259
const GMM_PLATFORM_INFO *pPlatform;
12601260

1261-
pPlatform = GMM_OVERRIDE_PLATFORM_INFO(&Surf);
1261+
pPlatform = (GMM_PLATFORM_INFO *)GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(&Surf);
12621262

12631263
if (GFX_GET_CURRENT_RENDERCORE(pPlatform->Platform) >= IGFX_GEN8_CORE)
12641264
{
@@ -1299,7 +1299,7 @@ namespace GmmLib
12991299
uint32_t VAlign;
13001300
const GMM_PLATFORM_INFO *pPlatform;
13011301

1302-
pPlatform = GMM_OVERRIDE_PLATFORM_INFO(&Surf);
1302+
pPlatform = (GMM_PLATFORM_INFO *)GMM_OVERRIDE_EXPORTED_PLATFORM_INFO(&Surf);
13031303

13041304
if (GFX_GET_CURRENT_RENDERCORE(pPlatform->Platform) >= IGFX_GEN8_CORE)
13051305
{

0 commit comments

Comments
 (0)