Remove static gmmlib support on Windows

Change-Id: I9e52f11b196ef9364b710766d9dd302e4dc0cc64
This commit is contained in:
Mateusz Jablonski 2018-07-24 10:02:03 +02:00
parent 3a807d5643
commit 6618a35126
7 changed files with 7 additions and 131 deletions

View File

@ -18,6 +18,12 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
if(UNIX AND USE_STATIC_GMM)
set(GMM_INTERFACE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/gmm_interface_static.cpp)
else()
set(GMM_INTERFACE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/gmm_interface_dynamic.cpp)
endif()
set(RUNTIME_SRCS_GMM_HELPER_BASE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/gmm.cpp
@ -26,6 +32,7 @@ set(RUNTIME_SRCS_GMM_HELPER_BASE
${CMAKE_CURRENT_SOURCE_DIR}/client_context/gmm_client_context_base.h
${CMAKE_CURRENT_SOURCE_DIR}/client_context${BRANCH_DIR_SUFFIX}/gmm_client_context.cpp
${CMAKE_CURRENT_SOURCE_DIR}/client_context${BRANCH_DIR_SUFFIX}/gmm_client_context.h
${GMM_INTERFACE_FILE}
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper.h
${CMAKE_CURRENT_SOURCE_DIR}/gmm_lib.h

View File

@ -18,13 +18,6 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
if(USE_STATIC_GMM)
set(GMM_INTERFACE_FILE_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/gmm_interface_static_linux.cpp)
else()
set(GMM_INTERFACE_FILE_LINUX ${CMAKE_CURRENT_SOURCE_DIR}/gmm_interface_dynamic_linux.cpp)
endif()
set_property(GLOBAL PROPERTY GMM_INTERFACE_FILE_LINUX ${GMM_INTERFACE_FILE_LINUX})
set(RUNTIME_SRCS_OS_INTERFACE_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/allocator_helper.h
@ -50,7 +43,6 @@ set(RUNTIME_SRCS_OS_INTERFACE_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/drm_neo.h
${CMAKE_CURRENT_SOURCE_DIR}/drm_neo_create.cpp
${CMAKE_CURRENT_SOURCE_DIR}/drm_null_device.h
${GMM_INTERFACE_FILE_LINUX}
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linux_inc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/os_thread_linux.cpp

View File

@ -1,55 +0,0 @@
/*
* Copyright (c) 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "runtime/gmm_helper/gmm_helper.h"
#include "runtime/helpers/debug_helpers.h"
#include "runtime/os_interface/os_library.h"
namespace Os {
extern const char *gmmDllName;
extern const char *gmmEntryName;
} // namespace Os
namespace OCLRT {
decltype(GmmHelper::initGlobalContextFunc) GmmHelper::initGlobalContextFunc = nullptr;
decltype(GmmHelper::destroyGlobalContextFunc) GmmHelper::destroyGlobalContextFunc = nullptr;
decltype(GmmHelper::createClientContextFunc) GmmHelper::createClientContextFunc = nullptr;
decltype(GmmHelper::deleteClientContextFunc) GmmHelper::deleteClientContextFunc = nullptr;
void GmmHelper::loadLib() {
gmmLib = OsLibrary::load(Os::gmmDllName);
UNRECOVERABLE_IF(!gmmLib);
if (gmmLib->isLoaded()) {
auto openGmmFunc = reinterpret_cast<decltype(&OpenGmm)>(gmmLib->getProcAddress(Os::gmmEntryName));
GmmExportEntries entries;
auto status = openGmmFunc(&entries);
if (status == GMM_SUCCESS) {
GmmHelper::initGlobalContextFunc = entries.pfnCreateSingletonContext;
GmmHelper::destroyGlobalContextFunc = entries.pfnDestroySingletonContext;
GmmHelper::createClientContextFunc = entries.pfnCreateClientContext;
GmmHelper::deleteClientContextFunc = entries.pfnDeleteClientContext;
isLoaded = GmmHelper::initGlobalContextFunc && GmmHelper::destroyGlobalContextFunc && GmmHelper::createClientContextFunc && GmmHelper::deleteClientContextFunc;
}
}
UNRECOVERABLE_IF(!isLoaded);
}
} // namespace OCLRT

View File

@ -24,13 +24,6 @@ else()
set(KMDAF_FILE_SUFFIX "_stub")
endif()
if(USE_STATIC_GMM)
set(GMM_INTERFACE_FILE_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/gmm_interface_static_win.cpp)
else()
set(GMM_INTERFACE_FILE_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/gmm_interface_dynamic_win.cpp)
endif()
set_property(GLOBAL PROPERTY GMM_INTERFACE_FILE_WINDOWS ${GMM_INTERFACE_FILE_WINDOWS})
set(RUNTIME_SRCS_OS_INTERFACE_WINDOWS
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/api_win.cpp
@ -46,7 +39,6 @@ set(RUNTIME_SRCS_OS_INTERFACE_WINDOWS
${CMAKE_CURRENT_SOURCE_DIR}/driver_info.h
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface.h
${GMM_INTERFACE_FILE_WINDOWS}
${CMAKE_CURRENT_SOURCE_DIR}/kmdaf_listener${KMDAF_FILE_SUFFIX}.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kmdaf_listener.h
${CMAKE_CURRENT_SOURCE_DIR}/os_inc.h

View File

@ -1,60 +0,0 @@
/*
* Copyright (c) 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "runtime/gmm_helper/gmm_helper.h"
namespace OCLRT {
GMM_STATUS GMM_STDCALL myPfnCreateSingletonContext(const PLATFORM platform, const SKU_FEATURE_TABLE *pSkuTable, const WA_TABLE *pWaTable, const GT_SYSTEM_INFO *pGtSysInfo) {
return GmmInitGlobalContext(platform, pSkuTable, pWaTable, pGtSysInfo, GMM_CLIENT::GMM_OCL_VISTA);
}
decltype(GmmHelper::initGlobalContextFunc) GmmHelper::initGlobalContextFunc = nullptr;
decltype(GmmHelper::destroyGlobalContextFunc) GmmHelper::destroyGlobalContextFunc = nullptr;
decltype(GmmHelper::createClientContextFunc) GmmHelper::createClientContextFunc = nullptr;
decltype(GmmHelper::deleteClientContextFunc) GmmHelper::deleteClientContextFunc = nullptr;
void GmmHelper::loadLib() {
GmmHelper::initGlobalContextFunc = myPfnCreateSingletonContext;
GmmHelper::destroyGlobalContextFunc = GmmDestroyGlobalContext;
GmmHelper::createClientContextFunc = GmmCreateClientContext;
GmmHelper::deleteClientContextFunc = GmmDeleteClientContext;
isLoaded = true;
}
} // namespace OCLRT
extern "C" {
void GMMDebugBreak(const char *file, const char *function, const int line) {
}
void GMMPrintMessage(uint32_t debugLevel, const char *debugMessageFmt, ...) {
}
typedef struct GfxDebugControlRec {
uint32_t Version;
uint32_t Size;
uint32_t AssertEnableMask;
uint32_t EnableDebugFileDump;
uint32_t DebugEnableMask;
uint32_t RingBufDbgMask;
uint32_t ReportAssertEnable;
uint32_t AssertBreakDisable;
} GFX_DEBUG_CONTROL, *PGFX_DEBUG_CONTROL;
PGFX_DEBUG_CONTROL pDebugControl;
}