1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2010-2021 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 #include <nvtypes.h>
27 
28 //
29 // This file was generated with FINN, an NVIDIA coding tool.
30 // Source file:      ctrl/ctrl5070/ctrl5070event.finn
31 //
32 
33 #include "ctrl/ctrl5070/ctrl5070base.h"
34 
35 /* NV50_DISPLAY event-related control commands and parameters */
36 
37 /*
38  * NV5070_CTRL_CMD_EVENT_SET_NOTIFICATION
39  *
40  * This command sets event notification state for the NV50_DISPLAY object.
41  * This command requires that an instance of NV01_EVENT has been previously
42  * bound to the NV50_DISPLAY object.
43  *
44  *   subDeviceInstance
45  *     This parameter specifies the subdevice instance within the NV50_DISPLAY
46  *     parent device to which the operation should be directed.  This parameter
47  *     must specify a value between zero and the total number of subdevices
48  *     within the parent device.  This parameter should be set to zero for
49  *     default behavior.
50  *   hEvent
51  *     This parameter specifies the handle of the NV01_EVENT instance
52  *     to be bound to the given subDeviceInstance.
53  *   event
54  *     This parameter specifies the type of event to which the specified
55  *     action is to be applied.  This parameter must specify a valid
56  *     NOTIFIERS value of display class.
57  *   action
58  *     This parameter specifies the desired event notification action.
59  *     Valid notification actions include:
60  *       NV5070_CTRL_SET_EVENT_NOTIFICATION_DISABLE
61  *         This action disables event notification for the specified
62  *         event for the associated subdevice object.
63  *       NV5070_CTRL_SET_EVENT_NOTIFICATION_SINGLE
64  *         This action enables single-shot event notification for the
65  *         specified event for the associated subdevice object.
66  *       NV5070_CTRL_SET_EVENT_NOTIFICATION_REPEAT
67  *         This action enables repeated event notification for the specified
68  *         event for the associated system controller object.
69  *
70  * Possible status values returned are:
71  *   NV_OK
72  *   NV_ERR_INVALID_PARAM_STRUCT
73  *   NV_ERR_INVALID_ARGUMENT
74  *   NV_ERR_INVALID_STATE
75  */
76 #define NV5070_CTRL_CMD_EVENT_SET_NOTIFICATION (0x50700901) /* finn: Evaluated from "(FINN_NV50_DISPLAY_EVENT_INTERFACE_ID << 8) | NV5070_CTRL_EVENT_SET_NOTIFICATION_PARAMS_MESSAGE_ID" */
77 
78 #define NV5070_CTRL_EVENT_SET_NOTIFICATION_PARAMS_MESSAGE_ID (0x1U)
79 
80 typedef struct NV5070_CTRL_EVENT_SET_NOTIFICATION_PARAMS {
81     NvU32    subDeviceInstance;
82     NvHandle hEvent;
83     NvU32    event;
84     NvU32    action;
85 } NV5070_CTRL_EVENT_SET_NOTIFICATION_PARAMS;
86 
87 /* valid action values */
88 #define NV5070_CTRL_EVENT_SET_NOTIFICATION_ACTION_DISABLE (0x00000000)
89 #define NV5070_CTRL_EVENT_SET_NOTIFICATION_ACTION_SINGLE  (0x00000001)
90 #define NV5070_CTRL_EVENT_SET_NOTIFICATION_ACTION_REPEAT  (0x00000002)
91 
92 
93 /*
94  * NV5070_CTRL_CMD_EVENT_SET_TRIGGER
95  *
96  * This command triggers a software event for the NV50_DISPLAY object.
97  * This command accepts no parameters.
98  *
99  * Possible status values returned are:
100  *   NV_OK
101  */
102 #define NV5070_CTRL_CMD_EVENT_SET_TRIGGER                 (0x50700902) /* finn: Evaluated from "(FINN_NV50_DISPLAY_EVENT_INTERFACE_ID << 8) | 0x2" */
103 
104 
105 /*
106  * NV5070_CTRL_CMD_EVENT_SET_NOTIFIER_MEMORY
107  *
108  *     hMemory
109  *       This parameter specifies the handle of the memory object
110  *       that identifies the memory address translation for this
111  *       subdevice instance's notification(s).  The beginning of the
112  *       translation points to an array of notification data structures.
113  *       The size of the translation must be at least large enough to hold the
114  *       maximum number of notification data structures.
115  *       Legal argument values must be instances of the following classes:
116  *         NV01_NULL
117  *         NV04_MEMORY
118  *       When hMemory specifies the NV01_NULL_OBJECT value then any existing
119  *       memory translation connection is cleared.  There must not be any
120  *       pending notifications when this command is issued.
121  *
122  * Possible status values returned are:
123  *   NV_OK
124  *   NV_ERR_INVALID_PARAM_STRUCT
125  *   NV_ERR_INVALID_ARGUMENT
126  *   NV_ERR_INVALID_STATE
127  */
128 #define NV5070_CTRL_CMD_EVENT_SET_MEMORY_NOTIFIES         (0x50700903) /* finn: Evaluated from "(FINN_NV50_DISPLAY_EVENT_INTERFACE_ID << 8) | NV5070_CTRL_EVENT_SET_MEMORY_NOTIFIES_PARAMS_MESSAGE_ID" */
129 
130 #define NV5070_CTRL_EVENT_SET_MEMORY_NOTIFIES_PARAMS_MESSAGE_ID (0x3U)
131 
132 typedef struct NV5070_CTRL_EVENT_SET_MEMORY_NOTIFIES_PARAMS {
133     NvU32    subDeviceInstance;
134     NvHandle hMemory;
135 } NV5070_CTRL_EVENT_SET_MEMORY_NOTIFIES_PARAMS;
136 
137 #define NV5070_EVENT_MEMORY_NOTIFIES_STATUS_NOTIFIED 0
138 #define NV5070_EVENT_MEMORY_NOTIFIES_STATUS_PENDING  1
139 #define NV5070_EVENT_MEMORY_NOTIFIES_STATUS_ERROR    2
140 
141 
142 
143 /* _ctrl5070event_h_ */
144