Skip to content

Commit d6c3b56

Browse files
shankarprashanthdrprajap
authored andcommitted
Add new target to unify gmmlib
- Makes ClientContext class member of Resinfo and PageTableMgr class - Addition of OCL Translation Layer - GmmLib cmake change to add new igfxgmmumd unified static lib project Change-Id: If155bafad29086ab5309c24f1f8a1862f92eb654
1 parent 6f56536 commit d6c3b56

14 files changed

+1282
-120
lines changed

Source/GmmLib/CMakeLists.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ set(CMAKE_DISABLE_SOURCE_CHANGES ON)
7676
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
7777

7878
set (TARGET_LIST
79-
gmm_umd
79+
igfxgmmumd
80+
gmm_umd
8081
igfx_gmmumd_excite
8182
#igfx_gmmumd_ocl
8283
)
@@ -268,6 +269,7 @@ set(SOURCES_
268269
set(UMD_SOURCES
269270
${SOURCES_}
270271
${BS_DIR_GMMLIB}/GlobalInfo/GmmClientContext.cpp
272+
${BS_DIR_GMMLIB}/GlobalInfo/GmmOCL.cpp
271273
)
272274

273275
source_group("Source Files\\Cache Policy\\Client Files" FILES
@@ -473,6 +475,11 @@ endforeach()
473475
# GMM_OCL
474476
#)
475477

478+
bs_set_extra_target_properties(igfxgmmumd
479+
ISTDLIB_UMD
480+
UNUSED_ISTDLIB_MT
481+
)
482+
476483

477484
if(ARCH EQUAL 32)
478485
#bs_set_extra_target_properties(igfx_gmmumd_ocl UNUSED_ISTDLIB_MT)

Source/GmmLib/GlobalInfo/GmmClientContext.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -363,20 +363,20 @@ GMM_RESOURCE_INFO *GMM_STDCALL GmmLib::GmmClientContext::CreateResInfoObject(GMM
363363
// GMM_RESOURCE_INFO...
364364
if(pCreateParams->pPreallocatedResInfo)
365365
{
366-
pRes = new(pCreateParams->pPreallocatedResInfo) GmmLib::GmmResourceInfo(); // Use preallocated memory as a class
366+
pRes = new(pCreateParams->pPreallocatedResInfo) GmmLib::GmmResourceInfo(this); // Use preallocated memory as a class
367367
pCreateParams->Flags.Info.__PreallocatedResInfo =
368368
pRes->GetResFlags().Info.__PreallocatedResInfo = 1; // Set both in case we can die before copying over the flags.
369369
}
370370
else
371371
{
372-
if((pRes = new GMM_RESOURCE_INFO) == NULL)
372+
if((pRes = new GMM_RESOURCE_INFO(this)) == NULL)
373373
{
374374
GMM_ASSERTDPF(0, "Allocation failed!");
375375
goto ERROR_CASE;
376376
}
377377
}
378378

379-
if(pRes->Create(*pGmmGlobalContext, *pCreateParams) != GMM_SUCCESS)
379+
if(pRes->Create(*pCreateParams) != GMM_SUCCESS)
380380
{
381381
goto ERROR_CASE;
382382
}

Source/GmmLib/GlobalInfo/GmmInfo.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ GMM_STATUS GMM_STDCALL GmmInitGlobalContext(const PLATFORM Platform,
6969
GMM_CLIENT ClientType)
7070
#endif
7171
{
72+
GMM_STATUS Status = GMM_ERROR;
7273
__GMM_ASSERTPTR(pSkuTable, GMM_ERROR);
7374
__GMM_ASSERTPTR(pWaTable, GMM_ERROR);
7475
__GMM_ASSERTPTR(pGtSysInfo, GMM_ERROR);
@@ -93,7 +94,13 @@ GMM_STATUS GMM_STDCALL GmmInitGlobalContext(const PLATFORM Platform,
9394
return GMM_ERROR;
9495
}
9596

96-
return (pGmmGlobalContext->InitContext(Platform, skuTable, waTable, sysInfo, ClientType));
97+
Status = (pGmmGlobalContext->InitContext(Platform, skuTable, waTable, sysInfo, ClientType));
98+
99+
#ifdef GMM_OCL
100+
Status = GmmCreateGlobalOCLClientContext();
101+
#endif
102+
103+
return Status;
97104
}
98105

99106

@@ -107,6 +114,9 @@ void GMM_STDCALL GmmDestroyGlobalContext(void)
107114
int32_t ContextRefCount = GmmLib::Context::DecrementRefCount();
108115
if(!ContextRefCount && pGmmGlobalContext)
109116
{
117+
#ifdef GMM_OCL
118+
GmmDestroyGlobalOCLClientContext();
119+
#endif
110120
pGmmGlobalContext->DestroyContext();
111121
delete pGmmGlobalContext;
112122
pGmmGlobalContext = NULL;

0 commit comments

Comments
 (0)