diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/posix/clk_arb.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/posix/clk_arb.c | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/posix/clk_arb.c b/drivers/gpu/nvgpu/common/posix/clk_arb.c new file mode 100644 index 00000000..f41383cd --- /dev/null +++ b/drivers/gpu/nvgpu/common/posix/clk_arb.c | |||
@@ -0,0 +1,148 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | |||
23 | #include <nvgpu/clk_arb.h> | ||
24 | |||
25 | /** | ||
26 | * Stub imlementation of the clk_arb code. Yikes. Much of this probably could be | ||
27 | * commonized if one were to think through the implementation but that is | ||
28 | * probably weeks of work at a minimum. | ||
29 | * | ||
30 | * So for POSIX it will be stubbed. | ||
31 | */ | ||
32 | |||
33 | int nvgpu_clk_arb_init_arbiter(struct gk20a *g) | ||
34 | { | ||
35 | return -ENOSYS; | ||
36 | } | ||
37 | |||
38 | int nvgpu_clk_arb_get_arbiter_clk_range(struct gk20a *g, u32 api_domain, | ||
39 | u16 *min_mhz, u16 *max_mhz) | ||
40 | { | ||
41 | return -ENOSYS; | ||
42 | } | ||
43 | |||
44 | int nvgpu_clk_arb_get_arbiter_actual_mhz(struct gk20a *g, | ||
45 | u32 api_domain, u16 *actual_mhz) | ||
46 | { | ||
47 | return -ENOSYS; | ||
48 | } | ||
49 | |||
50 | int nvgpu_clk_arb_get_arbiter_effective_mhz(struct gk20a *g, | ||
51 | u32 api_domain, u16 *effective_mhz) | ||
52 | { | ||
53 | return -ENOSYS; | ||
54 | } | ||
55 | |||
56 | |||
57 | int nvgpu_clk_arb_get_arbiter_clk_f_points(struct gk20a *g, | ||
58 | u32 api_domain, | ||
59 | u32 *max_points, u16 *fpoints) | ||
60 | { | ||
61 | return -ENOSYS; | ||
62 | } | ||
63 | |||
64 | u32 nvgpu_clk_arb_get_arbiter_clk_domains(struct gk20a *g) | ||
65 | { | ||
66 | return 0; | ||
67 | } | ||
68 | |||
69 | bool nvgpu_clk_arb_is_valid_domain(struct gk20a *g, u32 api_domain) | ||
70 | { | ||
71 | return false; | ||
72 | } | ||
73 | |||
74 | void nvgpu_clk_arb_cleanup_arbiter(struct gk20a *g) | ||
75 | { | ||
76 | } | ||
77 | |||
78 | int nvgpu_clk_arb_install_session_fd(struct gk20a *g, | ||
79 | struct nvgpu_clk_session *session) | ||
80 | { | ||
81 | return -ENOSYS; | ||
82 | } | ||
83 | |||
84 | |||
85 | int nvgpu_clk_arb_init_session(struct gk20a *g, | ||
86 | struct nvgpu_clk_session **_session) | ||
87 | { | ||
88 | return -ENOSYS; | ||
89 | } | ||
90 | |||
91 | void nvgpu_clk_arb_release_session(struct gk20a *g, | ||
92 | struct nvgpu_clk_session *session) | ||
93 | { | ||
94 | } | ||
95 | |||
96 | int nvgpu_clk_arb_commit_request_fd(struct gk20a *g, | ||
97 | struct nvgpu_clk_session *session, | ||
98 | int request_fd) | ||
99 | { | ||
100 | return -ENOSYS; | ||
101 | } | ||
102 | |||
103 | int nvgpu_clk_arb_set_session_target_mhz(struct nvgpu_clk_session *session, | ||
104 | int fd, u32 api_domain, u16 target_mhz) | ||
105 | { | ||
106 | return -ENOSYS; | ||
107 | } | ||
108 | |||
109 | int nvgpu_clk_arb_get_session_target_mhz(struct nvgpu_clk_session *session, | ||
110 | u32 api_domain, u16 *target_mhz) | ||
111 | { | ||
112 | return -ENOSYS; | ||
113 | } | ||
114 | |||
115 | int nvgpu_clk_arb_install_event_fd(struct gk20a *g, | ||
116 | struct nvgpu_clk_session *session, | ||
117 | int *event_fd, u32 alarm_mask) | ||
118 | { | ||
119 | return -ENOSYS; | ||
120 | } | ||
121 | |||
122 | int nvgpu_clk_arb_install_request_fd(struct gk20a *g, | ||
123 | struct nvgpu_clk_session *session, | ||
124 | int *event_fd) | ||
125 | { | ||
126 | return -ENOSYS; | ||
127 | } | ||
128 | |||
129 | void nvgpu_clk_arb_schedule_vf_table_update(struct gk20a *g) | ||
130 | { | ||
131 | } | ||
132 | |||
133 | int nvgpu_clk_arb_get_current_pstate(struct gk20a *g) | ||
134 | { | ||
135 | return -ENOSYS; | ||
136 | } | ||
137 | |||
138 | void nvgpu_clk_arb_pstate_change_lock(struct gk20a *g, bool lock) | ||
139 | { | ||
140 | } | ||
141 | |||
142 | void nvgpu_clk_arb_send_thermal_alarm(struct gk20a *g) | ||
143 | { | ||
144 | } | ||
145 | |||
146 | void nvgpu_clk_arb_schedule_alarm(struct gk20a *g, u32 alarm) | ||
147 | { | ||
148 | } | ||