mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Cleanup for WDDM_LINUX config
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
30a20d5f15
commit
b64b7f16a0
@@ -41,7 +41,7 @@ function(generate_shared_lib LIB_NAME MOCKABLE)
|
||||
${SOURCE_LEVEL_DEBUGGER_HEADERS_DIR}
|
||||
)
|
||||
|
||||
if(WIN32 OR WDDM_LINUX)
|
||||
if(WIN32 OR NOT DISABLE_WDDM_LINUX)
|
||||
target_include_directories(${LIB_NAME} PUBLIC ${WDK_INCLUDE_PATHS})
|
||||
endif()
|
||||
|
||||
@@ -73,9 +73,11 @@ set(CORE_SOURCES ${CORE_SRCS_GENX_ALL_BASE})
|
||||
|
||||
add_subdirectories()
|
||||
|
||||
if(WIN32)
|
||||
if(WIN32 OR NOT DISABLE_WDDM_LINUX)
|
||||
list(APPEND CORE_SOURCES ${CORE_SRCS_GENX_ALL_WINDOWS})
|
||||
else()
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
list(APPEND CORE_SOURCES ${CORE_SRCS_GENX_ALL_LINUX})
|
||||
endif()
|
||||
|
||||
@@ -141,6 +143,14 @@ else()
|
||||
NEO_CORE_PAGE_FAULT_MANAGER_LINUX
|
||||
NEO_CORE_UTILITIES_LINUX
|
||||
)
|
||||
if(NOT DISABLE_WDDM_LINUX)
|
||||
append_sources_from_properties(CORE_SOURCES
|
||||
NEO_CORE_SRCS_HELPERS_WINDOWS
|
||||
NEO_CORE_GMM_HELPER_WINDOWS
|
||||
NEO_CORE_OS_INTERFACE_WDDM
|
||||
NEO_CORE_SKU_INFO_WINDOWS
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${BRANCH_TYPE}/core_sources.cmake)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/windows/gmm_memory_base.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/os_interface/windows/windows_defs.h"
|
||||
|
||||
#include "gmm_client_context.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
bool GmmMemoryBase::configureDeviceAddressSpace(GMM_ESCAPE_HANDLE hAdapter,
|
||||
GMM_ESCAPE_HANDLE hDevice,
|
||||
GMM_ESCAPE_FUNC_TYPE pfnEscape,
|
||||
GMM_GFX_SIZE_T SvmSize,
|
||||
BOOLEAN BDWL3Coherency) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}; // namespace NEO
|
||||
@@ -37,7 +37,6 @@ set(NEO_CORE_OS_INTERFACE_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/drm_memory_operations_handler_create.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/drm_query_extended.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_drm.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_wddm_stub.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_device_id.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_device_id_linux.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linux_inc.cpp
|
||||
@@ -70,6 +69,17 @@ set(NEO_CORE_OS_INTERFACE_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/system_info_impl.h
|
||||
)
|
||||
|
||||
if(DISABLE_WDDM_LINUX)
|
||||
list(APPEND NEO_CORE_OS_INTERFACE_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_wddm_stub.cpp
|
||||
)
|
||||
else()
|
||||
list(APPEND NEO_CORE_OS_INTERFACE_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_linux/sys_calls_win.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_linux/compatible_driver_store.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(SUPPORT_DG1 AND "${BRANCH_TYPE}" STREQUAL "")
|
||||
list(APPEND NEO_CORE_OS_INTERFACE_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drm_memory_manager_allocate_in_device_pool_dg1.cpp
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
bool isCompatibleDriverStore(std::string &&deviceRegistryPath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
bool isShutdownInProgress() {
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned int getPid() {
|
||||
return static_cast<uint32_t>(getpid());
|
||||
}
|
||||
|
||||
unsigned int readEnablePreemptionRegKey() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
Wddm::CreateDXGIFactoryFcn getCreateDxgiFactory() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Wddm::DXCoreCreateAdapterFactoryFcn getDXCoreCreateAdapterFactory() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Wddm::GetSystemInfoFcn getGetSystemInfo() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Wddm::VirtualFreeFcn getVirtualFree() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Wddm::VirtualAllocFcn getVirtualAlloc() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -98,6 +98,13 @@ set(NEO_CORE_OS_INTERFACE_WDDM
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/windows_wrapper.h
|
||||
)
|
||||
|
||||
if(NOT WIN32 AND NOT DISABLE_WDDM_LINUX)
|
||||
list(APPEND NEO_CORE_OS_INTERFACE_WDDM
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm/adapter_factory_create_dxcore.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/trim_callback_stub.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
add_subdirectories()
|
||||
|
||||
set_property(GLOBAL PROPERTY NEO_CORE_OS_INTERFACE_WINDOWS ${NEO_CORE_OS_INTERFACE_WINDOWS})
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/gmm_helper/gmm.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/gmm_helper/page_table_mngr.h"
|
||||
#include "shared/source/gmm_helper/resource_info.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/helpers/windows/gmm_callbacks.h"
|
||||
#include "shared/source/os_interface/windows/gdi_interface.h"
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
|
||||
#include "gmm_client_context.h"
|
||||
#include "gmm_memory.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
bool Wddm::configureDeviceAddressSpace() {
|
||||
GMM_DEVICE_CALLBACKS_INT deviceCallbacks{};
|
||||
GMM_DEVICE_INFO deviceInfo{};
|
||||
deviceInfo.pDeviceCb = &deviceCallbacks;
|
||||
if (!gmmMemory->setDeviceInfo(&deviceInfo)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
maximumApplicationAddress = MemoryConstants::max64BitAppAddress;
|
||||
auto productFamily = gfxPlatform->eProductFamily;
|
||||
if (!hardwareInfoTable[productFamily]) {
|
||||
return false;
|
||||
}
|
||||
auto svmSize = hardwareInfoTable[productFamily]->capabilityTable.gpuAddressSpace >= MemoryConstants::max64BitAppAddress
|
||||
? maximumApplicationAddress + 1u
|
||||
: 0u;
|
||||
|
||||
bool obtainMinAddress = rootDeviceEnvironment.getHardwareInfo()->platform.eRenderCoreFamily == IGFX_GEN12LP_CORE;
|
||||
return gmmMemory->configureDevice(getAdapter(), device, getGdi()->escape, svmSize, featureTable->ftrL3IACoherency, minAddress, obtainMinAddress);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
|
||||
#include "gmm_client_context.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
void Wddm::setGmmInputArgs(void *args) {
|
||||
auto gmmInArgs = reinterpret_cast<GMM_INIT_IN_ARGS *>(args);
|
||||
gmmInArgs->FileDescriptor = 0U;
|
||||
gmmInArgs->ClientType = GMM_CLIENT::GMM_OCL_VISTA;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#if _WIN32
|
||||
#include <windows.h>
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4005)
|
||||
@@ -30,3 +31,8 @@ LSTATUS APIENTRY RegQueryValueExA(
|
||||
LPDWORD lpType,
|
||||
LPBYTE lpData,
|
||||
LPDWORD lpcbData);
|
||||
#else
|
||||
#include <cstdint>
|
||||
#include <x86intrin.h>
|
||||
#define C_ASSERT(e) static_assert(e, #e)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user