2018-08-21 17:36:08 +02:00
|
|
|
/*
|
2021-12-16 02:13:00 +00:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2018-08-21 17:36:08 +02:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-08-21 17:36:08 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/os_interface/os_context.h"
|
|
|
|
#include "shared/source/os_interface/windows/wddm_residency_controller.h"
|
2018-08-21 17:36:08 +02:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-08-21 17:36:08 +02:00
|
|
|
|
2018-08-23 17:53:58 +02:00
|
|
|
class Wddm;
|
2019-09-13 08:13:02 +02:00
|
|
|
|
|
|
|
struct HardwareQueue {
|
|
|
|
D3DKMT_HANDLE handle = 0;
|
|
|
|
D3DKMT_HANDLE progressFenceHandle = 0;
|
|
|
|
VOID *progressFenceCpuVA = nullptr;
|
|
|
|
D3DGPU_VIRTUAL_ADDRESS progressFenceGpuVA = 0;
|
|
|
|
};
|
|
|
|
|
2019-02-27 11:17:17 +01:00
|
|
|
class OsContextWin : public OsContext {
|
2018-08-21 17:36:08 +02:00
|
|
|
public:
|
2019-02-27 11:17:17 +01:00
|
|
|
OsContextWin() = delete;
|
|
|
|
~OsContextWin() override;
|
|
|
|
|
2021-08-11 17:36:00 +00:00
|
|
|
OsContextWin(Wddm &wddm, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
2019-02-27 11:17:17 +01:00
|
|
|
|
2019-03-01 12:21:30 +01:00
|
|
|
D3DKMT_HANDLE getWddmContextHandle() const { return wddmContextHandle; }
|
|
|
|
void setWddmContextHandle(D3DKMT_HANDLE wddmContextHandle) { this->wddmContextHandle = wddmContextHandle; }
|
2019-09-13 08:13:02 +02:00
|
|
|
HardwareQueue getHwQueue() const { return hardwareQueue; }
|
|
|
|
void setHwQueue(HardwareQueue hardwareQueue) { this->hardwareQueue = hardwareQueue; }
|
2018-08-27 15:48:29 +02:00
|
|
|
Wddm *getWddm() const { return &wddm; }
|
2019-09-13 08:13:02 +02:00
|
|
|
MOCKABLE_VIRTUAL WddmResidencyController &getResidencyController() { return residencyController; }
|
2021-08-11 17:36:00 +00:00
|
|
|
static OsContext *create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
2021-12-16 02:13:00 +00:00
|
|
|
void reInitializeContext() override;
|
2022-05-17 01:26:26 +00:00
|
|
|
MOCKABLE_VIRTUAL bool isDebuggableContext() { return debuggableContext; };
|
2018-08-21 17:36:08 +02:00
|
|
|
|
|
|
|
protected:
|
2021-04-15 16:14:04 +00:00
|
|
|
void initializeContext() override;
|
|
|
|
|
2022-07-27 01:00:20 +00:00
|
|
|
WddmResidencyController residencyController;
|
2019-09-13 08:13:02 +02:00
|
|
|
HardwareQueue hardwareQueue;
|
2018-08-21 17:36:08 +02:00
|
|
|
Wddm &wddm;
|
2022-07-27 01:00:20 +00:00
|
|
|
D3DKMT_HANDLE wddmContextHandle = 0;
|
2022-05-17 01:26:26 +00:00
|
|
|
bool debuggableContext = false;
|
2018-08-21 17:36:08 +02:00
|
|
|
};
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|