Files
compute-runtime/shared/source/direct_submission/linux/drm_direct_submission.h
Lukasz Jobczyk bc2b49b958 feature: Introduce ULLS light
Add core implementation of ULLS without VM_BIND interface aka ULLS
light.

Related-To: NEO-13922

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
2025-02-12 17:52:02 +01:00

54 lines
1.9 KiB
C++

/*
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/direct_submission/direct_submission_hw.h"
#include "shared/source/os_interface/linux/drm_buffer_object.h"
#include "shared/source/os_interface/linux/drm_wrappers.h"
namespace NEO {
template <typename GfxFamily, typename Dispatcher>
class DrmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
public:
using DirectSubmissionHw<GfxFamily, Dispatcher>::ringCommandStream;
using DirectSubmissionHw<GfxFamily, Dispatcher>::switchRingBuffersAllocations;
DrmDirectSubmission(const DirectSubmissionInputParams &inputParams);
~DrmDirectSubmission() override;
TaskCountType *getCompletionValuePointer() override;
protected:
bool allocateOsResources() override;
bool submit(uint64_t gpuAddress, size_t size, ResidencyContainer *allocationsForResidency) override;
bool handleResidency() override;
void handleRingRestartForUllsLightResidency(ResidencyContainer *allocationsForResidency) override;
void handleStopRingBuffer() override;
void ensureRingCompletion() override;
void handleSwitchRingBuffers(ResidencyContainer *allocationsForResidency) override;
uint64_t updateTagValue(bool requireMonitorFence) override;
void getTagAddressValue(TagData &tagData) override;
bool isCompleted(uint32_t ringBufferIndex) override;
bool isCompletionFenceSupported();
bool isGpuHangDetected(std::chrono::high_resolution_clock::time_point &lastHangCheckTime);
MOCKABLE_VIRTUAL void wait(TaskCountType taskCountToWait);
TagData currentTagData{};
volatile TagAddressType *tagAddress;
TaskCountType completionFenceValue{};
std::chrono::microseconds gpuHangCheckPeriod{CommonConstants::gpuHangCheckTimeInUS};
std::vector<BufferObject *> residency{};
std::vector<ExecObject> execObjectsStorage{};
};
} // namespace NEO