1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2013-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21  * DEALINGS IN THE SOFTWARE.
22  */
23 
24 #pragma once
25 
26 //
27 // This file was generated with FINN, an NVIDIA coding tool.
28 // Source file:      ctrl/ctrl90cc.finn
29 //
30 
31 
32 
33 
34 #include "ctrl/ctrlxxxx.h"
35 #include "ctrl90cc/ctrl90ccbase.h"
36 
37 #include "ctrl90cc/ctrl90cchwpm.h"
38 
39 
40 #include "ctrl90cc/ctrl90ccpower.h"
41 
42 
43 /*
44  * NV90CC_CTRL_CMD_PROFILER_RESERVE_HWPM
45  *
46  * This command is deprecated; please use NV90CC_CTRL_CMD_HWPM_RESERVE.
47  *
48  * This command attempts to reserve the perfmon for use by the calling client.
49  * If this object was allocated as a child of a subdevice, then the
50  * reservation will be global among all contexts on that subdevice. If this
51  * object was allocated as a child of a channel group or a channel, then the
52  * reservation will only be for the hardware context of that channel group or
53  * channel.
54  *
55  * If the global reservation is held on a subdevice by another client, then
56  * this command will fail, regardless of the parent class.
57  *
58  * If one or more per-context reservations are held by other clients, then
59  * this command will fail if the parent object is a subdevice or another
60  * client already holds the perfmon reservation for the parent context.
61  *
62  * This command will return NV_ERR_STATE_IN_USE for all of the failure
63  * cases described above. A return status of NV_OK guarantees
64  * that the client holds the perfmon reservation of the appropriate scope.
65  *
66  * This command does not take any parameters.
67  *
68  * Possible status values returned are:
69  *    NV_OK
70  *    NV_ERR_STATE_IN_USE
71  */
72 #define NV90CC_CTRL_CMD_PROFILER_RESERVE_HWPM              NV90CC_CTRL_CMD_HWPM_RESERVE
73 
74 /*
75  * NV90CC_CTRL_CMD_PROFILER_RELEASE_HWPM
76  *
77  * This command is deprecated; please use NV90CC_CTRL_CMD_HWPM_RELEASE.
78  *
79  * This command releases an existing reservation of the perfmon for the
80  * calling client. If the calling client does not currently have the perfmon
81  * reservation as acquired by NV90CC_CTRL_CMD_PROFILER_RESERVE_HWPM, this
82  * command will return NV_ERR_INVALID_REQUEST.
83  *
84  * This command does not take any parameters.
85  *
86  * Possible status values returned are:
87  *    NV_OK
88  *    NV_ERR_INVALID_REQUEST
89  */
90 #define NV90CC_CTRL_CMD_PROFILER_RELEASE_HWPM              NV90CC_CTRL_CMD_HWPM_RELEASE
91 
92 
93 
94 /*
95  * NV90CC_CTRL_CMD_PROFILER_REQUEST_CG_CONTROLS
96  *
97  * This command is deprecated; please use
98  * NV90CC_CTRL_CMD_POWER_REQUEST_POWER_FEATURES.
99  *
100  * This command attempts to enable or disable various clock-gating features of
101  * the GPU on behalf of the profiler. If this command is unable to set the
102  * clock-gating feature state of any of the requested features, this command
103  * will fail and none of the requested features will be modified. If this
104  * command fails because one or more clock-gating feature requests were
105  * rejected, it will return NV_ERR_STATE_IN_USE in the globalStatus
106  * parameter and the fields in the statusMask parameter for the features for
107  * which the requests were rejected will have the value
108  * NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_*_REQUEST_REJECTED.
109  * If a given feature is not supported on the GPU, the field for that clock-
110  * gating feature will have the value
111  * NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_*_REQUEST_NOT_SUPPORTED in the
112  * statusMask parameter, but this condition by itself will not cause the
113  * command to fail. Even if this command fails, the field for clock-gating
114  * features which would have successfully changed will have the value
115  * NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_*_FULFILLED in the statusMask
116  * parameter.
117  *
118  * Each of the clock-gating features is reference-counted individually, so
119  * that multiple GF100_PROFILER objects may request and rely on the same
120  * settings for the features simultaneously. Each clock-gating feature is
121  * locked to the requested state until the GF100_PROFILER object is freed or
122  * the NV90CC_CTRL_CMD_PROFILER_RELEASE_CG_CONTROLS command is called for that
123  * feature.
124  *
125  * Currently, only GF100_PROFILER requests for power features using this
126  * command are reference counted. Changes to the power feature settings made
127  * either by other control commands or the RM itself may interfere with the
128  * settings requested by GF100_PROFILER instances.
129  *
130  * This command will always return NV_OK when given valid
131  * parameters. If there is any other failure that prevents the clock-gating
132  * features from being set appropriately, the globalStatus parameter will
133  * indicate this and the statusMask parameter will indicate which clock-gating
134  * feature requests failed and why.
135  *
136  *   controlMask
137  *     This parameter indicates which clock-gating features the request should
138  *     apply to. This parameter has the following fields:
139  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG
140  *         The value of this field indicates whether this request should apply
141  *         to engine-level clock-gating of the GR engine. Valid values for
142  *         this field are:
143  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_IGNORE
144  *             This value indicates that the GR engine-level clock-gating
145  *             should be ignored. This will not affect the reference count for
146  *             this feature.
147  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_DISABLE
148  *             This value indicates that the GR engine-level clock-gating
149  *             should be disabled.
150  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_ENABLE
151  *             This value indicates that the GR engine-level clock-gating
152  *             should be enabled.
153  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG
154  *         The value of this field indicates whether this request should apply
155  *         to block-level clock-gating. Valid values for this field are:
156  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_IGNORE
157  *             This value indicates that block-level clock-gating should be
158  *             ignored. This will not affect the reference count for this
159  *             feature.
160  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_DISABLE
161  *             This value indicates that block-level clock-gating should be
162  *             disabled.
163  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_ENABLE
164  *             This value indicates that block-level clock-gating should be
165  *             enabled.
166  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG
167  *         The value of this field indicates whether this request should apply
168  *         to second-level clock-gating. Valid values for this field are:
169  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_IGNORE
170  *             This value indicates that second-level clock-gating should be
171  *             ignored. This will not affect the reference count for this
172  *             feature.
173  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_DISABLE
174  *             This value indicates that second-level clock-gating should be
175  *             disabled.
176  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_ENABLE
177  *             This value indicates that second-level clock-gating should be
178  *             enabled.
179  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG
180  *         The value of this field indicates whether this request should apply
181  *         to GR engine-level power-gating. Valid values for this field are:
182  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_IGNORE
183  *             This value indicates that engine-level power-gating should be
184  *             ignored. This will not affect the reference count for this
185  *             feature.
186  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_DISABLE
187  *             This value indicates that engine-level power-gating should be
188  *             disabled.
189  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_ENABLE
190  *             This value indicates that engine-level power-gating should be
191  *             enabled.
192  *         Note that this field is only temporary to allow reference counting
193  *         restricted to GF100_PROFILER instances, until the time when the
194  *         existing controls for this power feature can be updated to support
195  *         reference counting across all clients and the RM.
196  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN
197  *         The value of this field indicates whether this request should apply
198  *         to SM idle slowdown. Valid values for this field are:
199  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_IGNORE
200  *             This value indicates that SM idle slowdown should be ignored.
201  *             This will not affect the reference count for this feature.
202  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_DISABLE
203  *             This value indicates that SM idle slowdown should be disabled.
204  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_ENABLE
205  *             This value indicates that SM idle slowdown should be enabled.
206  *         Note that this field is only temporary to allow reference counting
207  *         restricted to GF100_PROFILER instances, until the time when the
208  *         existing controls for this power feature can be updated to support
209  *         reference counting across all clients and the RM.
210   *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT
211  *         The value of this field indicates whether this request should apply
212  *         to VAT. Valid values for this field are:
213  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_IGNORE
214  *             This value indicates that VAT should be ignored.
215  *             This will not affect the reference count for this feature.
216  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_DISABLE
217  *             This value indicates that VAT should be disabled.
218  *           NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_ENABLE
219  *             This value indicates that VAT should be enabled.
220  *         Note that this field is only temporary to allow reference counting
221  *         restricted to GF100_PROFILER instances, until the time when the
222  *         existing controls for this power feature can be updated to support
223  *         reference counting across all clients and the RM.
224  *   globalStatus
225  *     This parameter returns the overall status of the requests for all
226  *     clock-gating controls. If the value of this parameter is not
227  *     NV_OK, none of the clock-gating controls will be set as
228  *     requested. Possible values for this parameter are:
229  *       NV_OK
230  *         This value indicates that all of the clock-gating control requests
231  *         were either fulfilled or not supported on the hardware.
232  *       NV_ERR_INVALID_REQUEST
233  *         This value indicates that at least one of the clock-gating control
234  *         requests were invalid given the GF100_PROFILER instance's
235  *         outstanding requests.
236  *       NV_ERR_STATE_IN_USE
237  *         This value indicates that at least one of the clock-gating controls
238  *         has already been locked to a conflicting state by another
239  *         GF100_PROFILER instance or the RM itself.
240  *   statusMask
241  *     This parameter returns the status of the request to set each clock-
242  *     gating control specified by the controlMask parameter. The fields are
243  *     identical to those of the controlMask parameter. For each field for
244  *     which the corresponding field in the controlMask parameter has the
245  *     value NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_*_IGNORE, the value is
246  *     undefined. For each field for which the corresponding field in the
247  *     controlMask parameter has the value
248  *     NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_*_REQUEST, the value will be
249  *     one of the following:
250  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_*_REQUEST_FULFILLED
251  *         This value indicates that the clock-gating feature corresponding to
252  *         the field in question was enabled or disabled according to the
253  *         controlMask parameter, and the reference count for the feature was
254  *         incremented accordingly.
255  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_*_REQUEST_REJECTED
256  *         This value indicates that the clock-gating feature corresponding to
257  *         the field in question was not set to the expected state according
258  *         to the controlMask parameter because another conflicting request is
259  *         currently outstanding for the clock-gating feature.
260  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_*_REQUEST_FAILED
261  *         This value indicates that the clock-gating feature corresponding to
262  *         the field in question was not set to the expected state according
263  *         to the controlMask parameter because the attempt to do so failed
264  *         with an error other than a conflicting request.
265  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_*_REQUEST_NOT_SUPPORTED
266  *         This value indicates that the clock-gating feature corresponding to
267  *         the field in question is not supported on this GPU.
268  *
269  * Possible status values returned are:
270  *    NV_OK
271  *    NV_ERR_INVALID_ARGUMENT
272  */
273 #define NV90CC_CTRL_CMD_PROFILER_REQUEST_CG_CONTROLS NV90CC_CTRL_CMD_POWER_REQUEST_FEATURES
274 
275 typedef NV90CC_CTRL_POWER_REQUEST_FEATURES_PARAMS NV90CC_CTRL_PROFILER_REQUEST_CG_CONTROLS_PARAMS;
276 
277 /* valid fields for the controlMask and statusMask parameters */
278 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG                 1:0
279 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG                 3:2
280 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG                 5:4
281 
282 /*
283  * The following are temporary fields for the controlMask and statusMask
284  * parameters. They are required to reference count their respective features
285  * until the existing RM controls can be safely updated, and the definitions
286  * for these features will be removed soon after that.
287  */
288 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG                 7:6
289 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN        9:8
290 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT                  11:10
291 
292 /* valid values for fields in the controlMask parameter */
293 #define NV90CC_CTRL_PROFILER_CG_CONTROL_IGNORE                                   (0x00000000)
294 #define NV90CC_CTRL_PROFILER_CG_CONTROL_DISABLE                                  (0x00000001)
295 #define NV90CC_CTRL_PROFILER_CG_CONTROL_ENABLE                                   (0x00000002)
296 
297 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_IGNORE                         NV90CC_CTRL_PROFILER_CG_CONTROL_IGNORE
298 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_DISABLE                        NV90CC_CTRL_PROFILER_CG_CONTROL_DISABLE
299 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_ENABLE                         NV90CC_CTRL_PROFILER_CG_CONTROL_ENABLE
300 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_IGNORE                         NV90CC_CTRL_PROFILER_CG_CONTROL_IGNORE
301 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_DISABLE                        NV90CC_CTRL_PROFILER_CG_CONTROL_DISABLE
302 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_ENABLE                         NV90CC_CTRL_PROFILER_CG_CONTROL_ENABLE
303 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_IGNORE                         NV90CC_CTRL_PROFILER_CG_CONTROL_IGNORE
304 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_DISABLE                        NV90CC_CTRL_PROFILER_CG_CONTROL_DISABLE
305 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_ENABLE                         NV90CC_CTRL_PROFILER_CG_CONTROL_ENABLE
306 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_IGNORE                         NV90CC_CTRL_PROFILER_CG_CONTROL_IGNORE
307 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_DISABLE                        NV90CC_CTRL_PROFILER_CG_CONTROL_DISABLE
308 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_ENABLE                         NV90CC_CTRL_PROFILER_CG_CONTROL_ENABLE
309 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_IGNORE                NV90CC_CTRL_PROFILER_CG_CONTROL_IGNORE
310 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_DISABLE               NV90CC_CTRL_PROFILER_CG_CONTROL_DISABLE
311 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_ENABLE                NV90CC_CTRL_PROFILER_CG_CONTROL_ENABLE
312 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_IGNORE                          NV90CC_CTRL_PROFILER_CG_CONTROL_IGNORE
313 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_DISABLE                         NV90CC_CTRL_PROFILER_CG_CONTROL_DISABLE
314 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_ENABLE                          NV90CC_CTRL_PROFILER_CG_CONTROL_ENABLE
315 /* possible values for fields in the statusMask parameter */
316 #define NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FULFILLED                        (0x00000000)
317 #define NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_REJECTED                         (0x00000001)
318 #define NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_NOT_SUPPORTED                    (0x00000002)
319 #define NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FAILED                           (0x00000003)
320 
321 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_REQUEST_FULFILLED              NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FULFILLED
322 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_REQUEST_REJECTED               NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_REJECTED
323 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_REQUEST_NOT_SUPPORTED          NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_NOT_SUPPORTED
324 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_REQUEST_FAILED                 NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FAILED
325 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_REQUEST_FULFILLED              NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FULFILLED
326 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_REQUEST_REJECTED               NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_REJECTED
327 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_REQUEST_NOT_SUPPORTED          NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_NOT_SUPPORTED
328 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_REQUEST_FAILED                 NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FAILED
329 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_REQUEST_FULFILLED              NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FULFILLED
330 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_REQUEST_REJECTED               NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_REJECTED
331 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_REQUEST_NOT_SUPPORTED          NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_NOT_SUPPORTED
332 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_REQUEST_FAILED                 NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FAILED
333 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_REQUEST_FULFILLED              NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FULFILLED
334 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_REQUEST_REJECTED               NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_REJECTED
335 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_REQUEST_NOT_SUPPORTED          NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_NOT_SUPPORTED
336 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_REQUEST_FAILED                 NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FAILED
337 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_REQUEST_FULFILLED     NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FULFILLED
338 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_REQUEST_REJECTED      NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_REJECTED
339 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_REQUEST_NOT_SUPPORTED NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_NOT_SUPPORTED
340 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_REQUEST_FAILED        NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FAILED
341 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_REQUEST_FULFILLED               NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FULFILLED
342 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_REQUEST_REJECTED                NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_REJECTED
343 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_REQUEST_NOT_SUPPORTED           NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_NOT_SUPPORTED
344 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_REQUEST_FAILED                  NV90CC_CTRL_PROFILER_CG_CONTROL_REQUEST_FAILED
345 
346 /* utility masks for the controlMask parameter for all controls */
347 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ALL                             \
348     DRF_SHIFTMASK(NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG) |               \
349     DRF_SHIFTMASK(NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG) |               \
350     DRF_SHIFTMASK(NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG) |               \
351     DRF_SHIFTMASK(NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG) |               \
352     DRF_SHIFTMASK(NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN) |      \
353     DRF_SHIFTMASK(NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT)
354 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ALL_IGNORE                      \
355     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _ELCG, _IGNORE) |          \
356     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _BLCG, _IGNORE) |          \
357     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _SLCG, _IGNORE) |          \
358     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _ELPG, _IGNORE) |          \
359     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _IDLE_SLOWDOWN, _IGNORE) | \
360     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _VAT, _IGNORE)
361 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ALL_DISABLE                     \
362     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _ELCG, _DISABLE) |         \
363     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _BLCG, _DISABLE) |         \
364     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _SLCG, _DISABLE) |         \
365     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _ELPG, _DISABLE) |         \
366     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _IDLE_SLOWDOWN, _DISABLE)| \
367     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _VAT, _DISABLE)
368 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ALL_ENABLE                      \
369     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _ELCG, _ENABLE) |          \
370     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _BLCG, _ENABLE) |          \
371     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _SLCG, _ENABLE) |          \
372     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _ELPG, _ENABLE) |          \
373     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _IDLE_SLOWDOWN, _ENABLE) | \
374     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _VAT, _ENABLE)
375 
376 /*
377  * NV90CC_CTRL_CMD_PROFILER_RELEASE_CG_CONTROLS
378  *
379  * This command is deprecated; please us
380  * NV90CC_CTRL_CMD_POWER_RELEASE_FEATURES.
381  *
382  * This command releases the GF100_PROFILER's request for the given clock-
383  * gating features that was previously created by the
384  * NV90CC_CTRL_CMD_PROFILER_REQUEST_CG_CONTROLS command. If the GF100_PROFILER
385  * object does not have an outstanding request to one or more of the given
386  * clock-gating features, those features will be ignored while the other
387  * feature requests will be released.
388  *
389  * After calling this command, the calling client may not rely on the current
390  * value of any of the released clock-gating features to remain, even if
391  * several identical requests for the given clock-gating features were made
392  * using NV90CC_CTRL_CMD_PROFILER_REQUEST_CG_CONTROLS. The RM only reference-
393  * counts the settings requested by GF100_PROFILER instances - it does not
394  * reference-count multiple identical requests made using the same
395  * GF100_PROFILER instance.
396  *
397  * All outstanding requests made using this GF100_PROFILER object are
398  * implicitly released when the GF100_PROFILER is freed.
399  *
400  *   controlMask
401  *     This parameter indicates which clock-gating features the RM should
402  *     release the GF100_PROFILER's reference to. See
403  *     NV90CC_CTRL_CMD_PROFILER_REQUEST_CG_CONTROLS for valid fields. Valid
404  *     values for each field are:
405  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_IGNORE
406  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_IGNORE
407  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_IGNORE
408  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_IGNORE
409  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_IGNORE
410  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_IGNORE
411  *         This value indicates that the clock-gating feature associated with
412  *         the field should not be released, even if the GF100_PROFILER has an
413  *         outstanding request for it. This will not affect the reference
414  *         count for the feature.
415  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_RELEASE
416  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_RELEASE
417  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_RELEASE
418  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_RELEASE
419  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_RELEASE
420  *       NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_RELEASE
421  *         This value indicates that the GF100_PROFILER's outstanding request
422  *         for the clock-gating feature associated with the field should be
423  *         released. This will decrement the reference count for the feature
424  *         if the GF100_PROFILER has an outstanding request for it.
425  *
426  * Possible status values returned are:
427  *    NV_OK
428  *    NV_ERR_INVALID_ARGUMENT
429  */
430 #define NV90CC_CTRL_CMD_PROFILER_RELEASE_CG_CONTROLS                             NV90CC_CTRL_CMD_POWER_RELEASE_FEATURES
431 
432 typedef NV90CC_CTRL_POWER_RELEASE_FEATURES_PARAMS NV90CC_CTRL_PROFILER_RELEASE_CG_CONTROLS_PARAMS;
433 
434 /*
435  * valid values for the controlMask parameter in addition to
436  * NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_*_IGNORE
437  */
438 #define NV90CC_CTRL_PROFILER_CG_CONTROL_RELEASE                    (0x00000003)
439 
440 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELCG_RELEASE          NV90CC_CTRL_PROFILER_CG_CONTROL_RELEASE
441 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_BLCG_RELEASE          NV90CC_CTRL_PROFILER_CG_CONTROL_RELEASE
442 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_SLCG_RELEASE          NV90CC_CTRL_PROFILER_CG_CONTROL_RELEASE
443 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ELPG_RELEASE          NV90CC_CTRL_PROFILER_CG_CONTROL_RELEASE
444 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_IDLE_SLOWDOWN_RELEASE NV90CC_CTRL_PROFILER_CG_CONTROL_RELEASE
445 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_VAT_RELEASE           NV90CC_CTRL_PROFILER_CG_CONTROL_RELEASE
446 
447 /* utility mask for the controlMask parameter for all fields */
448 #define NV90CC_CTRL_PROFILER_CG_CONTROL_MASK_ALL_RELEASE                     \
449     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _ELCG, _RELEASE) |         \
450     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _BLCG, _RELEASE) |         \
451     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _SLCG, _RELEASE) |         \
452     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _ELPG, _RELEASE) |         \
453     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _IDLE_SLOWDOWN, _RELEASE)| \
454     DRF_DEF(90CC, _CTRL_PROFILER_CG_CONTROL_MASK, _VAT, _RELEASE)
455 
456