2 * Copyright (c) 2008 NVIDIA, Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
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 THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * NV-CONTROL Protocol Version History
26 * 1.0 - 1.5 NVIDIA Internal development versions
27 * 1.6 Initial public version
28 * 1.7 Added QueryBinaryData request
29 * 1.8 Added TargetTypes
30 * 1.9 Added QueryTargetCount request
31 * 1.10 Fixed target type/id byte ordering for compatibility with
32 * pre-1.8 NV-CONTROL clients
33 * 1.11 NVIDIA Internal development version
34 * 1.12 Added StringOperation request
35 * 1.13 NVIDIA Internal development version
36 * 1.14 Fixed an NV_CTRL_BINARY_DATA_MODELINES double scan modeline
37 * reporting bug (vsyncstart, vsyncend, and vtotal were incorrectly
39 * 1.15 Added AVAILABILITY_TARGET_ATTRIBUTE_CHANGED_EVENT
40 * 1.16 Added TARGET_STRING_ATTRIBUTE_CHANGED_EVENT
41 * 1.17 Added TARGET_BINARY_ATTRIBUTE_CHANGED_EVENT
42 * 1.18 Updated QueryTargetCount to return a count of 0, rather than
43 * BadMatch, if an unknown TargetType is specified
44 * 1.19 Added TargetType support for SetAttributeAndGetStatus and
45 * SetStringAttribute requests
46 * 1.20 Added COOLER TargetType
47 * 1.21 Added initial 64-bit integer attribute support (read-only)
48 * 1.22 Added X_nvCtrlQueryValidStringAttributeValues to check
49 * string attribute permissions.
50 * 1.23 Added SENSOR TargetType
51 * 1.24 Fixed a bug where SLI_MOSAIC_MODE_AVAILABLE attribute would
52 * report false positives via the GPU and X screen target types
53 * 1.25 Added 3D_VISION_PRO_TRANSCEIVER TargetType
54 * 1.26 Added XNVCTRLQueryXXXAttributePermissions.
55 * 1.27 Added DISPLAY TargetType
56 * 1.28 Added NV_CTRL_CURRENT_METAMODE_ID: clients should use this
57 * attribute to switch MetaModes, rather than pass the MetaMode ID
58 * through the RRSetScreenConfig protocol request.
64 #define NV_CONTROL_ERRORS 0
65 #define NV_CONTROL_EVENTS 5
66 #define NV_CONTROL_NAME "NV-CONTROL"
68 #define NV_CONTROL_MAJOR 1
69 #define NV_CONTROL_MINOR 28
71 #define X_nvCtrlQueryExtension 0
72 #define X_nvCtrlIsNv 1
73 #define X_nvCtrlQueryAttribute 2
74 #define X_nvCtrlSetAttribute 3
75 #define X_nvCtrlQueryStringAttribute 4
76 #define X_nvCtrlQueryValidAttributeValues 5
77 #define X_nvCtrlSelectNotify 6
78 #define X_nvCtrlSetGvoColorConversionDeprecated 7
79 #define X_nvCtrlQueryGvoColorConversionDeprecated 8
80 #define X_nvCtrlSetStringAttribute 9
81 /* STUB X_nvCtrlQueryDDCCILutSize 10 */
82 /* STUB X_nvCtrlQueryDDCCISinglePointLutOperation 11 */
83 /* STUB X_nvCtrlSetDDCCISinglePointLutOperation 12 */
84 /* STUB X_nvCtrlQueryDDCCIBlockLutOperation 13 */
85 /* STUB X_nvCtrlSetDDCCIBlockLutOperation 14 */
86 /* STUB X_nvCtrlSetDDCCIRemoteProcedureCall 15 */
87 /* STUB X_nvCtrlQueryDDCCIDisplayControllerType 16 */
88 /* STUB X_nvCtrlQueryDDCCICapabilities 17 */
89 /* STUB X_nvCtrlQueryDDCCITimingReport 18 */
90 #define X_nvCtrlSetAttributeAndGetStatus 19
91 #define X_nvCtrlQueryBinaryData 20
92 #define X_nvCtrlSetGvoColorConversion 21
93 #define X_nvCtrlQueryGvoColorConversion 22
94 #define X_nvCtrlSelectTargetNotify 23
95 #define X_nvCtrlQueryTargetCount 24
96 #define X_nvCtrlStringOperation 25
97 #define X_nvCtrlQueryValidAttributeValues64 26
98 #define X_nvCtrlQueryAttribute64 27
99 #define X_nvCtrlQueryValidStringAttributeValues 28
100 #define X_nvCtrlQueryAttributePermissions 29
101 #define X_nvCtrlQueryStringAttributePermissions 30
102 #define X_nvCtrlQueryBinaryDataAttributePermissions 31
103 #define X_nvCtrlQueryStringOperationAttributePermissions 32
105 #define X_nvCtrlLastRequest (X_nvCtrlQueryStringOperationAttributePermissions + 1)
108 /* Define 32 bit floats */
109 typedef float FLOAT32
;
119 } xnvCtrlQueryExtensionReq
;
120 #define sz_xnvCtrlQueryExtensionReq 4
123 BYTE type
; /* X_Reply */
125 CARD16 sequenceNumber B16
;
134 } xnvCtrlQueryExtensionReply
;
135 #define sz_xnvCtrlQueryExtensionReply 32
143 #define sz_xnvCtrlIsNvReq 8
146 BYTE type
; /* X_Reply */
148 CARD16 sequenceNumber B16
;
157 #define sz_xnvCtrlIsNvReply 32
163 CARD32 target_type B32
;
164 } xnvCtrlQueryTargetCountReq
;
165 #define sz_xnvCtrlQueryTargetCountReq 8
168 BYTE type
; /* X_Reply */
170 CARD16 sequenceNumber B16
;
178 } xnvCtrlQueryTargetCountReply
;
179 #define sz_xnvCtrlQueryTargetCountReply 32
185 CARD16 target_id B16
; /* X screen number or GPU number */
186 CARD16 target_type B16
; /* X screen or GPU */
187 CARD32 display_mask B32
;
188 CARD32 attribute B32
;
189 } xnvCtrlQueryAttributeReq
;
190 #define sz_xnvCtrlQueryAttributeReq 16
195 CARD16 sequenceNumber B16
;
203 } xnvCtrlQueryAttributeReply
;
204 #define sz_xnvCtrlQueryAttributeReply 32
209 CARD16 sequenceNumber B16
;
216 } xnvCtrlQueryAttribute64Reply
;
217 #define sz_xnvCtrlQueryAttribute64Reply 32
223 CARD16 target_id B16
;
224 CARD16 target_type B16
;
225 CARD32 display_mask B32
;
226 CARD32 attribute B32
;
228 } xnvCtrlSetAttributeReq
;
229 #define sz_xnvCtrlSetAttributeReq 20
235 CARD16 target_id B16
;
236 CARD16 target_type B16
;
237 CARD32 display_mask B32
;
238 CARD32 attribute B32
;
240 } xnvCtrlSetAttributeAndGetStatusReq
;
241 #define sz_xnvCtrlSetAttributeAndGetStatusReq 20
246 CARD16 sequenceNumber B16
;
254 } xnvCtrlSetAttributeAndGetStatusReply
;
255 #define sz_xnvCtrlSetAttributeAndGetStatusReply 32
261 CARD16 target_id B16
; /* X screen number or GPU number */
262 CARD16 target_type B16
; /* X screen or GPU */
263 CARD32 display_mask B32
;
264 CARD32 attribute B32
;
265 } xnvCtrlQueryStringAttributeReq
;
266 #define sz_xnvCtrlQueryStringAttributeReq 16
271 CARD16 sequenceNumber B16
;
274 CARD32 n B32
; /* Length of string */
279 } xnvCtrlQueryStringAttributeReply
;
280 #define sz_xnvCtrlQueryStringAttributeReply 32
287 CARD16 target_id B16
;
288 CARD16 target_type B16
;
289 CARD32 display_mask B32
;
290 CARD32 attribute B32
;
291 CARD32 num_bytes B32
;
292 } xnvCtrlSetStringAttributeReq
;
293 #define sz_xnvCtrlSetStringAttributeReq 20
298 CARD16 sequenceNumber B16
;
306 } xnvCtrlSetStringAttributeReply
;
307 #define sz_xnvCtrlSetStringAttributeReply 32
313 CARD16 target_id B16
; /* X screen number or GPU number */
314 CARD16 target_type B16
; /* X screen or GPU */
315 CARD32 display_mask B32
;
316 CARD32 attribute B32
;
317 } xnvCtrlQueryValidAttributeValuesReq
;
318 #define sz_xnvCtrlQueryValidAttributeValuesReq 16
323 CARD16 sequenceNumber B16
;
331 } xnvCtrlQueryValidAttributeValuesReply
;
332 #define sz_xnvCtrlQueryValidAttributeValuesReply 32
337 CARD16 sequenceNumber B16
;
346 } xnvCtrlQueryValidAttributeValues64Reply
;
347 #define sz_xnvCtrlQueryValidAttributeValues64Reply 48
348 #define sz_xnvCtrlQueryValidAttributeValues64Reply_extra ((48 - 32) >> 2)
354 CARD32 attribute B32
;
355 } xnvCtrlQueryAttributePermissionsReq
;
356 #define sz_xnvCtrlQueryAttributePermissionsReq 8
361 CARD16 sequenceNumber B16
;
370 } xnvCtrlQueryAttributePermissionsReply
;
371 #define sz_xnvCtrlQueryAttributePermissionsReply 32
373 /* Set GVO Color Conversion request (deprecated) */
379 FLOAT32 row1_col1 F32
;
380 FLOAT32 row1_col2 F32
;
381 FLOAT32 row1_col3 F32
;
382 FLOAT32 row1_col4 F32
;
383 FLOAT32 row2_col1 F32
;
384 FLOAT32 row2_col2 F32
;
385 FLOAT32 row2_col3 F32
;
386 FLOAT32 row2_col4 F32
;
387 FLOAT32 row3_col1 F32
;
388 FLOAT32 row3_col2 F32
;
389 FLOAT32 row3_col3 F32
;
390 FLOAT32 row3_col4 F32
;
391 } xnvCtrlSetGvoColorConversionDeprecatedReq
;
392 #define sz_xnvCtrlSetGvoColorConversionDeprecatedReq 56
394 /* Query GVO Color Conversion request (deprecated) */
400 } xnvCtrlQueryGvoColorConversionDeprecatedReq
;
401 #define sz_xnvCtrlQueryGvoColorConversionDeprecatedReq 8
403 /* Query GVO Color Conversion reply (deprecated) */
405 BYTE type
; /* X_Reply */
407 CARD16 sequenceNumber B16
;
415 } xnvCtrlQueryGvoColorConversionDeprecatedReply
;
416 #define sz_xnvCtrlQueryGvoColorConversionDeprecatedReply 32
419 /* Set GVO Color Conversion request */
426 FLOAT32 cscMatrix_y_r F32
;
427 FLOAT32 cscMatrix_y_g F32
;
428 FLOAT32 cscMatrix_y_b F32
;
430 FLOAT32 cscMatrix_cr_r F32
;
431 FLOAT32 cscMatrix_cr_g F32
;
432 FLOAT32 cscMatrix_cr_b F32
;
434 FLOAT32 cscMatrix_cb_r F32
;
435 FLOAT32 cscMatrix_cb_g F32
;
436 FLOAT32 cscMatrix_cb_b F32
;
438 FLOAT32 cscOffset_y F32
;
439 FLOAT32 cscOffset_cr F32
;
440 FLOAT32 cscOffset_cb F32
;
442 FLOAT32 cscScale_y F32
;
443 FLOAT32 cscScale_cr F32
;
444 FLOAT32 cscScale_cb F32
;
446 } xnvCtrlSetGvoColorConversionReq
;
447 #define sz_xnvCtrlSetGvoColorConversionReq 68
449 /* Query GVO Color Conversion request */
455 } xnvCtrlQueryGvoColorConversionReq
;
456 #define sz_xnvCtrlQueryGvoColorConversionReq 8
458 /* Query GVO Color Conversion reply */
460 BYTE type
; /* X_Reply */
462 CARD16 sequenceNumber B16
;
470 } xnvCtrlQueryGvoColorConversionReply
;
471 #define sz_xnvCtrlQueryGvoColorConversionReply 32
477 CARD16 target_id B16
; /* X screen number or GPU number */
478 CARD16 target_type B16
; /* X screen or GPU */
479 CARD32 display_mask B32
;
480 CARD32 attribute B32
;
481 } xnvCtrlQueryBinaryDataReq
;
482 #define sz_xnvCtrlQueryBinaryDataReq 16
487 CARD16 sequenceNumber B16
;
495 } xnvCtrlQueryBinaryDataReply
;
496 #define sz_xnvCtrlQueryBinaryDataReply 32
504 CARD16 notifyType B16
;
506 } xnvCtrlSelectNotifyReq
;
507 #define sz_xnvCtrlSelectNotifyReq 12
513 CARD16 target_id B16
; /* X screen number or GPU number */
514 CARD16 target_type B16
; /* X screen or GPU */
515 CARD32 display_mask B32
;
516 CARD32 attribute B32
;
517 CARD32 num_bytes B32
; /* Length of string */
518 } xnvCtrlStringOperationReq
;
519 #define sz_xnvCtrlStringOperationReq 20
522 BYTE type
; /* X_Reply */
524 CARD16 sequenceNumber B16
;
527 CARD32 num_bytes B32
; /* Length of string */
532 } xnvCtrlStringOperationReply
;
533 #define sz_xnvCtrlStringOperationReply 32
540 CARD16 sequenceNumber B16
;
545 CARD16 sequenceNumber B16
;
548 CARD32 display_mask B32
;
549 CARD32 attribute B32
;
559 * Leave target_type before target_id for the
560 * xnvCtrlSelectTargetNotifyReq and xnvctrlEventTarget
561 * structures, even though other request protocol structures
562 * store target_id in the bottom 16-bits of the second DWORD of the
563 * structures. The event-related structures were added in version
564 * 1.8, and so there is no prior version with which to maintain
571 CARD16 target_type B16
; /* Don't swap these */
572 CARD16 target_id B16
;
573 CARD16 notifyType B16
;
575 } xnvCtrlSelectTargetNotifyReq
;
576 #define sz_xnvCtrlSelectTargetNotifyReq 12
583 CARD16 sequenceNumber B16
;
588 CARD16 sequenceNumber B16
;
590 CARD16 target_type B16
; /* Don't swap these */
591 CARD16 target_id B16
;
592 CARD32 display_mask B32
;
593 CARD32 attribute B32
;
601 CARD16 sequenceNumber B16
;
603 CARD16 target_type B16
; /* Don't swap these */
604 CARD16 target_id B16
;
605 CARD32 display_mask B32
;
606 CARD32 attribute B32
;
612 } availability_changed
;
614 } xnvctrlEventTarget
;
617 #endif /* __NVCONTROL_H */