xref: /aosp_15_r20/external/angle/src/third_party/libXNVCtrl/NVCtrlLib.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker /*
2*8975f5c5SAndroid Build Coastguard Worker  * Copyright (c) 2008 NVIDIA, Corporation
3*8975f5c5SAndroid Build Coastguard Worker  *
4*8975f5c5SAndroid Build Coastguard Worker  * Permission is hereby granted, free of charge, to any person obtaining a copy
5*8975f5c5SAndroid Build Coastguard Worker  * of this software and associated documentation files (the "Software"), to deal
6*8975f5c5SAndroid Build Coastguard Worker  * in the Software without restriction, including without limitation the rights
7*8975f5c5SAndroid Build Coastguard Worker  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8*8975f5c5SAndroid Build Coastguard Worker  * copies of the Software, and to permit persons to whom the Software is
9*8975f5c5SAndroid Build Coastguard Worker  * furnished to do so, subject to the following conditions:
10*8975f5c5SAndroid Build Coastguard Worker  *
11*8975f5c5SAndroid Build Coastguard Worker  * The above copyright notice and this permission notice (including the next
12*8975f5c5SAndroid Build Coastguard Worker  * paragraph) shall be included in all copies or substantial portions of the
13*8975f5c5SAndroid Build Coastguard Worker  * Software.
14*8975f5c5SAndroid Build Coastguard Worker  *
15*8975f5c5SAndroid Build Coastguard Worker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*8975f5c5SAndroid Build Coastguard Worker  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*8975f5c5SAndroid Build Coastguard Worker  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18*8975f5c5SAndroid Build Coastguard Worker  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19*8975f5c5SAndroid Build Coastguard Worker  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20*8975f5c5SAndroid Build Coastguard Worker  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21*8975f5c5SAndroid Build Coastguard Worker  * SOFTWARE.
22*8975f5c5SAndroid Build Coastguard Worker  */
23*8975f5c5SAndroid Build Coastguard Worker 
24*8975f5c5SAndroid Build Coastguard Worker #ifndef __NVCTRLLIB_H
25*8975f5c5SAndroid Build Coastguard Worker #define __NVCTRLLIB_H
26*8975f5c5SAndroid Build Coastguard Worker 
27*8975f5c5SAndroid Build Coastguard Worker #include "NVCtrl.h"
28*8975f5c5SAndroid Build Coastguard Worker 
29*8975f5c5SAndroid Build Coastguard Worker #if defined __cplusplus
30*8975f5c5SAndroid Build Coastguard Worker extern "C" {
31*8975f5c5SAndroid Build Coastguard Worker #endif
32*8975f5c5SAndroid Build Coastguard Worker 
33*8975f5c5SAndroid Build Coastguard Worker /*
34*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryExtension -
35*8975f5c5SAndroid Build Coastguard Worker  *
36*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the extension exists, returns False otherwise.
37*8975f5c5SAndroid Build Coastguard Worker  *  event_basep and error_basep are the extension event and error
38*8975f5c5SAndroid Build Coastguard Worker  *  bases.  Currently, no extension specific errors or events are
39*8975f5c5SAndroid Build Coastguard Worker  *  defined.
40*8975f5c5SAndroid Build Coastguard Worker  */
41*8975f5c5SAndroid Build Coastguard Worker 
42*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryExtension(Display *dpy, int *event_basep, int *error_basep);
43*8975f5c5SAndroid Build Coastguard Worker 
44*8975f5c5SAndroid Build Coastguard Worker /*
45*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryVersion -
46*8975f5c5SAndroid Build Coastguard Worker  *
47*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the extension exists, returns False otherwise.
48*8975f5c5SAndroid Build Coastguard Worker  *  major and minor are the extension's major and minor version
49*8975f5c5SAndroid Build Coastguard Worker  *  numbers.
50*8975f5c5SAndroid Build Coastguard Worker  */
51*8975f5c5SAndroid Build Coastguard Worker 
52*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryVersion(Display *dpy, int *major, int *minor);
53*8975f5c5SAndroid Build Coastguard Worker 
54*8975f5c5SAndroid Build Coastguard Worker /*
55*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLIsNvScreen
56*8975f5c5SAndroid Build Coastguard Worker  *
57*8975f5c5SAndroid Build Coastguard Worker  *  Returns True is the specified screen is controlled by the NVIDIA
58*8975f5c5SAndroid Build Coastguard Worker  *  driver.  Returns False otherwise.
59*8975f5c5SAndroid Build Coastguard Worker  */
60*8975f5c5SAndroid Build Coastguard Worker 
61*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLIsNvScreen(Display *dpy, int screen);
62*8975f5c5SAndroid Build Coastguard Worker 
63*8975f5c5SAndroid Build Coastguard Worker /*
64*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryTargetCount -
65*8975f5c5SAndroid Build Coastguard Worker  *
66*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the target type exists.  Returns False otherwise.
67*8975f5c5SAndroid Build Coastguard Worker  *  If XNVCTRLQueryTargetCount returns True, value will contain the
68*8975f5c5SAndroid Build Coastguard Worker  *  count of existing targets on the server of the specified target
69*8975f5c5SAndroid Build Coastguard Worker  *  type.
70*8975f5c5SAndroid Build Coastguard Worker  *
71*8975f5c5SAndroid Build Coastguard Worker  *  Please see "Attribute Targets" in NVCtrl.h for the list of valid
72*8975f5c5SAndroid Build Coastguard Worker  *  target types.
73*8975f5c5SAndroid Build Coastguard Worker  *
74*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
75*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The target doesn't exist.
76*8975f5c5SAndroid Build Coastguard Worker  */
77*8975f5c5SAndroid Build Coastguard Worker 
78*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryTargetCount(Display *dpy, int target_type, int *value);
79*8975f5c5SAndroid Build Coastguard Worker 
80*8975f5c5SAndroid Build Coastguard Worker /*
81*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLSetAttribute -
82*8975f5c5SAndroid Build Coastguard Worker  *
83*8975f5c5SAndroid Build Coastguard Worker  *  Sets the attribute to the given value.  The attributes and their
84*8975f5c5SAndroid Build Coastguard Worker  *  possible values are listed in NVCtrl.h.
85*8975f5c5SAndroid Build Coastguard Worker  *
86*8975f5c5SAndroid Build Coastguard Worker  *  Not all attributes require the display_mask parameter; see
87*8975f5c5SAndroid Build Coastguard Worker  *  NVCtrl.h for details.
88*8975f5c5SAndroid Build Coastguard Worker  *
89*8975f5c5SAndroid Build Coastguard Worker  *  Calling this function is equivalent to calling XNVCTRLSetTargetAttribute()
90*8975f5c5SAndroid Build Coastguard Worker  *  with the target_type set to NV_CTRL_TARGET_TYPE_X_SCREEN and
91*8975f5c5SAndroid Build Coastguard Worker  *  target_id set to 'screen'.
92*8975f5c5SAndroid Build Coastguard Worker  *
93*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
94*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The screen or attribute doesn't exist.
95*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver is not present on that screen.
96*8975f5c5SAndroid Build Coastguard Worker  */
97*8975f5c5SAndroid Build Coastguard Worker 
98*8975f5c5SAndroid Build Coastguard Worker void XNVCTRLSetAttribute(Display *dpy,
99*8975f5c5SAndroid Build Coastguard Worker                          int screen,
100*8975f5c5SAndroid Build Coastguard Worker                          unsigned int display_mask,
101*8975f5c5SAndroid Build Coastguard Worker                          unsigned int attribute,
102*8975f5c5SAndroid Build Coastguard Worker                          int value);
103*8975f5c5SAndroid Build Coastguard Worker 
104*8975f5c5SAndroid Build Coastguard Worker /*
105*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLSetTargetAttribute -
106*8975f5c5SAndroid Build Coastguard Worker  *
107*8975f5c5SAndroid Build Coastguard Worker  *  Sets the attribute to the given value.  The attributes and their
108*8975f5c5SAndroid Build Coastguard Worker  *  possible values are listed in NVCtrl.h.
109*8975f5c5SAndroid Build Coastguard Worker  *
110*8975f5c5SAndroid Build Coastguard Worker  *  Not all attributes require the display_mask parameter; see
111*8975f5c5SAndroid Build Coastguard Worker  *  NVCtrl.h for details.
112*8975f5c5SAndroid Build Coastguard Worker  *
113*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
114*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The target or attribute doesn't exist.
115*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver is not present on that target.
116*8975f5c5SAndroid Build Coastguard Worker  */
117*8975f5c5SAndroid Build Coastguard Worker 
118*8975f5c5SAndroid Build Coastguard Worker void XNVCTRLSetTargetAttribute(Display *dpy,
119*8975f5c5SAndroid Build Coastguard Worker                                int target_type,
120*8975f5c5SAndroid Build Coastguard Worker                                int target_id,
121*8975f5c5SAndroid Build Coastguard Worker                                unsigned int display_mask,
122*8975f5c5SAndroid Build Coastguard Worker                                unsigned int attribute,
123*8975f5c5SAndroid Build Coastguard Worker                                int value);
124*8975f5c5SAndroid Build Coastguard Worker 
125*8975f5c5SAndroid Build Coastguard Worker /*
126*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLSetAttributeAndGetStatus -
127*8975f5c5SAndroid Build Coastguard Worker  *
128*8975f5c5SAndroid Build Coastguard Worker  * Same as XNVCTRLSetAttribute().
129*8975f5c5SAndroid Build Coastguard Worker  * In addition, XNVCTRLSetAttributeAndGetStatus() returns
130*8975f5c5SAndroid Build Coastguard Worker  * True if the operation succeeds, False otherwise.
131*8975f5c5SAndroid Build Coastguard Worker  *
132*8975f5c5SAndroid Build Coastguard Worker  */
133*8975f5c5SAndroid Build Coastguard Worker 
134*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLSetAttributeAndGetStatus(Display *dpy,
135*8975f5c5SAndroid Build Coastguard Worker                                      int screen,
136*8975f5c5SAndroid Build Coastguard Worker                                      unsigned int display_mask,
137*8975f5c5SAndroid Build Coastguard Worker                                      unsigned int attribute,
138*8975f5c5SAndroid Build Coastguard Worker                                      int value);
139*8975f5c5SAndroid Build Coastguard Worker 
140*8975f5c5SAndroid Build Coastguard Worker /*
141*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLSetTargetAttributeAndGetStatus -
142*8975f5c5SAndroid Build Coastguard Worker  *
143*8975f5c5SAndroid Build Coastguard Worker  * Same as XNVCTRLSetTargetAttribute().
144*8975f5c5SAndroid Build Coastguard Worker  * In addition, XNVCTRLSetTargetAttributeAndGetStatus() returns
145*8975f5c5SAndroid Build Coastguard Worker  * True if the operation succeeds, False otherwise.
146*8975f5c5SAndroid Build Coastguard Worker  *
147*8975f5c5SAndroid Build Coastguard Worker  */
148*8975f5c5SAndroid Build Coastguard Worker 
149*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLSetTargetAttributeAndGetStatus(Display *dpy,
150*8975f5c5SAndroid Build Coastguard Worker                                            int target_type,
151*8975f5c5SAndroid Build Coastguard Worker                                            int target_id,
152*8975f5c5SAndroid Build Coastguard Worker                                            unsigned int display_mask,
153*8975f5c5SAndroid Build Coastguard Worker                                            unsigned int attribute,
154*8975f5c5SAndroid Build Coastguard Worker                                            int value);
155*8975f5c5SAndroid Build Coastguard Worker 
156*8975f5c5SAndroid Build Coastguard Worker /*
157*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryAttribute -
158*8975f5c5SAndroid Build Coastguard Worker  *
159*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the attribute exists.  Returns False otherwise.
160*8975f5c5SAndroid Build Coastguard Worker  *  If XNVCTRLQueryAttribute returns True, value will contain the
161*8975f5c5SAndroid Build Coastguard Worker  *  value of the specified attribute.
162*8975f5c5SAndroid Build Coastguard Worker  *
163*8975f5c5SAndroid Build Coastguard Worker  *  Not all attributes require the display_mask parameter; see
164*8975f5c5SAndroid Build Coastguard Worker  *  NVCtrl.h for details.
165*8975f5c5SAndroid Build Coastguard Worker  *
166*8975f5c5SAndroid Build Coastguard Worker  *  Calling this function is equivalent to calling
167*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryTargetAttribute() with the target_type set to
168*8975f5c5SAndroid Build Coastguard Worker  *  NV_CTRL_TARGET_TYPE_X_SCREEN and target_id set to 'screen'.
169*8975f5c5SAndroid Build Coastguard Worker  *
170*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
171*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The screen doesn't exist.
172*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver is not present on that screen.
173*8975f5c5SAndroid Build Coastguard Worker  */
174*8975f5c5SAndroid Build Coastguard Worker 
175*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryAttribute(Display *dpy,
176*8975f5c5SAndroid Build Coastguard Worker                            int screen,
177*8975f5c5SAndroid Build Coastguard Worker                            unsigned int display_mask,
178*8975f5c5SAndroid Build Coastguard Worker                            unsigned int attribute,
179*8975f5c5SAndroid Build Coastguard Worker                            int *value);
180*8975f5c5SAndroid Build Coastguard Worker 
181*8975f5c5SAndroid Build Coastguard Worker /*
182*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryTargetAttribute -
183*8975f5c5SAndroid Build Coastguard Worker  *
184*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the attribute exists.  Returns False otherwise.
185*8975f5c5SAndroid Build Coastguard Worker  *  If XNVCTRLQueryTargetAttribute returns True, value will contain the
186*8975f5c5SAndroid Build Coastguard Worker  *  value of the specified attribute.
187*8975f5c5SAndroid Build Coastguard Worker  *
188*8975f5c5SAndroid Build Coastguard Worker  *  Not all attributes require the display_mask parameter; see
189*8975f5c5SAndroid Build Coastguard Worker  *  NVCtrl.h for details.
190*8975f5c5SAndroid Build Coastguard Worker  *
191*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
192*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The target doesn't exist.
193*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver does not control the target.
194*8975f5c5SAndroid Build Coastguard Worker  */
195*8975f5c5SAndroid Build Coastguard Worker 
196*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryTargetAttribute(Display *dpy,
197*8975f5c5SAndroid Build Coastguard Worker                                  int target_Type,
198*8975f5c5SAndroid Build Coastguard Worker                                  int target_id,
199*8975f5c5SAndroid Build Coastguard Worker                                  unsigned int display_mask,
200*8975f5c5SAndroid Build Coastguard Worker                                  unsigned int attribute,
201*8975f5c5SAndroid Build Coastguard Worker                                  int *value);
202*8975f5c5SAndroid Build Coastguard Worker 
203*8975f5c5SAndroid Build Coastguard Worker /*
204*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryTargetAttribute64 -
205*8975f5c5SAndroid Build Coastguard Worker  *
206*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the attribute exists.  Returns False otherwise.
207*8975f5c5SAndroid Build Coastguard Worker  *  If XNVCTRLQueryTargetAttribute returns True, value will contain the
208*8975f5c5SAndroid Build Coastguard Worker  *  value of the specified attribute.
209*8975f5c5SAndroid Build Coastguard Worker  *
210*8975f5c5SAndroid Build Coastguard Worker  *  Not all attributes require the display_mask parameter; see
211*8975f5c5SAndroid Build Coastguard Worker  *  NVCtrl.h for details.
212*8975f5c5SAndroid Build Coastguard Worker  *
213*8975f5c5SAndroid Build Coastguard Worker  *  Note: this function behaves like XNVCTRLQueryTargetAttribute(),
214*8975f5c5SAndroid Build Coastguard Worker  *  but supports 64-bit integer attributes.
215*8975f5c5SAndroid Build Coastguard Worker  *
216*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
217*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The target doesn't exist.
218*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver does not control the target.
219*8975f5c5SAndroid Build Coastguard Worker  */
220*8975f5c5SAndroid Build Coastguard Worker 
221*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryTargetAttribute64(Display *dpy,
222*8975f5c5SAndroid Build Coastguard Worker                                    int target_Type,
223*8975f5c5SAndroid Build Coastguard Worker                                    int target_id,
224*8975f5c5SAndroid Build Coastguard Worker                                    unsigned int display_mask,
225*8975f5c5SAndroid Build Coastguard Worker                                    unsigned int attribute,
226*8975f5c5SAndroid Build Coastguard Worker                                    int64_t *value);
227*8975f5c5SAndroid Build Coastguard Worker 
228*8975f5c5SAndroid Build Coastguard Worker /*
229*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryStringAttribute -
230*8975f5c5SAndroid Build Coastguard Worker  *
231*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the attribute exists.  Returns False otherwise.
232*8975f5c5SAndroid Build Coastguard Worker  *  If XNVCTRLQueryStringAttribute returns True, *ptr will point to an
233*8975f5c5SAndroid Build Coastguard Worker  *  allocated string containing the string attribute requested.  It is
234*8975f5c5SAndroid Build Coastguard Worker  *  the caller's responsibility to free the string when done.
235*8975f5c5SAndroid Build Coastguard Worker  *
236*8975f5c5SAndroid Build Coastguard Worker  *  Calling this function is equivalent to calling
237*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryTargetStringAttribute() with the target_type set to
238*8975f5c5SAndroid Build Coastguard Worker  *  NV_CTRL_TARGET_TYPE_X_SCREEN and target_id set to 'screen'.
239*8975f5c5SAndroid Build Coastguard Worker  *
240*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
241*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The screen doesn't exist.
242*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver is not present on that screen.
243*8975f5c5SAndroid Build Coastguard Worker  *     BadAlloc - Insufficient resources to fulfill the request.
244*8975f5c5SAndroid Build Coastguard Worker  */
245*8975f5c5SAndroid Build Coastguard Worker 
246*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryStringAttribute(Display *dpy,
247*8975f5c5SAndroid Build Coastguard Worker                                  int screen,
248*8975f5c5SAndroid Build Coastguard Worker                                  unsigned int display_mask,
249*8975f5c5SAndroid Build Coastguard Worker                                  unsigned int attribute,
250*8975f5c5SAndroid Build Coastguard Worker                                  char **ptr);
251*8975f5c5SAndroid Build Coastguard Worker 
252*8975f5c5SAndroid Build Coastguard Worker /*
253*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryTargetStringAttribute -
254*8975f5c5SAndroid Build Coastguard Worker  *
255*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the attribute exists.  Returns False otherwise.
256*8975f5c5SAndroid Build Coastguard Worker  *  If XNVCTRLQueryTargetStringAttribute returns True, *ptr will point
257*8975f5c5SAndroid Build Coastguard Worker  *  to an allocated string containing the string attribute requested.
258*8975f5c5SAndroid Build Coastguard Worker  *  It is the caller's responsibility to free the string when done.
259*8975f5c5SAndroid Build Coastguard Worker  *
260*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
261*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The target doesn't exist.
262*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver does not control the target.
263*8975f5c5SAndroid Build Coastguard Worker  *     BadAlloc - Insufficient resources to fulfill the request.
264*8975f5c5SAndroid Build Coastguard Worker  */
265*8975f5c5SAndroid Build Coastguard Worker 
266*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryTargetStringAttribute(Display *dpy,
267*8975f5c5SAndroid Build Coastguard Worker                                        int target_type,
268*8975f5c5SAndroid Build Coastguard Worker                                        int target_id,
269*8975f5c5SAndroid Build Coastguard Worker                                        unsigned int display_mask,
270*8975f5c5SAndroid Build Coastguard Worker                                        unsigned int attribute,
271*8975f5c5SAndroid Build Coastguard Worker                                        char **ptr);
272*8975f5c5SAndroid Build Coastguard Worker 
273*8975f5c5SAndroid Build Coastguard Worker /*
274*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLSetStringAttribute -
275*8975f5c5SAndroid Build Coastguard Worker  *
276*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the operation succeded.  Returns False otherwise.
277*8975f5c5SAndroid Build Coastguard Worker  *
278*8975f5c5SAndroid Build Coastguard Worker  *  Possible X errors:
279*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The screen doesn't exist.
280*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver is not present on that screen.
281*8975f5c5SAndroid Build Coastguard Worker  *     BadAlloc - Insufficient resources to fulfill the request.
282*8975f5c5SAndroid Build Coastguard Worker  */
283*8975f5c5SAndroid Build Coastguard Worker 
284*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLSetStringAttribute(Display *dpy,
285*8975f5c5SAndroid Build Coastguard Worker                                int screen,
286*8975f5c5SAndroid Build Coastguard Worker                                unsigned int display_mask,
287*8975f5c5SAndroid Build Coastguard Worker                                unsigned int attribute,
288*8975f5c5SAndroid Build Coastguard Worker                                char *ptr);
289*8975f5c5SAndroid Build Coastguard Worker 
290*8975f5c5SAndroid Build Coastguard Worker /*
291*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLSetTargetStringAttribute -
292*8975f5c5SAndroid Build Coastguard Worker  *
293*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the operation succeded.  Returns False otherwise.
294*8975f5c5SAndroid Build Coastguard Worker  *
295*8975f5c5SAndroid Build Coastguard Worker  *  Possible X errors:
296*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The screen doesn't exist.
297*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver is not present on that screen.
298*8975f5c5SAndroid Build Coastguard Worker  *     BadAlloc - Insufficient resources to fulfill the request.
299*8975f5c5SAndroid Build Coastguard Worker  */
300*8975f5c5SAndroid Build Coastguard Worker 
301*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLSetTargetStringAttribute(Display *dpy,
302*8975f5c5SAndroid Build Coastguard Worker                                      int target_type,
303*8975f5c5SAndroid Build Coastguard Worker                                      int target_id,
304*8975f5c5SAndroid Build Coastguard Worker                                      unsigned int display_mask,
305*8975f5c5SAndroid Build Coastguard Worker                                      unsigned int attribute,
306*8975f5c5SAndroid Build Coastguard Worker                                      char *ptr);
307*8975f5c5SAndroid Build Coastguard Worker 
308*8975f5c5SAndroid Build Coastguard Worker /*
309*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryValidAttributeValues -
310*8975f5c5SAndroid Build Coastguard Worker  *
311*8975f5c5SAndroid Build Coastguard Worker  * Returns True if the attribute exists.  Returns False otherwise.  If
312*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryValidAttributeValues returns True, values will indicate
313*8975f5c5SAndroid Build Coastguard Worker  * the valid values for the specified attribute; see the description
314*8975f5c5SAndroid Build Coastguard Worker  * of NVCTRLAttributeValidValues in NVCtrl.h.
315*8975f5c5SAndroid Build Coastguard Worker  *
316*8975f5c5SAndroid Build Coastguard Worker  *  Calling this function is equivalent to calling
317*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryValidTargetAttributeValues() with the target_type set to
318*8975f5c5SAndroid Build Coastguard Worker  *  NV_CTRL_TARGET_TYPE_X_SCREEN and target_id set to 'screen'.
319*8975f5c5SAndroid Build Coastguard Worker  */
320*8975f5c5SAndroid Build Coastguard Worker 
321*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryValidAttributeValues(Display *dpy,
322*8975f5c5SAndroid Build Coastguard Worker                                       int screen,
323*8975f5c5SAndroid Build Coastguard Worker                                       unsigned int display_mask,
324*8975f5c5SAndroid Build Coastguard Worker                                       unsigned int attribute,
325*8975f5c5SAndroid Build Coastguard Worker                                       NVCTRLAttributeValidValuesRec *values);
326*8975f5c5SAndroid Build Coastguard Worker 
327*8975f5c5SAndroid Build Coastguard Worker /*
328*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryValidTargetAttributeValues -
329*8975f5c5SAndroid Build Coastguard Worker  *
330*8975f5c5SAndroid Build Coastguard Worker  * Returns True if the attribute exists.  Returns False otherwise.  If
331*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryValidTargetAttributeValues returns True, values will indicate
332*8975f5c5SAndroid Build Coastguard Worker  * the valid values for the specified attribute.
333*8975f5c5SAndroid Build Coastguard Worker  */
334*8975f5c5SAndroid Build Coastguard Worker 
335*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryValidTargetAttributeValues(Display *dpy,
336*8975f5c5SAndroid Build Coastguard Worker                                             int target_type,
337*8975f5c5SAndroid Build Coastguard Worker                                             int target_id,
338*8975f5c5SAndroid Build Coastguard Worker                                             unsigned int display_mask,
339*8975f5c5SAndroid Build Coastguard Worker                                             unsigned int attribute,
340*8975f5c5SAndroid Build Coastguard Worker                                             NVCTRLAttributeValidValuesRec *values);
341*8975f5c5SAndroid Build Coastguard Worker 
342*8975f5c5SAndroid Build Coastguard Worker /*
343*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryValidTargetStringAttributeValues -
344*8975f5c5SAndroid Build Coastguard Worker  *
345*8975f5c5SAndroid Build Coastguard Worker  * Returns True if the attribute exists.  Returns False otherwise.  If
346*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryValidTargetStringAttributeValues returns True, values will
347*8975f5c5SAndroid Build Coastguard Worker  * indicate the valid values for the specified attribute.
348*8975f5c5SAndroid Build Coastguard Worker  */
349*8975f5c5SAndroid Build Coastguard Worker 
350*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryValidTargetStringAttributeValues(Display *dpy,
351*8975f5c5SAndroid Build Coastguard Worker                                                   int target_type,
352*8975f5c5SAndroid Build Coastguard Worker                                                   int target_id,
353*8975f5c5SAndroid Build Coastguard Worker                                                   unsigned int display_mask,
354*8975f5c5SAndroid Build Coastguard Worker                                                   unsigned int attribute,
355*8975f5c5SAndroid Build Coastguard Worker                                                   NVCTRLAttributeValidValuesRec *values);
356*8975f5c5SAndroid Build Coastguard Worker 
357*8975f5c5SAndroid Build Coastguard Worker /*
358*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryAttributePermissions -
359*8975f5c5SAndroid Build Coastguard Worker  *
360*8975f5c5SAndroid Build Coastguard Worker  * Returns True if the attribute exists.  Returns False otherwise.  If
361*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryAttributePermissions returns True, permissions will
362*8975f5c5SAndroid Build Coastguard Worker  * indicate the permission flags for the attribute.
363*8975f5c5SAndroid Build Coastguard Worker  */
364*8975f5c5SAndroid Build Coastguard Worker 
365*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryAttributePermissions(Display *dpy,
366*8975f5c5SAndroid Build Coastguard Worker                                       unsigned int attribute,
367*8975f5c5SAndroid Build Coastguard Worker                                       NVCTRLAttributePermissionsRec *permissions);
368*8975f5c5SAndroid Build Coastguard Worker 
369*8975f5c5SAndroid Build Coastguard Worker /*
370*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryStringAttributePermissions -
371*8975f5c5SAndroid Build Coastguard Worker  *
372*8975f5c5SAndroid Build Coastguard Worker  * Returns True if the attribute exists.  Returns False otherwise.  If
373*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryStringAttributePermissions returns True, permissions will
374*8975f5c5SAndroid Build Coastguard Worker  * indicate the permission flags for the attribute.
375*8975f5c5SAndroid Build Coastguard Worker  */
376*8975f5c5SAndroid Build Coastguard Worker 
377*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryStringAttributePermissions(Display *dpy,
378*8975f5c5SAndroid Build Coastguard Worker                                             unsigned int attribute,
379*8975f5c5SAndroid Build Coastguard Worker                                             NVCTRLAttributePermissionsRec *permissions);
380*8975f5c5SAndroid Build Coastguard Worker 
381*8975f5c5SAndroid Build Coastguard Worker /*
382*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryBinaryDataAttributePermissions -
383*8975f5c5SAndroid Build Coastguard Worker  *
384*8975f5c5SAndroid Build Coastguard Worker  * Returns True if the attribute exists.  Returns False otherwise.  If
385*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryBinaryDataAttributePermissions returns True, permissions
386*8975f5c5SAndroid Build Coastguard Worker  * will indicate the permission flags for the attribute.
387*8975f5c5SAndroid Build Coastguard Worker  */
388*8975f5c5SAndroid Build Coastguard Worker 
389*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryBinaryDataAttributePermissions(Display *dpy,
390*8975f5c5SAndroid Build Coastguard Worker                                                 unsigned int attribute,
391*8975f5c5SAndroid Build Coastguard Worker                                                 NVCTRLAttributePermissionsRec *permissions);
392*8975f5c5SAndroid Build Coastguard Worker 
393*8975f5c5SAndroid Build Coastguard Worker /*
394*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryStringOperationAttributePermissions -
395*8975f5c5SAndroid Build Coastguard Worker  *
396*8975f5c5SAndroid Build Coastguard Worker  * Returns True if the attribute exists.  Returns False otherwise.  If
397*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryStringOperationAttributePermissions returns True,
398*8975f5c5SAndroid Build Coastguard Worker  * permissions will indicate the permission flags for the attribute.
399*8975f5c5SAndroid Build Coastguard Worker  */
400*8975f5c5SAndroid Build Coastguard Worker 
401*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryStringOperationAttributePermissions(Display *dpy,
402*8975f5c5SAndroid Build Coastguard Worker                                                      unsigned int attribute,
403*8975f5c5SAndroid Build Coastguard Worker                                                      NVCTRLAttributePermissionsRec *permissions);
404*8975f5c5SAndroid Build Coastguard Worker 
405*8975f5c5SAndroid Build Coastguard Worker /*
406*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLSetGvoColorConversion -
407*8975f5c5SAndroid Build Coastguard Worker  *
408*8975f5c5SAndroid Build Coastguard Worker  *  Sets the color conversion matrix, offset, and scale that should be
409*8975f5c5SAndroid Build Coastguard Worker  *  used for GVO (Graphic to Video Out).
410*8975f5c5SAndroid Build Coastguard Worker  *
411*8975f5c5SAndroid Build Coastguard Worker  *  The Color Space Conversion data is ordered like this:
412*8975f5c5SAndroid Build Coastguard Worker  *
413*8975f5c5SAndroid Build Coastguard Worker  *   colorMatrix[0][0] // r.Y
414*8975f5c5SAndroid Build Coastguard Worker  *   colorMatrix[0][1] // g.Y
415*8975f5c5SAndroid Build Coastguard Worker  *   colorMatrix[0][2] // b.Y
416*8975f5c5SAndroid Build Coastguard Worker  *
417*8975f5c5SAndroid Build Coastguard Worker  *   colorMatrix[1][0] // r.Cr
418*8975f5c5SAndroid Build Coastguard Worker  *   colorMatrix[1][1] // g.Cr
419*8975f5c5SAndroid Build Coastguard Worker  *   colorMatrix[1][2] // b.Cr
420*8975f5c5SAndroid Build Coastguard Worker  *
421*8975f5c5SAndroid Build Coastguard Worker  *   colorMatrix[2][0] // r.Cb
422*8975f5c5SAndroid Build Coastguard Worker  *   colorMatrix[2][1] // g.Cb
423*8975f5c5SAndroid Build Coastguard Worker  *   colorMatrix[2][2] // b.Cb
424*8975f5c5SAndroid Build Coastguard Worker  *
425*8975f5c5SAndroid Build Coastguard Worker  *   colorOffset[0]    // Y
426*8975f5c5SAndroid Build Coastguard Worker  *   colorOffset[1]    // Cr
427*8975f5c5SAndroid Build Coastguard Worker  *   colorOffset[2]    // Cb
428*8975f5c5SAndroid Build Coastguard Worker  *
429*8975f5c5SAndroid Build Coastguard Worker  *   colorScale[0]     // Y
430*8975f5c5SAndroid Build Coastguard Worker  *   colorScale[1]     // Cr
431*8975f5c5SAndroid Build Coastguard Worker  *   colorScale[2]     // Cb
432*8975f5c5SAndroid Build Coastguard Worker  *
433*8975f5c5SAndroid Build Coastguard Worker  *  where the data is used according to the following formulae:
434*8975f5c5SAndroid Build Coastguard Worker  *
435*8975f5c5SAndroid Build Coastguard Worker  *   Y  =  colorOffset[0] + colorScale[0] *
436*8975f5c5SAndroid Build Coastguard Worker  *           (R * colorMatrix[0][0] +
437*8975f5c5SAndroid Build Coastguard Worker  *            G * colorMatrix[0][1] +
438*8975f5c5SAndroid Build Coastguard Worker  *            B * colorMatrix[0][2]);
439*8975f5c5SAndroid Build Coastguard Worker  *
440*8975f5c5SAndroid Build Coastguard Worker  *   Cr =  colorOffset[1] + colorScale[1] *
441*8975f5c5SAndroid Build Coastguard Worker  *           (R * colorMatrix[1][0] +
442*8975f5c5SAndroid Build Coastguard Worker  *            G * colorMatrix[1][1] +
443*8975f5c5SAndroid Build Coastguard Worker  *            B * colorMatrix[1][2]);
444*8975f5c5SAndroid Build Coastguard Worker  *
445*8975f5c5SAndroid Build Coastguard Worker  *   Cb =  colorOffset[2] + colorScale[2] *
446*8975f5c5SAndroid Build Coastguard Worker  *           (R * colorMatrix[2][0] +
447*8975f5c5SAndroid Build Coastguard Worker  *            G * colorMatrix[2][1] +
448*8975f5c5SAndroid Build Coastguard Worker  *            B * colorMatrix[2][2]);
449*8975f5c5SAndroid Build Coastguard Worker  *
450*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
451*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver is not present on that screen.
452*8975f5c5SAndroid Build Coastguard Worker  *     BadImplementation - GVO is not available on that screen.
453*8975f5c5SAndroid Build Coastguard Worker  */
454*8975f5c5SAndroid Build Coastguard Worker 
455*8975f5c5SAndroid Build Coastguard Worker void XNVCTRLSetGvoColorConversion(Display *dpy,
456*8975f5c5SAndroid Build Coastguard Worker                                   int screen,
457*8975f5c5SAndroid Build Coastguard Worker                                   float colorMatrix[3][3],
458*8975f5c5SAndroid Build Coastguard Worker                                   float colorOffset[3],
459*8975f5c5SAndroid Build Coastguard Worker                                   float colorScale[3]);
460*8975f5c5SAndroid Build Coastguard Worker 
461*8975f5c5SAndroid Build Coastguard Worker /*
462*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryGvoColorConversion -
463*8975f5c5SAndroid Build Coastguard Worker  *
464*8975f5c5SAndroid Build Coastguard Worker  *  Retrieves the color conversion matrix and color offset
465*8975f5c5SAndroid Build Coastguard Worker  *  that are currently being used for GVO (Graphic to Video Out).
466*8975f5c5SAndroid Build Coastguard Worker  *
467*8975f5c5SAndroid Build Coastguard Worker  *  The values are ordered within the arrays according to the comments
468*8975f5c5SAndroid Build Coastguard Worker  *  for XNVCTRLSetGvoColorConversion().
469*8975f5c5SAndroid Build Coastguard Worker  *
470*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
471*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver is not present on that screen.
472*8975f5c5SAndroid Build Coastguard Worker  *     BadImplementation - GVO is not available on that screen.
473*8975f5c5SAndroid Build Coastguard Worker  */
474*8975f5c5SAndroid Build Coastguard Worker 
475*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryGvoColorConversion(Display *dpy,
476*8975f5c5SAndroid Build Coastguard Worker                                     int screen,
477*8975f5c5SAndroid Build Coastguard Worker                                     float colorMatrix[3][3],
478*8975f5c5SAndroid Build Coastguard Worker                                     float colorOffset[3],
479*8975f5c5SAndroid Build Coastguard Worker                                     float colorScale[3]);
480*8975f5c5SAndroid Build Coastguard Worker 
481*8975f5c5SAndroid Build Coastguard Worker /*
482*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryBinaryData -
483*8975f5c5SAndroid Build Coastguard Worker  *
484*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the attribute exists.  Returns False otherwise.
485*8975f5c5SAndroid Build Coastguard Worker  *  If XNVCTRLQueryBinaryData returns True, *ptr will point to an
486*8975f5c5SAndroid Build Coastguard Worker  *  allocated block of memory containing the binary data attribute
487*8975f5c5SAndroid Build Coastguard Worker  *  requested.  It is the caller's responsibility to free the data
488*8975f5c5SAndroid Build Coastguard Worker  *  when done.  len will list the length of the binary data.
489*8975f5c5SAndroid Build Coastguard Worker  *
490*8975f5c5SAndroid Build Coastguard Worker  *  Calling this function is equivalent to calling
491*8975f5c5SAndroid Build Coastguard Worker  *  XNVCTRLQueryTargetBinaryData() with the target_type set to
492*8975f5c5SAndroid Build Coastguard Worker  *  NV_CTRL_TARGET_TYPE_X_SCREEN and target_id set to 'screen'.
493*8975f5c5SAndroid Build Coastguard Worker  *
494*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
495*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The screen doesn't exist.
496*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver is not present on that screen.
497*8975f5c5SAndroid Build Coastguard Worker  *     BadAlloc - Insufficient resources to fulfill the request.
498*8975f5c5SAndroid Build Coastguard Worker  */
499*8975f5c5SAndroid Build Coastguard Worker 
500*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryBinaryData(Display *dpy,
501*8975f5c5SAndroid Build Coastguard Worker                             int screen,
502*8975f5c5SAndroid Build Coastguard Worker                             unsigned int display_mask,
503*8975f5c5SAndroid Build Coastguard Worker                             unsigned int attribute,
504*8975f5c5SAndroid Build Coastguard Worker                             unsigned char **ptr,
505*8975f5c5SAndroid Build Coastguard Worker                             int *len);
506*8975f5c5SAndroid Build Coastguard Worker 
507*8975f5c5SAndroid Build Coastguard Worker /*
508*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLQueryTargetBinaryData -
509*8975f5c5SAndroid Build Coastguard Worker  *
510*8975f5c5SAndroid Build Coastguard Worker  *  Returns True if the attribute exists.  Returns False otherwise.
511*8975f5c5SAndroid Build Coastguard Worker  *  If XNVCTRLQueryTargetBinaryData returns True, *ptr will point to an
512*8975f5c5SAndroid Build Coastguard Worker  *  allocated block of memory containing the binary data attribute
513*8975f5c5SAndroid Build Coastguard Worker  *  requested.  It is the caller's responsibility to free the data
514*8975f5c5SAndroid Build Coastguard Worker  *  when done.  len will list the length of the binary data.
515*8975f5c5SAndroid Build Coastguard Worker  *
516*8975f5c5SAndroid Build Coastguard Worker  *  Possible errors:
517*8975f5c5SAndroid Build Coastguard Worker  *     BadValue - The target doesn't exist.
518*8975f5c5SAndroid Build Coastguard Worker  *     BadMatch - The NVIDIA driver does not control the target.
519*8975f5c5SAndroid Build Coastguard Worker  *     BadAlloc - Insufficient resources to fulfill the request.
520*8975f5c5SAndroid Build Coastguard Worker  */
521*8975f5c5SAndroid Build Coastguard Worker 
522*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLQueryTargetBinaryData(Display *dpy,
523*8975f5c5SAndroid Build Coastguard Worker                                   int target_type,
524*8975f5c5SAndroid Build Coastguard Worker                                   int target_id,
525*8975f5c5SAndroid Build Coastguard Worker                                   unsigned int display_mask,
526*8975f5c5SAndroid Build Coastguard Worker                                   unsigned int attribute,
527*8975f5c5SAndroid Build Coastguard Worker                                   unsigned char **ptr,
528*8975f5c5SAndroid Build Coastguard Worker                                   int *len);
529*8975f5c5SAndroid Build Coastguard Worker 
530*8975f5c5SAndroid Build Coastguard Worker /*
531*8975f5c5SAndroid Build Coastguard Worker  * XNVCTRLStringOperation -
532*8975f5c5SAndroid Build Coastguard Worker  *
533*8975f5c5SAndroid Build Coastguard Worker  * Takes a string as input and returns a Xmalloc'ed string as output.
534*8975f5c5SAndroid Build Coastguard Worker  * Returns True on success and False on failure.
535*8975f5c5SAndroid Build Coastguard Worker  */
536*8975f5c5SAndroid Build Coastguard Worker 
537*8975f5c5SAndroid Build Coastguard Worker Bool XNVCTRLStringOperation(Display *dpy,
538*8975f5c5SAndroid Build Coastguard Worker                             int target_type,
539*8975f5c5SAndroid Build Coastguard Worker                             int target_id,
540*8975f5c5SAndroid Build Coastguard Worker                             unsigned int display_mask,
541*8975f5c5SAndroid Build Coastguard Worker                             unsigned int attribute,
542*8975f5c5SAndroid Build Coastguard Worker                             char *pIn,
543*8975f5c5SAndroid Build Coastguard Worker                             char **ppOut);
544*8975f5c5SAndroid Build Coastguard Worker 
545*8975f5c5SAndroid Build Coastguard Worker /*
546*8975f5c5SAndroid Build Coastguard Worker  * XNVCtrlSelectNotify -
547*8975f5c5SAndroid Build Coastguard Worker  *
548*8975f5c5SAndroid Build Coastguard Worker  * This enables/disables receiving of NV-CONTROL events.  The type
549*8975f5c5SAndroid Build Coastguard Worker  * specifies the type of event to enable (currently, the only
550*8975f5c5SAndroid Build Coastguard Worker  * type that can be requested per-screen with XNVCtrlSelectNotify()
551*8975f5c5SAndroid Build Coastguard Worker  * is ATTRIBUTE_CHANGED_EVENT); onoff controls whether receiving this
552*8975f5c5SAndroid Build Coastguard Worker  * type of event should be enabled (True) or disabled (False).
553*8975f5c5SAndroid Build Coastguard Worker  *
554*8975f5c5SAndroid Build Coastguard Worker  * Returns True if successful, or False if the screen is not
555*8975f5c5SAndroid Build Coastguard Worker  * controlled by the NVIDIA driver.
556*8975f5c5SAndroid Build Coastguard Worker  */
557*8975f5c5SAndroid Build Coastguard Worker 
558*8975f5c5SAndroid Build Coastguard Worker Bool XNVCtrlSelectNotify(Display *dpy, int screen, int type, Bool onoff);
559*8975f5c5SAndroid Build Coastguard Worker 
560*8975f5c5SAndroid Build Coastguard Worker /*
561*8975f5c5SAndroid Build Coastguard Worker  * XNVCtrlSelectTargetNotify -
562*8975f5c5SAndroid Build Coastguard Worker  *
563*8975f5c5SAndroid Build Coastguard Worker  * This enables/disables receiving of NV-CONTROL events that happen on
564*8975f5c5SAndroid Build Coastguard Worker  * the specified target.  The notify_type specifies the type of event to
565*8975f5c5SAndroid Build Coastguard Worker  * enable (currently, the only type that can be requested per-target with
566*8975f5c5SAndroid Build Coastguard Worker  * XNVCtrlSelectTargetNotify() is TARGET_ATTRIBUTE_CHANGED_EVENT); onoff
567*8975f5c5SAndroid Build Coastguard Worker  * controls whether receiving this type of event should be enabled (True)
568*8975f5c5SAndroid Build Coastguard Worker  * or disabled (False).
569*8975f5c5SAndroid Build Coastguard Worker  *
570*8975f5c5SAndroid Build Coastguard Worker  * Returns True if successful, or False if the target is not
571*8975f5c5SAndroid Build Coastguard Worker  * controlled by the NVIDIA driver.
572*8975f5c5SAndroid Build Coastguard Worker  */
573*8975f5c5SAndroid Build Coastguard Worker 
574*8975f5c5SAndroid Build Coastguard Worker Bool XNVCtrlSelectTargetNotify(Display *dpy,
575*8975f5c5SAndroid Build Coastguard Worker                                int target_type,
576*8975f5c5SAndroid Build Coastguard Worker                                int target_id,
577*8975f5c5SAndroid Build Coastguard Worker                                int notify_type,
578*8975f5c5SAndroid Build Coastguard Worker                                Bool onoff);
579*8975f5c5SAndroid Build Coastguard Worker 
580*8975f5c5SAndroid Build Coastguard Worker /*
581*8975f5c5SAndroid Build Coastguard Worker  * XNVCtrlEvent structure
582*8975f5c5SAndroid Build Coastguard Worker  */
583*8975f5c5SAndroid Build Coastguard Worker 
584*8975f5c5SAndroid Build Coastguard Worker typedef struct
585*8975f5c5SAndroid Build Coastguard Worker {
586*8975f5c5SAndroid Build Coastguard Worker     int type;
587*8975f5c5SAndroid Build Coastguard Worker     unsigned long serial;
588*8975f5c5SAndroid Build Coastguard Worker     Bool send_event; /* always FALSE, we don't allow send_events */
589*8975f5c5SAndroid Build Coastguard Worker     Display *display;
590*8975f5c5SAndroid Build Coastguard Worker     Time time;
591*8975f5c5SAndroid Build Coastguard Worker     int screen;
592*8975f5c5SAndroid Build Coastguard Worker     unsigned int display_mask;
593*8975f5c5SAndroid Build Coastguard Worker     unsigned int attribute;
594*8975f5c5SAndroid Build Coastguard Worker     int value;
595*8975f5c5SAndroid Build Coastguard Worker } XNVCtrlAttributeChangedEvent;
596*8975f5c5SAndroid Build Coastguard Worker 
597*8975f5c5SAndroid Build Coastguard Worker typedef union
598*8975f5c5SAndroid Build Coastguard Worker {
599*8975f5c5SAndroid Build Coastguard Worker     int type;
600*8975f5c5SAndroid Build Coastguard Worker     XNVCtrlAttributeChangedEvent attribute_changed;
601*8975f5c5SAndroid Build Coastguard Worker     long pad[24];
602*8975f5c5SAndroid Build Coastguard Worker } XNVCtrlEvent;
603*8975f5c5SAndroid Build Coastguard Worker 
604*8975f5c5SAndroid Build Coastguard Worker /*
605*8975f5c5SAndroid Build Coastguard Worker  * XNVCtrlEventTarget structure
606*8975f5c5SAndroid Build Coastguard Worker  */
607*8975f5c5SAndroid Build Coastguard Worker 
608*8975f5c5SAndroid Build Coastguard Worker typedef struct
609*8975f5c5SAndroid Build Coastguard Worker {
610*8975f5c5SAndroid Build Coastguard Worker     int type;
611*8975f5c5SAndroid Build Coastguard Worker     unsigned long serial;
612*8975f5c5SAndroid Build Coastguard Worker     Bool send_event; /* always FALSE, we don't allow send_events */
613*8975f5c5SAndroid Build Coastguard Worker     Display *display;
614*8975f5c5SAndroid Build Coastguard Worker     Time time;
615*8975f5c5SAndroid Build Coastguard Worker     int target_type;
616*8975f5c5SAndroid Build Coastguard Worker     int target_id;
617*8975f5c5SAndroid Build Coastguard Worker     unsigned int display_mask;
618*8975f5c5SAndroid Build Coastguard Worker     unsigned int attribute;
619*8975f5c5SAndroid Build Coastguard Worker     int value;
620*8975f5c5SAndroid Build Coastguard Worker } XNVCtrlAttributeChangedEventTarget;
621*8975f5c5SAndroid Build Coastguard Worker 
622*8975f5c5SAndroid Build Coastguard Worker typedef union
623*8975f5c5SAndroid Build Coastguard Worker {
624*8975f5c5SAndroid Build Coastguard Worker     int type;
625*8975f5c5SAndroid Build Coastguard Worker     XNVCtrlAttributeChangedEventTarget attribute_changed;
626*8975f5c5SAndroid Build Coastguard Worker     long pad[24];
627*8975f5c5SAndroid Build Coastguard Worker } XNVCtrlEventTarget;
628*8975f5c5SAndroid Build Coastguard Worker 
629*8975f5c5SAndroid Build Coastguard Worker /*
630*8975f5c5SAndroid Build Coastguard Worker  * XNVCtrlEventTargetAvailability structure
631*8975f5c5SAndroid Build Coastguard Worker  */
632*8975f5c5SAndroid Build Coastguard Worker 
633*8975f5c5SAndroid Build Coastguard Worker typedef struct
634*8975f5c5SAndroid Build Coastguard Worker {
635*8975f5c5SAndroid Build Coastguard Worker     int type;
636*8975f5c5SAndroid Build Coastguard Worker     unsigned long serial;
637*8975f5c5SAndroid Build Coastguard Worker     Bool send_event; /* always FALSE, we don't allow send_events */
638*8975f5c5SAndroid Build Coastguard Worker     Display *display;
639*8975f5c5SAndroid Build Coastguard Worker     Time time;
640*8975f5c5SAndroid Build Coastguard Worker     int target_type;
641*8975f5c5SAndroid Build Coastguard Worker     int target_id;
642*8975f5c5SAndroid Build Coastguard Worker     unsigned int display_mask;
643*8975f5c5SAndroid Build Coastguard Worker     unsigned int attribute;
644*8975f5c5SAndroid Build Coastguard Worker     int value;
645*8975f5c5SAndroid Build Coastguard Worker     Bool availability;
646*8975f5c5SAndroid Build Coastguard Worker } XNVCtrlAttributeChangedEventTargetAvailability;
647*8975f5c5SAndroid Build Coastguard Worker 
648*8975f5c5SAndroid Build Coastguard Worker typedef union
649*8975f5c5SAndroid Build Coastguard Worker {
650*8975f5c5SAndroid Build Coastguard Worker     int type;
651*8975f5c5SAndroid Build Coastguard Worker     XNVCtrlAttributeChangedEventTargetAvailability attribute_changed;
652*8975f5c5SAndroid Build Coastguard Worker     long pad[24];
653*8975f5c5SAndroid Build Coastguard Worker } XNVCtrlEventTargetAvailability;
654*8975f5c5SAndroid Build Coastguard Worker 
655*8975f5c5SAndroid Build Coastguard Worker /*
656*8975f5c5SAndroid Build Coastguard Worker  * XNVCtrlStringEventTarget structure
657*8975f5c5SAndroid Build Coastguard Worker  */
658*8975f5c5SAndroid Build Coastguard Worker 
659*8975f5c5SAndroid Build Coastguard Worker typedef struct
660*8975f5c5SAndroid Build Coastguard Worker {
661*8975f5c5SAndroid Build Coastguard Worker     int type;
662*8975f5c5SAndroid Build Coastguard Worker     unsigned long serial;
663*8975f5c5SAndroid Build Coastguard Worker     Bool send_event; /* always FALSE, we don't allow send_events */
664*8975f5c5SAndroid Build Coastguard Worker     Display *display;
665*8975f5c5SAndroid Build Coastguard Worker     Time time;
666*8975f5c5SAndroid Build Coastguard Worker     int target_type;
667*8975f5c5SAndroid Build Coastguard Worker     int target_id;
668*8975f5c5SAndroid Build Coastguard Worker     unsigned int display_mask;
669*8975f5c5SAndroid Build Coastguard Worker     unsigned int attribute;
670*8975f5c5SAndroid Build Coastguard Worker } XNVCtrlStringAttributeChangedEventTarget;
671*8975f5c5SAndroid Build Coastguard Worker 
672*8975f5c5SAndroid Build Coastguard Worker typedef union
673*8975f5c5SAndroid Build Coastguard Worker {
674*8975f5c5SAndroid Build Coastguard Worker     int type;
675*8975f5c5SAndroid Build Coastguard Worker     XNVCtrlStringAttributeChangedEventTarget attribute_changed;
676*8975f5c5SAndroid Build Coastguard Worker     long pad[24];
677*8975f5c5SAndroid Build Coastguard Worker } XNVCtrlStringEventTarget;
678*8975f5c5SAndroid Build Coastguard Worker 
679*8975f5c5SAndroid Build Coastguard Worker /*
680*8975f5c5SAndroid Build Coastguard Worker  * XNVCtrlBinaryEventTarget structure
681*8975f5c5SAndroid Build Coastguard Worker  */
682*8975f5c5SAndroid Build Coastguard Worker 
683*8975f5c5SAndroid Build Coastguard Worker typedef struct
684*8975f5c5SAndroid Build Coastguard Worker {
685*8975f5c5SAndroid Build Coastguard Worker     int type;
686*8975f5c5SAndroid Build Coastguard Worker     unsigned long serial;
687*8975f5c5SAndroid Build Coastguard Worker     Bool send_event; /* always FALSE, we don't allow send_events */
688*8975f5c5SAndroid Build Coastguard Worker     Display *display;
689*8975f5c5SAndroid Build Coastguard Worker     Time time;
690*8975f5c5SAndroid Build Coastguard Worker     int target_type;
691*8975f5c5SAndroid Build Coastguard Worker     int target_id;
692*8975f5c5SAndroid Build Coastguard Worker     unsigned int display_mask;
693*8975f5c5SAndroid Build Coastguard Worker     unsigned int attribute;
694*8975f5c5SAndroid Build Coastguard Worker } XNVCtrlBinaryAttributeChangedEventTarget;
695*8975f5c5SAndroid Build Coastguard Worker 
696*8975f5c5SAndroid Build Coastguard Worker typedef union
697*8975f5c5SAndroid Build Coastguard Worker {
698*8975f5c5SAndroid Build Coastguard Worker     int type;
699*8975f5c5SAndroid Build Coastguard Worker     XNVCtrlBinaryAttributeChangedEventTarget attribute_changed;
700*8975f5c5SAndroid Build Coastguard Worker     long pad[24];
701*8975f5c5SAndroid Build Coastguard Worker } XNVCtrlBinaryEventTarget;
702*8975f5c5SAndroid Build Coastguard Worker 
703*8975f5c5SAndroid Build Coastguard Worker #if defined __cplusplus
704*8975f5c5SAndroid Build Coastguard Worker } /* extern "C" */
705*8975f5c5SAndroid Build Coastguard Worker #endif
706*8975f5c5SAndroid Build Coastguard Worker 
707*8975f5c5SAndroid Build Coastguard Worker #endif /* __NVCTRLLIB_H */
708