2018-05-05 21:30:37 +02:00
|
|
|
/*
|
2021-05-02 22:41:01 +02:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2018-09-18 09:11:08 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2018-05-05 21:30:37 +02:00
|
|
|
|
2021-06-28 17:36:16 +00:00
|
|
|
#include "shared/source/gmm_helper/client_context/gmm_client_context.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#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"
|
2018-05-05 21:30:37 +02:00
|
|
|
|
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;
|
2021-05-02 22:41:01 +02:00
|
|
|
ddiUpdateAuxTable.BaseResInfo = gmm->gmmResourceInfo->peekGmmResourceInfo();
|
2019-11-06 18:14:30 +01:00
|
|
|
ddiUpdateAuxTable.DoNotWait = true;
|
2021-09-29 15:59:41 +00:00
|
|
|
ddiUpdateAuxTable.Map = map;
|
2019-11-06 18:14:30 +01:00
|
|
|
|
|
|
|
return updateAuxTable(&ddiUpdateAuxTable) == GMM_STATUS::GMM_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2019-12-31 10:45:14 +01:00
|
|
|
bool GmmPageTableMngr::initPageTableManagerRegisters(void *csrHandle) {
|
|
|
|
auto status = initContextAuxTableRegister(csrHandle, GMM_ENGINE_TYPE::ENGINE_TYPE_RCS);
|
|
|
|
return status == GMM_SUCCESS;
|
2019-12-23 12:09:16 +01:00
|
|
|
}
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|