2018-08-21 23:36:08 +08:00
|
|
|
/*
|
2024-06-06 19:23:55 +08:00
|
|
|
* Copyright (C) 2018-2024 Intel Corporation
|
2018-08-21 23:36:08 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-08-21 23:36:08 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/os_interface/os_context.h"
|
|
|
|
#include "shared/source/os_interface/windows/wddm_residency_controller.h"
|
2018-08-21 23:36:08 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-08-21 23:36:08 +08:00
|
|
|
|
2018-08-23 23:53:58 +08:00
|
|
|
class Wddm;
|
2019-09-13 14:13:02 +08:00
|
|
|
|
|
|
|
struct HardwareQueue {
|
|
|
|
D3DKMT_HANDLE handle = 0;
|
|
|
|
D3DKMT_HANDLE progressFenceHandle = 0;
|
|
|
|
VOID *progressFenceCpuVA = nullptr;
|
|
|
|
D3DGPU_VIRTUAL_ADDRESS progressFenceGpuVA = 0;
|
|
|
|
};
|
|
|
|
|
2019-02-27 18:17:17 +08:00
|
|
|
class OsContextWin : public OsContext {
|
2018-08-21 23:36:08 +08:00
|
|
|
public:
|
2019-02-27 18:17:17 +08:00
|
|
|
OsContextWin() = delete;
|
|
|
|
~OsContextWin() override;
|
|
|
|
|
2022-11-17 03:31:25 +08:00
|
|
|
OsContextWin(Wddm &wddm, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
2019-02-27 18:17:17 +08:00
|
|
|
|
2019-03-01 19:21:30 +08:00
|
|
|
D3DKMT_HANDLE getWddmContextHandle() const { return wddmContextHandle; }
|
|
|
|
void setWddmContextHandle(D3DKMT_HANDLE wddmContextHandle) { this->wddmContextHandle = wddmContextHandle; }
|
2019-09-13 14:13:02 +08:00
|
|
|
HardwareQueue getHwQueue() const { return hardwareQueue; }
|
|
|
|
void setHwQueue(HardwareQueue hardwareQueue) { this->hardwareQueue = hardwareQueue; }
|
2023-09-20 21:08:46 +08:00
|
|
|
bool isDirectSubmissionSupported() const override;
|
2018-08-27 21:48:29 +08:00
|
|
|
Wddm *getWddm() const { return &wddm; }
|
2019-09-13 14:13:02 +08:00
|
|
|
MOCKABLE_VIRTUAL WddmResidencyController &getResidencyController() { return residencyController; }
|
2022-11-17 03:31:25 +08:00
|
|
|
static OsContext *create(OSInterface *osInterface, uint32_t rootDeviceIndex, uint32_t contextId, const EngineDescriptor &engineDescriptor);
|
2021-12-16 10:13:00 +08:00
|
|
|
void reInitializeContext() override;
|
2022-07-15 09:28:43 +08:00
|
|
|
void getDeviceLuidArray(std::vector<uint8_t> &luidData, size_t arraySize);
|
2022-12-08 08:05:54 +08:00
|
|
|
uint32_t getDeviceNodeMask();
|
2023-03-31 19:41:17 +08:00
|
|
|
uint64_t getOfflineDumpContextId(uint32_t deviceIndex) const override;
|
2018-08-21 23:36:08 +08:00
|
|
|
|
|
|
|
protected:
|
2024-06-06 19:23:55 +08:00
|
|
|
bool initializeContext(bool allocateInterrupt) override;
|
2021-04-16 00:14:04 +08:00
|
|
|
|
2022-07-27 09:00:20 +08:00
|
|
|
WddmResidencyController residencyController;
|
2019-09-13 14:13:02 +08:00
|
|
|
HardwareQueue hardwareQueue;
|
2018-08-21 23:36:08 +08:00
|
|
|
Wddm &wddm;
|
2022-07-27 09:00:20 +08:00
|
|
|
D3DKMT_HANDLE wddmContextHandle = 0;
|
2018-08-21 23:36:08 +08:00
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|