Files
eden/src/video_core/host1x/sync_manager.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.1 KiB
C++
Raw Normal View History

2022-04-28 18:24:11 +02:00
// SPDX-FileCopyrightText: Ryujinx Team and Contributors
// SPDX-License-Identifier: MIT
2020-10-26 23:07:36 -04:00
#pragma once
#include <mutex>
#include <vector>
#include "common/common_types.h"
namespace Tegra {
2022-01-30 10:31:13 +01:00
namespace Host1x {
2022-01-30 22:26:01 +01:00
class Host1x;
2020-10-26 23:07:36 -04:00
struct SyncptIncr {
u32 id;
u32 class_id;
u32 syncpt_id;
bool complete;
SyncptIncr(u32 id_, u32 class_id_, u32 syncpt_id_, bool done = false)
: id(id_), class_id(class_id_), syncpt_id(syncpt_id_), complete(done) {}
2020-10-26 23:07:36 -04:00
};
class SyncptIncrManager {
public:
2022-01-30 22:26:01 +01:00
explicit SyncptIncrManager(Host1x& host1x);
2020-10-26 23:07:36 -04:00
~SyncptIncrManager();
/// Add syncpoint id and increment all
void Increment(u32 id);
/// Returns a handle to increment later
u32 IncrementWhenDone(u32 class_id, u32 id);
/// IncrememntAllDone, including handle
void SignalDone(u32 handle);
/// Increment all sequential pending increments that are already done.
void IncrementAllDone();
private:
std::vector<SyncptIncr> increments;
std::mutex increment_lock;
u32 current_id{};
2022-01-30 22:26:01 +01:00
Host1x& host1x;
2020-10-26 23:07:36 -04:00
};
2022-01-30 10:31:13 +01:00
} // namespace Host1x
2020-10-26 23:07:36 -04:00
} // namespace Tegra