2020-01-16 00:02:47 +08:00
|
|
|
/*
|
2025-02-11 22:31:01 +08:00
|
|
|
* Copyright (C) 2020-2025 Intel Corporation
|
2020-01-16 00:02:47 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/direct_submission/direct_submission_hw.h"
|
|
|
|
#include "shared/source/os_interface/windows/windows_defs.h"
|
2024-10-10 20:55:26 +08:00
|
|
|
|
|
|
|
struct COMMAND_BUFFER_HEADER_REC; // NOLINT(readability-identifier-naming), forward declaration from sharedata_wrapper.h
|
2021-06-05 18:09:29 +08:00
|
|
|
typedef struct COMMAND_BUFFER_HEADER_REC COMMAND_BUFFER_HEADER;
|
2020-01-16 00:02:47 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
class OsContextWin;
|
|
|
|
class Wddm;
|
|
|
|
|
2020-03-27 03:13:10 +08:00
|
|
|
template <typename GfxFamily, typename Dispatcher>
|
|
|
|
class WddmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
|
2020-01-16 00:02:47 +08:00
|
|
|
public:
|
2022-04-20 21:55:31 +08:00
|
|
|
WddmDirectSubmission(const DirectSubmissionInputParams &inputParams);
|
2020-01-16 00:02:47 +08:00
|
|
|
|
2022-05-10 01:40:30 +08:00
|
|
|
~WddmDirectSubmission() override;
|
2020-01-16 00:02:47 +08:00
|
|
|
|
2025-03-04 21:29:33 +08:00
|
|
|
void flushMonitorFence(bool notifyKmd) override;
|
2024-08-07 00:13:06 +08:00
|
|
|
void unblockPagingFenceSemaphore(uint64_t pagingFenceValue) override;
|
2023-08-07 21:33:24 +08:00
|
|
|
|
2020-01-16 00:02:47 +08:00
|
|
|
protected:
|
2020-07-17 17:28:59 +08:00
|
|
|
bool allocateOsResources() override;
|
2025-02-24 19:22:15 +08:00
|
|
|
bool submit(uint64_t gpuAddress, size_t size, const ResidencyContainer *allocationsForResidency) override;
|
2020-01-16 00:02:47 +08:00
|
|
|
|
|
|
|
bool handleResidency() override;
|
2022-06-01 18:05:07 +08:00
|
|
|
void handleCompletionFence(uint64_t completionValue, MonitoredFence &fence);
|
2023-07-05 16:55:12 +08:00
|
|
|
void ensureRingCompletion() override;
|
2023-11-17 21:14:41 +08:00
|
|
|
void handleSwitchRingBuffers(ResidencyContainer *allocationsForResidency) override;
|
2023-08-07 21:33:24 +08:00
|
|
|
void handleStopRingBuffer() override;
|
2023-09-20 20:54:50 +08:00
|
|
|
uint64_t updateTagValue(bool requireMonitorFence) override;
|
|
|
|
bool dispatchMonitorFenceRequired(bool requireMonitorFence) override;
|
2023-11-27 17:58:31 +08:00
|
|
|
MOCKABLE_VIRTUAL uint64_t updateTagValueImpl(uint32_t completionBufferIndex);
|
2020-01-16 00:02:47 +08:00
|
|
|
void getTagAddressValue(TagData &tagData) override;
|
2022-06-01 18:05:07 +08:00
|
|
|
bool isCompleted(uint32_t ringBufferIndex) override;
|
2023-11-17 21:14:41 +08:00
|
|
|
MOCKABLE_VIRTUAL void updateMonitorFenceValueForResidencyList(ResidencyContainer *allocationsForResidency);
|
2025-03-05 08:25:44 +08:00
|
|
|
void makeGlobalFenceAlwaysResident() override;
|
2020-01-16 00:02:47 +08:00
|
|
|
|
|
|
|
OsContextWin *osContextWin;
|
|
|
|
Wddm *wddm;
|
|
|
|
MonitoredFence ringFence;
|
2021-06-05 18:09:29 +08:00
|
|
|
std::unique_ptr<COMMAND_BUFFER_HEADER> commandBufferHeader;
|
2020-01-16 00:02:47 +08:00
|
|
|
};
|
|
|
|
} // namespace NEO
|