2018-05-05 21:30:37 +02:00
|
|
|
/*
|
2019-02-27 11:39:32 +01:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
2018-09-18 09:11:08 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
2018-05-05 21:30:37 +02:00
|
|
|
|
|
|
|
|
#include "runtime/gmm_helper/gmm_memory_base.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2018-05-05 21:30:37 +02:00
|
|
|
#include "runtime/gmm_helper/gmm_helper.h"
|
2018-08-23 11:29:39 +02:00
|
|
|
#include "runtime/os_interface/windows/windows_defs.h"
|
2018-05-05 21:30:37 +02:00
|
|
|
|
2019-02-27 11:39:32 +01:00
|
|
|
#include "gmm_client_context.h"
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-07-23 10:06:00 +02:00
|
|
|
GmmMemoryBase::GmmMemoryBase() {
|
2018-07-23 12:23:48 +02:00
|
|
|
clientContext = GmmHelper::getClientContext()->getHandle();
|
2018-07-03 10:00:12 +02:00
|
|
|
}
|
2018-05-05 21:30:37 +02:00
|
|
|
bool GmmMemoryBase::configureDeviceAddressSpace(GMM_ESCAPE_HANDLE hAdapter,
|
|
|
|
|
GMM_ESCAPE_HANDLE hDevice,
|
|
|
|
|
GMM_ESCAPE_FUNC_TYPE pfnEscape,
|
|
|
|
|
GMM_GFX_SIZE_T SvmSize,
|
2018-08-23 11:29:39 +02:00
|
|
|
BOOLEAN BDWL3Coherency) {
|
2018-07-03 10:00:12 +02:00
|
|
|
return clientContext->ConfigureDeviceAddressSpace(
|
2018-05-05 21:30:37 +02:00
|
|
|
{hAdapter},
|
|
|
|
|
{hDevice},
|
|
|
|
|
{pfnEscape},
|
|
|
|
|
SvmSize,
|
2018-08-23 11:29:39 +02:00
|
|
|
0,
|
|
|
|
|
0,
|
2018-05-05 21:30:37 +02:00
|
|
|
BDWL3Coherency,
|
2018-08-23 11:29:39 +02:00
|
|
|
0,
|
|
|
|
|
0) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool GmmMemoryBase::configureDevice(GMM_ESCAPE_HANDLE hAdapter,
|
|
|
|
|
GMM_ESCAPE_HANDLE hDevice,
|
|
|
|
|
GMM_ESCAPE_FUNC_TYPE pfnEscape,
|
|
|
|
|
GMM_GFX_SIZE_T SvmSize,
|
|
|
|
|
BOOLEAN BDWL3Coherency,
|
|
|
|
|
GMM_GFX_PARTITIONING &gfxPartition,
|
|
|
|
|
uintptr_t &minAddress) {
|
|
|
|
|
minAddress = windowsMinAddress;
|
|
|
|
|
return configureDeviceAddressSpace(hAdapter, hDevice, pfnEscape, SvmSize, BDWL3Coherency);
|
2018-05-05 21:30:37 +02:00
|
|
|
}
|
2019-03-26 11:59:46 +01:00
|
|
|
}; // namespace NEO
|