2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2018-09-18 15:11:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/gmm_helper/gmm_lib.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2019-11-07 01:14:30 +08:00
|
|
|
#include "External/Common/GmmPageTableMgr.h"
|
|
|
|
|
2018-05-06 03:30:37 +08:00
|
|
|
#include <functional>
|
2019-02-27 18:39:32 +08:00
|
|
|
#include <memory>
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2019-11-07 01:14:30 +08:00
|
|
|
class Gmm;
|
2020-01-23 21:27:01 +08:00
|
|
|
class GmmClientContext;
|
2019-11-07 01:14:30 +08:00
|
|
|
class LinearStream;
|
2017-12-21 07:45:38 +08:00
|
|
|
class GmmPageTableMngr {
|
|
|
|
public:
|
2018-07-03 16:00:12 +08:00
|
|
|
MOCKABLE_VIRTUAL ~GmmPageTableMngr();
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-01-23 21:27:01 +08:00
|
|
|
static GmmPageTableMngr *create(GmmClientContext *clientContext, unsigned int translationTableFlags, GMM_TRANSLATIONTABLE_CALLBACKS *translationTableCb);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-11-07 01:14:30 +08:00
|
|
|
MOCKABLE_VIRTUAL void setCsrHandle(void *csrHandle);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-11-07 01:14:30 +08:00
|
|
|
bool updateAuxTable(uint64_t gpuVa, Gmm *gmm, bool map);
|
2019-12-31 17:45:14 +08:00
|
|
|
bool initPageTableManagerRegisters(void *csrHandle);
|
2019-11-07 01:14:30 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
GmmPageTableMngr() = default;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
MOCKABLE_VIRTUAL GMM_STATUS updateAuxTable(const GMM_DDI_UPDATEAUXTABLE *ddiUpdateAuxTable) {
|
|
|
|
return pageTableManager->UpdateAuxTable(ddiUpdateAuxTable);
|
|
|
|
}
|
|
|
|
|
2019-11-07 01:14:30 +08:00
|
|
|
MOCKABLE_VIRTUAL GMM_STATUS initContextAuxTableRegister(HANDLE initialBBHandle, GMM_ENGINE_TYPE engineType) {
|
|
|
|
return pageTableManager->InitContextAuxTableRegister(initialBBHandle, engineType);
|
|
|
|
}
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-01-23 21:27:01 +08:00
|
|
|
GmmPageTableMngr(GmmClientContext *clientContext, unsigned int translationTableFlags, GMM_TRANSLATIONTABLE_CALLBACKS *translationTableCb);
|
2018-07-03 16:00:12 +08:00
|
|
|
GMM_CLIENT_CONTEXT *clientContext = nullptr;
|
|
|
|
GMM_PAGETABLE_MGR *pageTableManager = nullptr;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|