Skip to content

Commit b659d27

Browse files
Revert "Create wrapper for GmmClientContext"
This reverts commit 50c3187. Change-Id: Id154ca2d217e5e45623750f641ebad5dc5e840a2
1 parent 8c504c0 commit b659d27

26 files changed

+657
-380
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ include_directories(${IGDRCL_BUILD_DIR})
501501
include_directories(${IGDRCL_SOURCE_DIR}/runtime/sku_info/definitions${BRANCH_DIR_SUFFIX})
502502
include_directories(${IGDRCL_SOURCE_DIR}/runtime/gen_common/reg_configs${BRANCH_DIR_SUFFIX})
503503
include_directories(${IGDRCL_SOURCE_DIR}/runtime/gmm_helper/${BRANCH_DIR_SUFFIX})
504-
include_directories(${IGDRCL_SOURCE_DIR}/runtime/gmm_helper/client_context${BRANCH_DIR_SUFFIX})
505504

506505
set(HW_SRC_INCLUDE_PATH ${IGDRCL_SOURCE_DIR}/runtime/gen_common)
507506

runtime/gmm_helper/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020

2121
set(RUNTIME_SRCS_GMM_HELPER_BASE
2222
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
23-
${CMAKE_CURRENT_SOURCE_DIR}/client_context/gmm_client_context_base.cpp
24-
${CMAKE_CURRENT_SOURCE_DIR}/client_context/gmm_client_context_base.h
25-
${CMAKE_CURRENT_SOURCE_DIR}/client_context${BRANCH_DIR_SUFFIX}/gmm_client_context.cpp
26-
${CMAKE_CURRENT_SOURCE_DIR}/client_context${BRANCH_DIR_SUFFIX}/gmm_client_context.h
2723
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper.cpp
2824
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper.h
2925
${CMAKE_CURRENT_SOURCE_DIR}/gmm_lib.h

runtime/gmm_helper/client_context/gmm_client_context.cpp

Lines changed: 0 additions & 27 deletions
This file was deleted.

runtime/gmm_helper/client_context/gmm_client_context.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

runtime/gmm_helper/client_context/gmm_client_context_base.cpp

Lines changed: 0 additions & 52 deletions
This file was deleted.

runtime/gmm_helper/client_context/gmm_client_context_base.h

Lines changed: 0 additions & 48 deletions
This file was deleted.

runtime/gmm_helper/gmm_helper.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* OTHER DEALINGS IN THE SOFTWARE.
2121
*/
2222

23-
#include "gmm_client_context.h"
2423
#include "runtime/gmm_helper/gmm_helper.h"
2524
#include "runtime/gmm_helper/resource_info.h"
2625
#include "runtime/helpers/get_info.h"
@@ -55,14 +54,15 @@ bool Gmm::initContext(const PLATFORM *pPlatform,
5554
}
5655
bool success = GMM_SUCCESS == initGlobalContextFunc(*pPlatform, &gmmFtrTable, &gmmWaTable, pGtSysInfo, GMM_CLIENT::GMM_OCL_VISTA);
5756
UNRECOVERABLE_IF(!success);
58-
Gmm::gmmClientContext = Gmm::createGmmContextWrapperFunc(GMM_CLIENT::GMM_OCL_VISTA);
57+
Gmm::gmmClientContext = createClientContextFunc(GMM_CLIENT::GMM_OCL_VISTA);
5958
}
6059
return Gmm::gmmClientContext != nullptr;
6160
}
6261

6362
void Gmm::destroyContext() {
6463
if (Gmm::gmmClientContext) {
65-
Gmm::gmmClientContext.reset(nullptr);
64+
deleteClientContextFunc(Gmm::gmmClientContext);
65+
Gmm::gmmClientContext = nullptr;
6666
destroyGlobalContextFunc();
6767
}
6868
}
@@ -76,7 +76,7 @@ uint32_t Gmm::getMOCS(uint32_t type) {
7676
}
7777
}
7878

79-
MEMORY_OBJECT_CONTROL_STATE mocs = Gmm::gmmClientContext->cachePolicyGetMemoryObject(nullptr, static_cast<GMM_RESOURCE_USAGE_TYPE>(type));
79+
MEMORY_OBJECT_CONTROL_STATE mocs = Gmm::gmmClientContext->CachePolicyGetMemoryObject(nullptr, static_cast<GMM_RESOURCE_USAGE_TYPE>(type));
8080

8181
return static_cast<uint32_t>(mocs.DwordValue);
8282
}
@@ -392,11 +392,8 @@ bool Gmm::unifiedAuxTranslationCapable() const {
392392
return gmmFlags->Gpu.CCS && gmmFlags->Gpu.UnifiedAuxSurface && gmmFlags->Info.RenderCompressed;
393393
}
394394

395-
Gmm::~Gmm() {}
396-
397-
std::unique_ptr<GmmClientContext> (*Gmm::createGmmContextWrapperFunc)(GMM_CLIENT) = GmmClientContextBase::create<GmmClientContext>;
398395
bool Gmm::useSimplifiedMocsTable = false;
399-
std::unique_ptr<GmmClientContext> Gmm::gmmClientContext = nullptr;
396+
GMM_CLIENT_CONTEXT *Gmm::gmmClientContext = nullptr;
400397
bool Gmm::isLoaded = false;
401398

402399
} // namespace OCLRT

runtime/gmm_helper/gmm_helper.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ struct WorkaroundTable;
3434
struct ImageInfo;
3535
class GraphicsAllocation;
3636
class GmmResourceInfo;
37-
class GmmClientContext;
3837

3938
enum OCLPlane {
4039
NO_PLANE = 0,
@@ -51,7 +50,7 @@ class Gmm {
5150
public:
5251
static const uint32_t maxPossiblePitch = 2147483648;
5352

54-
virtual ~Gmm();
53+
virtual ~Gmm() = default;
5554

5655
void create();
5756
static Gmm *create(const void *alignedPtr, size_t alignedSize, bool uncacheable);
@@ -97,11 +96,10 @@ class Gmm {
9796
static decltype(&GmmDestroyGlobalContext) destroyGlobalContextFunc;
9897
static decltype(&GmmCreateClientContext) createClientContextFunc;
9998
static decltype(&GmmDeleteClientContext) deleteClientContextFunc;
100-
static std::unique_ptr<GmmClientContext> (*createGmmContextWrapperFunc)(GMM_CLIENT);
10199

102100
bool isRenderCompressed = false;
103101
static bool useSimplifiedMocsTable;
104-
static std::unique_ptr<GmmClientContext> gmmClientContext;
102+
static GMM_CLIENT_CONTEXT *gmmClientContext;
105103
static bool isLoaded;
106104
};
107105
} // namespace OCLRT

runtime/gmm_helper/gmm_memory_base.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* OTHER DEALINGS IN THE SOFTWARE.
2121
*/
2222

23-
#include "gmm_client_context.h"
2423
#include "runtime/gmm_helper/gmm_memory_base.h"
2524
#include "runtime/gmm_helper/gmm_helper.h"
2625

@@ -34,7 +33,7 @@ bool GmmMemoryBase::configureDeviceAddressSpace(GMM_ESCAPE_HANDLE hAdapter,
3433
BOOLEAN BDWL3Coherency,
3534
GMM_GFX_SIZE_T SizeOverride,
3635
GMM_GFX_SIZE_T SlmGfxSpaceReserve) {
37-
return clientContext->ConfigureDeviceAddressSpace(
36+
return Gmm::gmmClientContext->ConfigureDeviceAddressSpace(
3837
{hAdapter},
3938
{hDevice},
4039
{pfnEscape},
@@ -47,10 +46,7 @@ bool GmmMemoryBase::configureDeviceAddressSpace(GMM_ESCAPE_HANDLE hAdapter,
4746
}
4847

4948
uintptr_t GmmMemoryBase::getInternalGpuVaRangeLimit() {
50-
return static_cast<uintptr_t>(clientContext->GetInternalGpuVaRangeLimit());
51-
}
52-
GmmMemoryBase::GmmMemoryBase() {
53-
clientContext = Gmm::gmmClientContext->getHandle();
49+
return static_cast<uintptr_t>(Gmm::gmmClientContext->GetInternalGpuVaRangeLimit());
5450
}
5551

5652
}; // namespace OCLRT

runtime/gmm_helper/gmm_memory_base.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class GmmMemoryBase {
4242
MOCKABLE_VIRTUAL uintptr_t getInternalGpuVaRangeLimit();
4343

4444
protected:
45-
GMM_CLIENT_CONTEXT *clientContext = nullptr;
46-
GmmMemoryBase();
45+
GmmMemoryBase() = default;
4746
};
4847
} // namespace OCLRT

0 commit comments

Comments
 (0)