Skip to content

Commit 6143502

Browse files
authored
Remove unsed APIs and Update Gmmlib Version to 12.0 (#69)
* Remove old and unsed APIs * Updating the Gmmlib Version for ABI changes
1 parent ffd91d0 commit 6143502

18 files changed

+140
-1047
lines changed

Source/GmmLib/CMakeLists.txt

+5-6
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ cmake_minimum_required(VERSION 3.5)
2424
project(igfx_gmmumd)
2525

2626
# GmmLib Api Version used for so naming
27-
set(GMMLIB_API_MAJOR_VERSION 11)
28-
set(GMMLIB_API_MINOR_VERSION 3)
27+
set(GMMLIB_API_MAJOR_VERSION 12)
28+
set(GMMLIB_API_MINOR_VERSION 0)
2929

3030
if(NOT DEFINED MAJOR_VERSION)
31-
set(MAJOR_VERSION 11)
31+
set(MAJOR_VERSION 12)
3232
endif()
3333

3434
if(NOT DEFINED MINOR_VERSION)
35-
set(MINOR_VERSION 3)
35+
set(MINOR_VERSION 0)
3636
endif()
3737

3838
if(NOT DEFINED PATCH_VERSION)
@@ -279,8 +279,7 @@ set(UMD_SOURCES
279279
${BS_DIR_GMMLIB}/TranslationTable/GmmPageTableMgr.cpp
280280
${BS_DIR_GMMLIB}/TranslationTable/GmmUmdTranslationTable.cpp
281281
${BS_DIR_GMMLIB}/GlobalInfo/GmmClientContext.cpp
282-
${BS_DIR_GMMLIB}/GlobalInfo/GmmOldApi.cpp
283-
${BS_DIR_GMMLIB}/GlobalInfo/GmmLibDllMain.cpp
282+
${BS_DIR_GMMLIB}/GlobalInfo/GmmLibDllMain.cpp
284283
)
285284

286285
source_group("Source Files\\Cache Policy\\Client Files" FILES

Source/GmmLib/GlobalInfo/GmmClientContext.cpp

-36
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,6 @@ OTHER DEALINGS IN THE SOFTWARE.
3232

3333
extern GMM_MA_LIB_CONTEXT *pGmmMALibContext;
3434

35-
/////////////////////////////////////////////////////////////////////////////////////
36-
/// Constructor to zero initialize the GmmLib::GmmClientContext object and create
37-
/// Utility class object
38-
/////////////////////////////////////////////////////////////////////////////////////
39-
GmmLib::GmmClientContext::GmmClientContext(GMM_CLIENT ClientType)
40-
: ClientType(),
41-
pUmdAdapter(),
42-
pGmmUmdContext(),
43-
DeviceCB(),
44-
IsDeviceCbReceived(0)
45-
{
46-
}
47-
4835
/////////////////////////////////////////////////////////////////////////////////////
4936
/// Overloaded Constructor to zero initialize the GmmLib::GmmClientContext object
5037
/// This Construtor takes pointer to GmmLibCOntext as input argumnet and initiaizes
@@ -770,29 +757,6 @@ GMM_STATUS GMM_STDCALL GmmLib::GmmClientContext::GmmSetDeviceInfo(GMM_DEVICE_INF
770757
return Status;
771758
}
772759

773-
/////////////////////////////////////////////////////////////////////////////////////
774-
/// Gmm lib DLL exported C wrapper for creating GmmLib::GmmClientContext object
775-
/// @see Class GmmLib::GmmClientContext
776-
///
777-
/// @param[in] ClientType : describles the UMD clients such as OCL, DX, OGL, Vulkan etc
778-
///
779-
/// @return Pointer to GmmClientContext, if Context is created
780-
/////////////////////////////////////////////////////////////////////////////////////
781-
extern "C" GMM_CLIENT_CONTEXT *GMM_STDCALL GmmCreateClientContext(GMM_CLIENT ClientType)
782-
{
783-
GMM_CLIENT_CONTEXT *pGmmClientContext = nullptr;
784-
785-
#if GMM_LIB_DLL_MA
786-
// To be backward compatible and to use new Multi-Adapter API defined for creation of
787-
// Clientcontext, hardcoding BDF to {020}
788-
ADAPTER_BDF sBdf = {0, 2, 0, 0};
789-
pGmmClientContext = GmmCreateClientContextForAdapter(ClientType, sBdf);
790-
#else
791-
pGmmClientContext = new GMM_CLIENT_CONTEXT(ClientType);
792-
#endif
793-
return pGmmClientContext;
794-
}
795-
796760
/////////////////////////////////////////////////////////////////////////////////////
797761
/// Gmm lib DLL C wrapper for creating GmmLib::GmmClientContext object
798762
/// This C wrapper is used for Multi-Adapter scenarios to take in Adapter's BDF as

Source/GmmLib/GlobalInfo/GmmInfo.cpp

-53
Original file line numberDiff line numberDiff line change
@@ -36,60 +36,7 @@ GMM_MUTEX_HANDLE GmmLib::Context::SingletonContextSyncMutex = ::CreateMutex(NULL
3636
GMM_MUTEX_HANDLE GmmLib::Context::SingletonContextSyncMutex = PTHREAD_MUTEX_INITIALIZER;
3737
#endif // _WIN32
3838
#endif
39-
/////////////////////////////////////////////////////////////////////////////////////
40-
/// GMM lib DLL exported functions for creating Singleton Context (GmmLib::Context)
41-
/// object which shall be process singleton across all UMD clients within a process.
42-
/// @see Class GmmLib::Context
43-
///
44-
/// @param[in] Platform: platform variable. Includes product family (Haswell, Cherryview,
45-
/// Broxton) with related render and display core revision (GEN3,
46-
// ..., GEN10)
47-
/// @param[in] pSkuTable: Pointer to the sku feature table. Set of capabilities to
48-
/// allow code paths to be feature based and GEN agnostic.
49-
/// @param[in] pWaTable: Pointer to the work around table. A set of anti-features,
50-
/// often in early/prototype silicon that require work-arounds
51-
/// until they are resolved to allow code paths to be GEN agnostic.
52-
/// @param[in] pGtSysInfo: Pointer to the GT system info. Contains various GT System
53-
/// Information such as EU counts, Thread Counts, Cache Sizes etc.
54-
/// @return GMM_SUCCESS if Context is created, GMM_ERROR otherwise
55-
/////////////////////////////////////////////////////////////////////////////////////
56-
#ifdef _WIN32
57-
extern "C" GMM_STATUS GMM_STDCALL GmmCreateSingletonContext(const PLATFORM Platform,
58-
const SKU_FEATURE_TABLE *pSkuTable,
59-
const WA_TABLE * pWaTable,
60-
const GT_SYSTEM_INFO * pGtSysInfo)
61-
#else
62-
extern "C" GMM_STATUS GMM_STDCALL GmmCreateSingletonContext(const PLATFORM Platform,
63-
const void * pSkuTable,
64-
const void * pWaTable,
65-
const void * pGtSysInfo)
66-
#endif
67-
{
68-
#if GMM_LIB_DLL_MA
69-
70-
// To be backward compatible and to use new Multi-Adapter API defined for creation of
71-
// Adapter Singletoncontext, hardcoding BDF to {020}
72-
ADAPTER_BDF sBdf = {0, 2, 0, 0};
73-
return GmmCreateLibContext(Platform, pSkuTable, pWaTable, pGtSysInfo, sBdf);
74-
75-
#endif
76-
}
77-
7839

79-
/////////////////////////////////////////////////////////////////////////////////////
80-
/// GMM lib DLL exported functions for deleting the Singleton Context.
81-
/// Reference Count will be decremented and once the reference count reaches 0,
82-
/// Singleton Context will be freeed in memory
83-
/////////////////////////////////////////////////////////////////////////////////////
84-
extern "C" void GMM_STDCALL GmmDestroySingletonContext(void)
85-
{
86-
#if GMM_LIB_DLL_MA
87-
// To be backward compatible and to use new Multi-Adapter API defined for destroy of
88-
// Adapter Singletoncontext, hardcoding BDF to {020}
89-
ADAPTER_BDF sBdf = {0, 2, 0, 0};
90-
GmmLibContextFree(sBdf);
91-
#endif
92-
}
9340
/////////////////////////////////////////////////////////////////////////////////////
9441
/// GMM lib DLL Multi Adapter Functions
9542
/////////////////////////////////////////////////////////////////////////////////////

Source/GmmLib/GlobalInfo/GmmLibDllMain.cpp

-74
Original file line numberDiff line numberDiff line change
@@ -34,58 +34,6 @@ OTHER DEALINGS IN THE SOFTWARE.
3434
#include "External/Common/GmmClientContext.h"
3535
#include "External/Common/GmmLibDll.h"
3636

37-
#ifdef _WIN32
38-
/////////////////////////////////////////////////////////////////////////////////////
39-
/// DLL entry point function is needed only on Windows
40-
///
41-
/////////////////////////////////////////////////////////////////////////////////////
42-
BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD Reason, LPVOID Reserved)
43-
{
44-
UNREFERENCED_PARAMETER(Reserved);
45-
UNREFERENCED_PARAMETER(hInst);
46-
47-
BOOL result = TRUE;
48-
49-
switch(Reason)
50-
{
51-
case DLL_PROCESS_ATTACH:
52-
GmmCreateMultiAdapterContext();
53-
break;
54-
case DLL_THREAD_ATTACH:
55-
break;
56-
case DLL_THREAD_DETACH:
57-
break;
58-
case DLL_PROCESS_DETACH:
59-
GmmDestroyMultiAdapterContext();
60-
break;
61-
}
62-
63-
return result;
64-
}
65-
#endif
66-
67-
/////////////////////////////////////////////////////////////////////////////////////
68-
/// First Call to GMM Lib DLL/so to get the DLL/so exported fucntion pointers
69-
///
70-
/////////////////////////////////////////////////////////////////////////////////////
71-
extern "C" GMM_LIB_API GMM_STATUS GMM_STDCALL OpenGmm(GmmExportEntries *pm_GmmFuncs)
72-
{
73-
GMM_STATUS Status = GMM_SUCCESS;
74-
if(pm_GmmFuncs)
75-
{
76-
pm_GmmFuncs->pfnCreateSingletonContext = GmmCreateSingletonContext;
77-
pm_GmmFuncs->pfnDestroySingletonContext = GmmDestroySingletonContext;
78-
pm_GmmFuncs->pfnCreateClientContext = GmmCreateClientContext;
79-
pm_GmmFuncs->pfnDeleteClientContext = GmmDeleteClientContext;
80-
}
81-
else
82-
{
83-
Status = GMM_INVALIDPARAM;
84-
}
85-
86-
return Status;
87-
}
88-
8937
/////////////////////////////////////////////////////////////////////////////////////
9038
// First Call to GMM Lib DLL/so to initialize singleton global context
9139
// and create client context
@@ -117,14 +65,6 @@ extern "C" GMM_LIB_API GMM_STATUS GMM_STDCALL InitializeGmm(GMM_INIT_IN_ARGS *pI
11765
pOutArgs->pGmmClientContext = GmmCreateClientContextForAdapter(pInArgs->ClientType,
11866
stAdapterBDF);
11967
}
120-
#else
121-
122-
Status = GmmCreateSingletonContext(pInArgs->Platform, pInArgs->pSkuTable, pInArgs->pWaTable, pInArgs->pGtSysInfo);
123-
124-
if(Status == GMM_SUCCESS)
125-
{
126-
pOutArgs->pGmmClientContext = GmmCreateClientContext(pInArgs->ClientType);
127-
}
12868

12969
#endif
13070
}
@@ -145,21 +85,7 @@ extern "C" GMM_LIB_API void GMM_STDCALL GmmAdapterDestroy(GMM_INIT_OUT_ARGS *pIn
14585

14686
GmmDeleteClientContext(pInArgs->pGmmClientContext);
14787
GmmLibContextFree(stAdapterBDF);
148-
#else
149-
GmmDeleteClientContext(pInArgs->pGmmClientContext);
150-
GmmDestroySingletonContext();
15188
#endif
15289
}
15390
}
154-
/////////////////////////////////////////////////////////////////////////////////////
155-
// Destroys singleton global context and client context
156-
/////////////////////////////////////////////////////////////////////////////////////
157-
extern "C" GMM_LIB_API void GMM_STDCALL GmmDestroy(GMM_INIT_OUT_ARGS *pInArgs)
158-
{
159-
if(pInArgs && pInArgs->pGmmClientContext)
160-
{
161-
GmmDeleteClientContext(pInArgs->pGmmClientContext);
162-
GmmDestroySingletonContext();
163-
}
164-
}
16591
#endif // GMM_LIB_DLL

Source/GmmLib/GlobalInfo/GmmOldApi.cpp

-113
This file was deleted.

0 commit comments

Comments
 (0)