summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvdrv/nvdata.h
blob: 22b1dc79b629017b52cbca441d936a4e9aa59812 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once

#include <array>
#include "common/common_types.h"

namespace Service::Nvidia {

constexpr u32 MaxSyncPoints = 192;
constexpr u32 MaxNvEvents = 64;

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;
};

enum NvResult : u32 {
    Success = 0,
    BadParameter = 4,
    Timeout = 5,
    ResourceError = 15,
};

enum class EventState {
    Free = 0,
    Registered = 1,
    Waiting = 2,
    Busy = 3,
};

struct IoctlCtrl {
    bool fresh_call{true};
    bool must_delay{};
    s64 timeout{};
    s32 event_id{-1};
};

} // namespace Service::Nvidia