Skip to content

Commit

Permalink
Remove unsed APIs and Update Gmmlib Version to 12.0 (#69)
Browse files Browse the repository at this point in the history
* Remove old and unsed APIs

* Updating the Gmmlib Version for ABI changes
  • Loading branch information
johnmach authored Dec 4, 2021
1 parent ffd91d0 commit 6143502
Show file tree
Hide file tree
Showing 18 changed files with 140 additions and 1,047 deletions.
11 changes: 5 additions & 6 deletions Source/GmmLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ cmake_minimum_required(VERSION 3.5)
project(igfx_gmmumd)

# GmmLib Api Version used for so naming
set(GMMLIB_API_MAJOR_VERSION 11)
set(GMMLIB_API_MINOR_VERSION 3)
set(GMMLIB_API_MAJOR_VERSION 12)
set(GMMLIB_API_MINOR_VERSION 0)

if(NOT DEFINED MAJOR_VERSION)
set(MAJOR_VERSION 11)
set(MAJOR_VERSION 12)
endif()

if(NOT DEFINED MINOR_VERSION)
set(MINOR_VERSION 3)
set(MINOR_VERSION 0)
endif()

if(NOT DEFINED PATCH_VERSION)
Expand Down Expand Up @@ -279,8 +279,7 @@ set(UMD_SOURCES
${BS_DIR_GMMLIB}/TranslationTable/GmmPageTableMgr.cpp
${BS_DIR_GMMLIB}/TranslationTable/GmmUmdTranslationTable.cpp
${BS_DIR_GMMLIB}/GlobalInfo/GmmClientContext.cpp
${BS_DIR_GMMLIB}/GlobalInfo/GmmOldApi.cpp
${BS_DIR_GMMLIB}/GlobalInfo/GmmLibDllMain.cpp
${BS_DIR_GMMLIB}/GlobalInfo/GmmLibDllMain.cpp
)

source_group("Source Files\\Cache Policy\\Client Files" FILES
Expand Down
36 changes: 0 additions & 36 deletions Source/GmmLib/GlobalInfo/GmmClientContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ OTHER DEALINGS IN THE SOFTWARE.

extern GMM_MA_LIB_CONTEXT *pGmmMALibContext;

/////////////////////////////////////////////////////////////////////////////////////
/// Constructor to zero initialize the GmmLib::GmmClientContext object and create
/// Utility class object
/////////////////////////////////////////////////////////////////////////////////////
GmmLib::GmmClientContext::GmmClientContext(GMM_CLIENT ClientType)
: ClientType(),
pUmdAdapter(),
pGmmUmdContext(),
DeviceCB(),
IsDeviceCbReceived(0)
{
}

/////////////////////////////////////////////////////////////////////////////////////
/// Overloaded Constructor to zero initialize the GmmLib::GmmClientContext object
/// This Construtor takes pointer to GmmLibCOntext as input argumnet and initiaizes
Expand Down Expand Up @@ -770,29 +757,6 @@ GMM_STATUS GMM_STDCALL GmmLib::GmmClientContext::GmmSetDeviceInfo(GMM_DEVICE_INF
return Status;
}

/////////////////////////////////////////////////////////////////////////////////////
/// Gmm lib DLL exported C wrapper for creating GmmLib::GmmClientContext object
/// @see Class GmmLib::GmmClientContext
///
/// @param[in] ClientType : describles the UMD clients such as OCL, DX, OGL, Vulkan etc
///
/// @return Pointer to GmmClientContext, if Context is created
/////////////////////////////////////////////////////////////////////////////////////
extern "C" GMM_CLIENT_CONTEXT *GMM_STDCALL GmmCreateClientContext(GMM_CLIENT ClientType)
{
GMM_CLIENT_CONTEXT *pGmmClientContext = nullptr;

#if GMM_LIB_DLL_MA
// To be backward compatible and to use new Multi-Adapter API defined for creation of
// Clientcontext, hardcoding BDF to {020}
ADAPTER_BDF sBdf = {0, 2, 0, 0};
pGmmClientContext = GmmCreateClientContextForAdapter(ClientType, sBdf);
#else
pGmmClientContext = new GMM_CLIENT_CONTEXT(ClientType);
#endif
return pGmmClientContext;
}

/////////////////////////////////////////////////////////////////////////////////////
/// Gmm lib DLL C wrapper for creating GmmLib::GmmClientContext object
/// This C wrapper is used for Multi-Adapter scenarios to take in Adapter's BDF as
Expand Down
53 changes: 0 additions & 53 deletions Source/GmmLib/GlobalInfo/GmmInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,60 +36,7 @@ GMM_MUTEX_HANDLE GmmLib::Context::SingletonContextSyncMutex = ::CreateMutex(NULL
GMM_MUTEX_HANDLE GmmLib::Context::SingletonContextSyncMutex = PTHREAD_MUTEX_INITIALIZER;
#endif // _WIN32
#endif
/////////////////////////////////////////////////////////////////////////////////////
/// GMM lib DLL exported functions for creating Singleton Context (GmmLib::Context)
/// object which shall be process singleton across all UMD clients within a process.
/// @see Class GmmLib::Context
///
/// @param[in] Platform: platform variable. Includes product family (Haswell, Cherryview,
/// Broxton) with related render and display core revision (GEN3,
// ..., GEN10)
/// @param[in] pSkuTable: Pointer to the sku feature table. Set of capabilities to
/// allow code paths to be feature based and GEN agnostic.
/// @param[in] pWaTable: Pointer to the work around table. A set of anti-features,
/// often in early/prototype silicon that require work-arounds
/// until they are resolved to allow code paths to be GEN agnostic.
/// @param[in] pGtSysInfo: Pointer to the GT system info. Contains various GT System
/// Information such as EU counts, Thread Counts, Cache Sizes etc.
/// @return GMM_SUCCESS if Context is created, GMM_ERROR otherwise
/////////////////////////////////////////////////////////////////////////////////////
#ifdef _WIN32
extern "C" GMM_STATUS GMM_STDCALL GmmCreateSingletonContext(const PLATFORM Platform,
const SKU_FEATURE_TABLE *pSkuTable,
const WA_TABLE * pWaTable,
const GT_SYSTEM_INFO * pGtSysInfo)
#else
extern "C" GMM_STATUS GMM_STDCALL GmmCreateSingletonContext(const PLATFORM Platform,
const void * pSkuTable,
const void * pWaTable,
const void * pGtSysInfo)
#endif
{
#if GMM_LIB_DLL_MA

// To be backward compatible and to use new Multi-Adapter API defined for creation of
// Adapter Singletoncontext, hardcoding BDF to {020}
ADAPTER_BDF sBdf = {0, 2, 0, 0};
return GmmCreateLibContext(Platform, pSkuTable, pWaTable, pGtSysInfo, sBdf);

#endif
}


/////////////////////////////////////////////////////////////////////////////////////
/// GMM lib DLL exported functions for deleting the Singleton Context.
/// Reference Count will be decremented and once the reference count reaches 0,
/// Singleton Context will be freeed in memory
/////////////////////////////////////////////////////////////////////////////////////
extern "C" void GMM_STDCALL GmmDestroySingletonContext(void)
{
#if GMM_LIB_DLL_MA
// To be backward compatible and to use new Multi-Adapter API defined for destroy of
// Adapter Singletoncontext, hardcoding BDF to {020}
ADAPTER_BDF sBdf = {0, 2, 0, 0};
GmmLibContextFree(sBdf);
#endif
}
/////////////////////////////////////////////////////////////////////////////////////
/// GMM lib DLL Multi Adapter Functions
/////////////////////////////////////////////////////////////////////////////////////
Expand Down
74 changes: 0 additions & 74 deletions Source/GmmLib/GlobalInfo/GmmLibDllMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,58 +34,6 @@ OTHER DEALINGS IN THE SOFTWARE.
#include "External/Common/GmmClientContext.h"
#include "External/Common/GmmLibDll.h"

#ifdef _WIN32
/////////////////////////////////////////////////////////////////////////////////////
/// DLL entry point function is needed only on Windows
///
/////////////////////////////////////////////////////////////////////////////////////
BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD Reason, LPVOID Reserved)
{
UNREFERENCED_PARAMETER(Reserved);
UNREFERENCED_PARAMETER(hInst);

BOOL result = TRUE;

switch(Reason)
{
case DLL_PROCESS_ATTACH:
GmmCreateMultiAdapterContext();
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
GmmDestroyMultiAdapterContext();
break;
}

return result;
}
#endif

/////////////////////////////////////////////////////////////////////////////////////
/// First Call to GMM Lib DLL/so to get the DLL/so exported fucntion pointers
///
/////////////////////////////////////////////////////////////////////////////////////
extern "C" GMM_LIB_API GMM_STATUS GMM_STDCALL OpenGmm(GmmExportEntries *pm_GmmFuncs)
{
GMM_STATUS Status = GMM_SUCCESS;
if(pm_GmmFuncs)
{
pm_GmmFuncs->pfnCreateSingletonContext = GmmCreateSingletonContext;
pm_GmmFuncs->pfnDestroySingletonContext = GmmDestroySingletonContext;
pm_GmmFuncs->pfnCreateClientContext = GmmCreateClientContext;
pm_GmmFuncs->pfnDeleteClientContext = GmmDeleteClientContext;
}
else
{
Status = GMM_INVALIDPARAM;
}

return Status;
}

/////////////////////////////////////////////////////////////////////////////////////
// First Call to GMM Lib DLL/so to initialize singleton global context
// and create client context
Expand Down Expand Up @@ -117,14 +65,6 @@ extern "C" GMM_LIB_API GMM_STATUS GMM_STDCALL InitializeGmm(GMM_INIT_IN_ARGS *pI
pOutArgs->pGmmClientContext = GmmCreateClientContextForAdapter(pInArgs->ClientType,
stAdapterBDF);
}
#else

Status = GmmCreateSingletonContext(pInArgs->Platform, pInArgs->pSkuTable, pInArgs->pWaTable, pInArgs->pGtSysInfo);

if(Status == GMM_SUCCESS)
{
pOutArgs->pGmmClientContext = GmmCreateClientContext(pInArgs->ClientType);
}

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

GmmDeleteClientContext(pInArgs->pGmmClientContext);
GmmLibContextFree(stAdapterBDF);
#else
GmmDeleteClientContext(pInArgs->pGmmClientContext);
GmmDestroySingletonContext();
#endif
}
}
/////////////////////////////////////////////////////////////////////////////////////
// Destroys singleton global context and client context
/////////////////////////////////////////////////////////////////////////////////////
extern "C" GMM_LIB_API void GMM_STDCALL GmmDestroy(GMM_INIT_OUT_ARGS *pInArgs)
{
if(pInArgs && pInArgs->pGmmClientContext)
{
GmmDeleteClientContext(pInArgs->pGmmClientContext);
GmmDestroySingletonContext();
}
}
#endif // GMM_LIB_DLL
113 changes: 0 additions & 113 deletions Source/GmmLib/GlobalInfo/GmmOldApi.cpp

This file was deleted.

Loading

0 comments on commit 6143502

Please sign in to comment.