2019-06-07 15:34:55 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
#include "common/common_types.h"
|
|
|
|
|
|
|
|
namespace Service::Nvidia {
|
|
|
|
|
2019-06-07 16:56:30 +00:00
|
|
|
constexpr u32 MaxSyncPoints = 192;
|
2019-06-07 22:41:55 +00:00
|
|
|
constexpr u32 MaxNvEvents = 64;
|
2019-06-07 16:56:30 +00:00
|
|
|
|
2019-06-07 15:34:55 +00:00
|
|
|
struct Fence {
|
|
|
|
s32 id;
|
|
|
|
u32 value;
|
|
|
|
};
|
|
|
|
|
|
|
|
static_assert(sizeof(Fence) == 8, "Fence has wrong size");
|
|
|
|
|
|
|
|
struct MultiFence {
|
|
|
|
u32 num_fences;
|
|
|
|
std::array<Fence, 4> fences;
|
|
|
|
};
|
|
|
|
|
2019-06-07 22:41:55 +00:00
|
|
|
enum NvResult : u32 {
|
2019-06-07 15:34:55 +00:00
|
|
|
Success = 0,
|
2019-06-07 22:41:55 +00:00
|
|
|
BadParameter = 4,
|
|
|
|
Timeout = 5,
|
|
|
|
ResourceError = 15,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class EventState {
|
|
|
|
Free = 0,
|
|
|
|
Registered = 1,
|
|
|
|
Waiting = 2,
|
|
|
|
Busy = 3,
|
2019-06-07 15:34:55 +00:00
|
|
|
};
|
|
|
|
|
2019-09-19 05:37:25 +00:00
|
|
|
enum class IoctlVersion : u32 {
|
|
|
|
Version1,
|
|
|
|
Version2,
|
|
|
|
Version3,
|
|
|
|
};
|
|
|
|
|
2019-06-16 15:43:41 +00:00
|
|
|
struct IoctlCtrl {
|
2019-07-01 15:10:27 +00:00
|
|
|
// First call done to the servioce for services that call itself again after a call.
|
2019-06-16 15:43:41 +00:00
|
|
|
bool fresh_call{true};
|
2019-07-01 15:10:27 +00:00
|
|
|
// Tells the Ioctl Wrapper that it must delay the IPC response and send the thread to sleep
|
2019-06-16 15:43:41 +00:00
|
|
|
bool must_delay{};
|
2019-07-01 15:10:27 +00:00
|
|
|
// Timeout for the delay
|
2019-06-16 15:43:41 +00:00
|
|
|
s64 timeout{};
|
2019-07-01 15:10:27 +00:00
|
|
|
// NV Event Id
|
2019-06-16 15:43:41 +00:00
|
|
|
s32 event_id{-1};
|
|
|
|
};
|
|
|
|
|
2019-06-07 15:34:55 +00:00
|
|
|
} // namespace Service::Nvidia
|