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