mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 08:07:19 +08:00
Resolves: NEO-4082, NEO-4080, NEO-4079 Change-Id: If8d0b69126d6442e8a9a102cd21f78944f8551e9 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
52 lines
1.5 KiB
C++
52 lines
1.5 KiB
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "core/gmm_helper/gmm_lib.h"
|
|
|
|
#include "External/Common/GmmPageTableMgr.h"
|
|
|
|
#include <functional>
|
|
#include <memory>
|
|
|
|
namespace NEO {
|
|
class Gmm;
|
|
class LinearStream;
|
|
|
|
void gmmSetCsrHandle(GMM_PAGETABLE_MGR *pageTableManager, HANDLE csrHandle);
|
|
class GmmPageTableMngr {
|
|
public:
|
|
MOCKABLE_VIRTUAL ~GmmPageTableMngr();
|
|
|
|
static GmmPageTableMngr *create(unsigned int translationTableFlags, GMM_TRANSLATIONTABLE_CALLBACKS *translationTableCb);
|
|
|
|
MOCKABLE_VIRTUAL void setCsrHandle(void *csrHandle);
|
|
|
|
bool updateAuxTable(uint64_t gpuVa, Gmm *gmm, bool map);
|
|
void initPageTableManagerRegisters();
|
|
|
|
bool initialized = false;
|
|
|
|
protected:
|
|
GmmPageTableMngr() = default;
|
|
|
|
MOCKABLE_VIRTUAL GMM_STATUS updateAuxTable(const GMM_DDI_UPDATEAUXTABLE *ddiUpdateAuxTable) {
|
|
return pageTableManager->UpdateAuxTable(ddiUpdateAuxTable);
|
|
}
|
|
|
|
MOCKABLE_VIRTUAL GMM_STATUS initContextAuxTableRegister(HANDLE initialBBHandle, GMM_ENGINE_TYPE engineType) {
|
|
return pageTableManager->InitContextAuxTableRegister(initialBBHandle, engineType);
|
|
}
|
|
|
|
GmmPageTableMngr(unsigned int translationTableFlags, GMM_TRANSLATIONTABLE_CALLBACKS *translationTableCb);
|
|
GMM_CLIENT_CONTEXT *clientContext = nullptr;
|
|
GMM_PAGETABLE_MGR *pageTableManager = nullptr;
|
|
decltype(&gmmSetCsrHandle) gmmSetCsrHandleFunc = gmmSetCsrHandle;
|
|
void *csrHandle = nullptr;
|
|
};
|
|
} // namespace NEO
|