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
|
|
|
|
2019-12-04 12:36:16 +01:00
|
|
|
#include "core/gmm_helper/gmm_helper.h"
|
2019-11-06 18:14:30 +01:00
|
|
|
#include "runtime/gmm_helper/gmm.h"
|
2018-05-05 21:30:37 +02:00
|
|
|
#include "runtime/gmm_helper/page_table_mngr.h"
|
2019-11-06 18:14:30 +01:00
|
|
|
#include "runtime/gmm_helper/resource_info.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-03 10:00:12 +02:00
|
|
|
GmmPageTableMngr::~GmmPageTableMngr() {
|
|
|
|
|
if (clientContext) {
|
|
|
|
|
clientContext->DestroyPageTblMgrObject(pageTableManager);
|
|
|
|
|
}
|
2018-05-05 21:30:37 +02:00
|
|
|
}
|
|
|
|
|
|
2019-11-06 18:14:30 +01:00
|
|
|
bool GmmPageTableMngr::updateAuxTable(uint64_t gpuVa, Gmm *gmm, bool map) {
|
|
|
|
|
GMM_DDI_UPDATEAUXTABLE ddiUpdateAuxTable = {};
|
|
|
|
|
ddiUpdateAuxTable.BaseGpuVA = gpuVa;
|
|
|
|
|
ddiUpdateAuxTable.BaseResInfo = gmm->gmmResourceInfo->peekHandle();
|
|
|
|
|
ddiUpdateAuxTable.DoNotWait = true;
|
|
|
|
|
ddiUpdateAuxTable.Map = map ? 1u : 0u;
|
|
|
|
|
|
|
|
|
|
return updateAuxTable(&ddiUpdateAuxTable) == GMM_STATUS::GMM_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GmmPageTableMngr::initPageTableManagerRegisters() {
|
|
|
|
|
if (!initialized) {
|
|
|
|
|
initContextAuxTableRegister(this, GMM_ENGINE_TYPE::ENGINE_TYPE_RCS);
|
|
|
|
|
|
|
|
|
|
initialized = true;
|
|
|
|
|
}
|
2018-05-05 21:30:37 +02:00
|
|
|
}
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|