1  /************************************************************************************************************************************\
2 |*                                                                                                                                    *|
3 |*     Copyright � 2012 NVIDIA Corporation.  All rights reserved.                                                                     *|
4 |*                                                                                                                                    *|
5 |*  NOTICE TO USER:                                                                                                                   *|
6 |*                                                                                                                                    *|
7 |*  This software is subject to NVIDIA ownership rights under U.S. and international Copyright laws.                                  *|
8 |*                                                                                                                                    *|
9 |*  This software and the information contained herein are PROPRIETARY and CONFIDENTIAL to NVIDIA                                     *|
10 |*  and are being provided solely under the terms and conditions of an NVIDIA software license agreement.                             *|
11 |*  Otherwise, you have no rights to use or access this software in any manner.                                                       *|
12 |*                                                                                                                                    *|
13 |*  If not covered by the applicable NVIDIA software license agreement:                                                               *|
14 |*  NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE.                                            *|
15 |*  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.                                                           *|
16 |*  NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,                                                                     *|
17 |*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.                       *|
18 |*  IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,                               *|
19 |*  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,  WHETHER IN AN ACTION OF CONTRACT,                         *|
20 |*  NEGLIGENCE OR OTHER TORTIOUS ACTION,  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE.            *|
21 |*                                                                                                                                    *|
22 |*  U.S. Government End Users.                                                                                                        *|
23 |*  This software is a "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT 1995),                                       *|
24 |*  consisting  of "commercial computer  software"  and "commercial computer software documentation"                                  *|
25 |*  as such terms are  used in 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government only as a commercial end item.     *|
26 |*  Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995),                                          *|
27 |*  all U.S. Government End Users acquire the software with only those rights set forth herein.                                       *|
28 |*                                                                                                                                    *|
29 |*  Any use of this software in individual and commercial software must include,                                                      *|
30 |*  in the user documentation and internal comments to the code,                                                                      *|
31 |*  the above Disclaimer (as applicable) and U.S. Government End Users Notice.                                                        *|
32 |*                                                                                                                                    *|
33  \************************************************************************************************************************************/
34 
35 #include"nvapi_lite_salstart.h"
36 #include"nvapi_lite_common.h"
37 #include"nvapi_lite_sli.h"
38 #include"nvapi_lite_surround.h"
39 #include"nvapi_lite_stereo.h"
40 #include"nvapi_lite_d3dext.h"
41 
42 ///////////////////////////////////////////////////////////////////////////////
43 //
44 // Date: Feb 23, 2014
45 // File: nvapi.h
46 //
47 // NvAPI provides an interface to NVIDIA devices. This file contains the
48 // interface constants, structure definitions and function prototypes.
49 //
50 //   Target Profile: developer
51 //  Target Platform: windows
52 //
53 ///////////////////////////////////////////////////////////////////////////////
54 #ifndef _NVAPI_H
55 #define _NVAPI_H
56 
57 #pragma pack(push,8) // Make sure we have consistent structure packings
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 // ====================================================
64 // Universal NvAPI Definitions
65 // ====================================================
66 #ifndef _WIN32
67 #define __cdecl
68 #endif
69 
70 
71 
72 //! @}
73 
74 //!   \ingroup nvapistatus
75 #define NVAPI_API_NOT_INTIALIZED        NVAPI_API_NOT_INITIALIZED       //!< Fix typo in error code
76 
77 //!   \ingroup nvapistatus
78 #define NVAPI_INVALID_USER_PRIVILEDGE   NVAPI_INVALID_USER_PRIVILEGE    //!< Fix typo in error code
79 
80 
81 ///////////////////////////////////////////////////////////////////////////////
82 //
83 // FUNCTION NAME: NvAPI_Initialize
84 //
85 //! This function initializes the NvAPI library.
86 //! This must be called before calling other NvAPI_ functions.
87 //!
88 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
89 //!
90 //!
91 //! \since Release: 80
92 //!
93 //! \retval  NVAPI_ERROR            An error occurred during the initialization process (generic error)
94 //! \retval  NVAPI_LIBRARYNOTFOUND  Failed to load the NVAPI support library
95 //! \retval  NVAPI_OK               Initialized
96 //! \sa nvapistatus
97 //! \ingroup nvapifunctions
98 ///////////////////////////////////////////////////////////////////////////////
99 NVAPI_INTERFACE NvAPI_Initialize();
100 
101 
102 ///////////////////////////////////////////////////////////////////////////////
103 //
104 // FUNCTION NAME: NvAPI_Unload
105 //
106 //!   DESCRIPTION: Unloads NVAPI library. This must be the last function called.
107 //!
108 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
109 //!
110 //!
111 //!  !! This is not thread safe. In a multithreaded environment, calling NvAPI_Unload       !! \n
112 //!  !! while another thread is executing another NvAPI_XXX function, results in           !!  \n
113 //!  !! undefined behaviour and might even cause the application to crash. Developers       !! \n
114 //!  !! must make sure that they are not in any other function before calling NvAPI_Unload. !! \n
115 //!
116 //!
117 //!  Unloading NvAPI library is not supported when the library is in a resource locked state.
118 //!  Some functions in the NvAPI library initiates an operation or allocates certain resources
119 //!  and there are corresponding functions available, to complete the operation or free the
120 //!  allocated resources. All such function pairs are designed to prevent unloading NvAPI library.
121 //!
122 //!  For example, if NvAPI_Unload is called after NvAPI_XXX which locks a resource, it fails with
123 //!  NVAPI_ERROR. Developers need to call the corresponding NvAPI_YYY to unlock the resources,
124 //!  before calling NvAPI_Unload again.
125 //!
126 //! \retval ::NVAPI_ERROR            One or more resources are locked and hence cannot unload NVAPI library
127 //! \retval ::NVAPI_OK               NVAPI library unloaded
128 //!
129 //! \ingroup nvapifunctions
130 ///////////////////////////////////////////////////////////////////////////////
131 NVAPI_INTERFACE NvAPI_Unload();
132 
133 ///////////////////////////////////////////////////////////////////////////////
134 //
135 // FUNCTION NAME: NvAPI_GetErrorMessage
136 //
137 //! This function converts an NvAPI error code into a null terminated string.
138 //!
139 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
140 //!
141 //!
142 //! \since Release: 80
143 //!
144 //! \param nr      The error code to convert
145 //! \param szDesc  The string corresponding to the error code
146 //!
147 //! \return NULL terminated string (always, never NULL)
148 //! \ingroup nvapifunctions
149 ///////////////////////////////////////////////////////////////////////////////
150 NVAPI_INTERFACE NvAPI_GetErrorMessage(NvAPI_Status nr,NvAPI_ShortString szDesc);
151 
152 ///////////////////////////////////////////////////////////////////////////////
153 //
154 // FUNCTION NAME: NvAPI_GetInterfaceVersionString
155 //
156 //! This function returns a string describing the version of the NvAPI library.
157 //!               The contents of the string are human readable.  Do not assume a fixed
158 //!                format.
159 //!
160 //!
161 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
162 //!
163 //!
164 //! \since Release: 80
165 //!
166 //! \param  szDesc User readable string giving NvAPI version information
167 //!
168 //! \return See \ref nvapistatus for the list of possible return values.
169 //! \ingroup nvapifunctions
170 ///////////////////////////////////////////////////////////////////////////////
171 NVAPI_INTERFACE NvAPI_GetInterfaceVersionString(NvAPI_ShortString szDesc);
172 
173 
174 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
175 //              All display port related data types definition starts
176 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
177 
178 // This category is intentionally added before the #ifdef. The #endif should also be in the same scope
179 #ifndef DISPLAYPORT_STRUCTS_DEFINED
180 #define DISPLAYPORT_STRUCTS_DEFINED
181 
182 //! \ingroup dispcontrol
183 //! Used in NV_DISPLAY_PORT_INFO.
184 typedef enum _NV_DP_LINK_RATE
185 {
186     NV_DP_1_62GBPS            = 6,
187     NV_DP_2_70GBPS            = 0xA,
188     NV_DP_5_40GBPS            = 0x14
189 } NV_DP_LINK_RATE;
190 
191 
192 //! \ingroup dispcontrol
193 //! Used in NV_DISPLAY_PORT_INFO.
194 typedef enum _NV_DP_LANE_COUNT
195 {
196     NV_DP_1_LANE              = 1,
197     NV_DP_2_LANE              = 2,
198     NV_DP_4_LANE              = 4,
199 } NV_DP_LANE_COUNT;
200 
201 
202 //! \ingroup dispcontrol
203 //! Used in NV_DISPLAY_PORT_INFO.
204 typedef enum _NV_DP_COLOR_FORMAT
205 {
206     NV_DP_COLOR_FORMAT_RGB     = 0,
207     NV_DP_COLOR_FORMAT_YCbCr422,
208     NV_DP_COLOR_FORMAT_YCbCr444,
209 } NV_DP_COLOR_FORMAT;
210 
211 
212 //! \ingroup dispcontrol
213 //! Used in NV_DISPLAY_PORT_INFO.
214 typedef enum _NV_DP_COLORIMETRY
215 {
216     NV_DP_COLORIMETRY_RGB     = 0,
217     NV_DP_COLORIMETRY_YCbCr_ITU601,
218     NV_DP_COLORIMETRY_YCbCr_ITU709,
219 } NV_DP_COLORIMETRY;
220 
221 
222 //! \ingroup dispcontrol
223 //! Used in NV_DISPLAY_PORT_INFO.
224 typedef enum _NV_DP_DYNAMIC_RANGE
225 {
226     NV_DP_DYNAMIC_RANGE_VESA  = 0,
227     NV_DP_DYNAMIC_RANGE_CEA,
228 } NV_DP_DYNAMIC_RANGE;
229 
230 
231 //! \ingroup dispcontrol
232 //! Used in NV_DISPLAY_PORT_INFO.
233 typedef enum _NV_DP_BPC
234 {
235     NV_DP_BPC_DEFAULT         = 0,
236     NV_DP_BPC_6,
237     NV_DP_BPC_8,
238     NV_DP_BPC_10,
239     NV_DP_BPC_12,
240     NV_DP_BPC_16,
241 } NV_DP_BPC;
242 
243 #endif  //#ifndef DISPLAYPORT_STRUCTS_DEFINED
244 
245 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
246 //              All display port related data types definitions end
247 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
248 
249 ///////////////////////////////////////////////////////////////////////////////
250 //
251 // FUNCTION NAME: NvAPI_GPU_GetEDID
252 //
253 //! \fn NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID)
254 //!  This function returns the EDID data for the specified GPU handle and connection bit mask.
255 //!  displayOutputId should have exactly 1 bit set to indicate a single display. See \ref handles.
256 //!
257 //! SUPPORTED OS:  Windows XP and higher
258 //!
259 //!
260 //! \since Release: 85
261 //!
262 //! \retval    NVAPI_INVALID_ARGUMENT              pEDID is NULL; displayOutputId has 0 or > 1 bits set
263 //! \retval    NVAPI_OK                           *pEDID contains valid data.
264 //! \retval    NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
265 //! \retval    NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
266 //! \retval    NVAPI_DATA_NOT_FOUND                The requested display does not contain an EDID.
267 //
268 ///////////////////////////////////////////////////////////////////////////////
269 
270 
271 //! \ingroup gpu
272 //! @{
273 
274 #define NV_EDID_V1_DATA_SIZE   256
275 
276 #define NV_EDID_DATA_SIZE      NV_EDID_V1_DATA_SIZE
277 
278 typedef struct
279 {
280     NvU32   version;        //structure version
281     NvU8    EDID_Data[NV_EDID_DATA_SIZE];
282 } NV_EDID_V1;
283 
284 //! Used in NvAPI_GPU_GetEDID()
285 typedef struct
286 {
287     NvU32   version;        //!< Structure version
288     NvU8    EDID_Data[NV_EDID_DATA_SIZE];
289     NvU32   sizeofEDID;
290 } NV_EDID_V2;
291 
292 //! Used in NvAPI_GPU_GetEDID()
293 typedef struct
294 {
295     NvU32   version;        //!< Structure version
296     NvU8    EDID_Data[NV_EDID_DATA_SIZE];
297     NvU32   sizeofEDID;
298     NvU32   edidId;     //!< ID which always returned in a monotonically increasing counter.
299                        //!< Across a split-EDID read we need to verify that all calls returned the same edidId.
300                        //!< This counter is incremented if we get the updated EDID.
301     NvU32   offset;    //!< Which 256-byte page of the EDID we want to read. Start at 0.
302                        //!< If the read succeeds with edidSize > NV_EDID_DATA_SIZE,
303                        //!< call back again with offset+256 until we have read the entire buffer
304 } NV_EDID_V3;
305 
306 typedef NV_EDID_V3    NV_EDID;
307 
308 #define NV_EDID_VER1    MAKE_NVAPI_VERSION(NV_EDID_V1,1)
309 #define NV_EDID_VER2    MAKE_NVAPI_VERSION(NV_EDID_V2,2)
310 #define NV_EDID_VER3    MAKE_NVAPI_VERSION(NV_EDID_V3,3)
311 #define NV_EDID_VER   NV_EDID_VER3
312 
313 //! @}
314 
315 //! \ingroup gpu
316 NVAPI_INTERFACE NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID);
317 
318 //! \ingroup gpu
319 //! Used in NV_GPU_CONNECTOR_DATA
320 typedef enum _NV_GPU_CONNECTOR_TYPE
321 {
322     NVAPI_GPU_CONNECTOR_VGA_15_PIN                      = 0x00000000,
323     NVAPI_GPU_CONNECTOR_TV_COMPOSITE                    = 0x00000010,
324     NVAPI_GPU_CONNECTOR_TV_SVIDEO                       = 0x00000011,
325     NVAPI_GPU_CONNECTOR_TV_HDTV_COMPONENT               = 0x00000013,
326     NVAPI_GPU_CONNECTOR_TV_SCART                        = 0x00000014,
327     NVAPI_GPU_CONNECTOR_TV_COMPOSITE_SCART_ON_EIAJ4120  = 0x00000016,
328     NVAPI_GPU_CONNECTOR_TV_HDTV_EIAJ4120                = 0x00000017,
329     NVAPI_GPU_CONNECTOR_PC_POD_HDTV_YPRPB               = 0x00000018,
330     NVAPI_GPU_CONNECTOR_PC_POD_SVIDEO                   = 0x00000019,
331     NVAPI_GPU_CONNECTOR_PC_POD_COMPOSITE                = 0x0000001A,
332     NVAPI_GPU_CONNECTOR_DVI_I_TV_SVIDEO                 = 0x00000020,
333     NVAPI_GPU_CONNECTOR_DVI_I_TV_COMPOSITE              = 0x00000021,
334     NVAPI_GPU_CONNECTOR_DVI_I                           = 0x00000030,
335     NVAPI_GPU_CONNECTOR_DVI_D                           = 0x00000031,
336     NVAPI_GPU_CONNECTOR_ADC                             = 0x00000032,
337     NVAPI_GPU_CONNECTOR_LFH_DVI_I_1                     = 0x00000038,
338     NVAPI_GPU_CONNECTOR_LFH_DVI_I_2                     = 0x00000039,
339     NVAPI_GPU_CONNECTOR_SPWG                            = 0x00000040,
340     NVAPI_GPU_CONNECTOR_OEM                             = 0x00000041,
341     NVAPI_GPU_CONNECTOR_DISPLAYPORT_EXTERNAL            = 0x00000046,
342     NVAPI_GPU_CONNECTOR_DISPLAYPORT_INTERNAL            = 0x00000047,
343     NVAPI_GPU_CONNECTOR_DISPLAYPORT_MINI_EXT            = 0x00000048,
344     NVAPI_GPU_CONNECTOR_HDMI_A                          = 0x00000061,
345     NVAPI_GPU_CONNECTOR_HDMI_C_MINI                     = 0x00000063,
346     NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_1               = 0x00000064,
347     NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_2               = 0x00000065,
348     NVAPI_GPU_CONNECTOR_VIRTUAL_WFD                     = 0x00000070,
349     NVAPI_GPU_CONNECTOR_UNKNOWN                         = 0xFFFFFFFF,
350 } NV_GPU_CONNECTOR_TYPE;
351 
352 ////////////////////////////////////////////////////////////////////////////////
353 //
354 // NvAPI_TVOutput Information
355 //
356 ///////////////////////////////////////////////////////////////////////////////
357 
358 //! \ingroup tvapi
359 //! Used in NV_DISPLAY_TV_OUTPUT_INFO
360 typedef enum _NV_DISPLAY_TV_FORMAT
361 {
362     NV_DISPLAY_TV_FORMAT_NONE               = 0,
363     NV_DISPLAY_TV_FORMAT_SD_NTSCM           = 0x00000001,
364     NV_DISPLAY_TV_FORMAT_SD_NTSCJ           = 0x00000002,
365     NV_DISPLAY_TV_FORMAT_SD_PALM            = 0x00000004,
366     NV_DISPLAY_TV_FORMAT_SD_PALBDGH         = 0x00000008,
367     NV_DISPLAY_TV_FORMAT_SD_PALN            = 0x00000010,
368     NV_DISPLAY_TV_FORMAT_SD_PALNC           = 0x00000020,
369     NV_DISPLAY_TV_FORMAT_SD_576i            = 0x00000100,
370     NV_DISPLAY_TV_FORMAT_SD_480i            = 0x00000200,
371     NV_DISPLAY_TV_FORMAT_ED_480p            = 0x00000400,
372     NV_DISPLAY_TV_FORMAT_ED_576p            = 0x00000800,
373     NV_DISPLAY_TV_FORMAT_HD_720p            = 0x00001000,
374     NV_DISPLAY_TV_FORMAT_HD_1080i           = 0x00002000,
375     NV_DISPLAY_TV_FORMAT_HD_1080p           = 0x00004000,
376     NV_DISPLAY_TV_FORMAT_HD_720p50          = 0x00008000,
377     NV_DISPLAY_TV_FORMAT_HD_1080p24         = 0x00010000,
378     NV_DISPLAY_TV_FORMAT_HD_1080i50         = 0x00020000,
379     NV_DISPLAY_TV_FORMAT_HD_1080p50         = 0x00040000,
380     NV_DISPLAY_TV_FORMAT_UHD_4Kp30          = 0x00080000,
381     NV_DISPLAY_TV_FORMAT_UHD_4Kp25          = 0x00100000,
382     NV_DISPLAY_TV_FORMAT_UHD_4Kp24          = 0x00200000,
383     NV_DISPLAY_TV_FORMAT_UHD_4Kp24_SMPTE    = 0x00400000,
384 
385     NV_DISPLAY_TV_FORMAT_SD_OTHER           = 0x01000000,
386     NV_DISPLAY_TV_FORMAT_ED_OTHER           = 0x02000000,
387     NV_DISPLAY_TV_FORMAT_HD_OTHER           = 0x04000000,
388 
389     NV_DISPLAY_TV_FORMAT_ANY                = 0x80000000,
390 
391 } NV_DISPLAY_TV_FORMAT;
392 
393 
394 //! \ingroup dispcontrol
395 //! @{
396 #define NVAPI_MAX_VIEW_TARGET  2
397 #define NVAPI_ADVANCED_MAX_VIEW_TARGET 4
398 
399 #ifndef _NV_TARGET_VIEW_MODE_
400 #define _NV_TARGET_VIEW_MODE_
401 
402 //! Used in NvAPI_SetView().
403 typedef enum _NV_TARGET_VIEW_MODE
404 {
405     NV_VIEW_MODE_STANDARD  = 0,
406     NV_VIEW_MODE_CLONE     = 1,
407     NV_VIEW_MODE_HSPAN     = 2,
408     NV_VIEW_MODE_VSPAN     = 3,
409     NV_VIEW_MODE_DUALVIEW  = 4,
410     NV_VIEW_MODE_MULTIVIEW = 5,
411 } NV_TARGET_VIEW_MODE;
412 #endif
413 
414 //! @}
415 
416 
417 // Following definitions are used in NvAPI_SetViewEx.
418 
419 //! Scaling modes - used in NvAPI_SetViewEx().
420 //! \ingroup dispcontrol
421 typedef enum _NV_SCALING
422 {
423     NV_SCALING_DEFAULT          = 0,        //!< No change
424 
425     // New Scaling Declarations
426     NV_SCALING_GPU_SCALING_TO_CLOSEST                   = 1,  //!< Balanced  - Full Screen
427     NV_SCALING_GPU_SCALING_TO_NATIVE                    = 2,  //!< Force GPU - Full Screen
428     NV_SCALING_GPU_SCANOUT_TO_NATIVE                    = 3,  //!< Force GPU - Centered\No Scaling
429     NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE  = 5,  //!< Force GPU - Aspect Ratio
430     NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_CLOSEST = 6,  //!< Balanced  - Aspect Ratio
431     NV_SCALING_GPU_SCANOUT_TO_CLOSEST                   = 7,  //!< Balanced  - Centered\No Scaling
432 
433     // Legacy Declarations
434     NV_SCALING_MONITOR_SCALING                          = NV_SCALING_GPU_SCALING_TO_CLOSEST,
435     NV_SCALING_ADAPTER_SCALING                          = NV_SCALING_GPU_SCALING_TO_NATIVE,
436     NV_SCALING_CENTERED                                 = NV_SCALING_GPU_SCANOUT_TO_NATIVE,
437     NV_SCALING_ASPECT_SCALING                           = NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE,
438 
439     NV_SCALING_CUSTOMIZED       = 255       //!< For future use
440 } NV_SCALING;
441 
442 //! Rotate modes- used in NvAPI_SetViewEx().
443 //! \ingroup dispcontrol
444 typedef enum _NV_ROTATE
445 {
446     NV_ROTATE_0           = 0,
447     NV_ROTATE_90          = 1,
448     NV_ROTATE_180         = 2,
449     NV_ROTATE_270         = 3,
450     NV_ROTATE_IGNORED     = 4,
451 } NV_ROTATE;
452 
453 //! Color formats- used in NvAPI_SetViewEx().
454 //! \ingroup dispcontrol
455 #define NVFORMAT_MAKEFOURCC(ch0, ch1, ch2, ch3)                              \
456                          ((NvU32)(NvU8)(ch0) | ((NvU32)(NvU8)(ch1) << 8) |   \
457                      ((NvU32)(NvU8)(ch2) << 16) | ((NvU32)(NvU8)(ch3) << 24 ))
458 
459 
460 
461 //! Color formats- used in NvAPI_SetViewEx().
462 //! \ingroup dispcontrol
463 typedef enum _NV_FORMAT
464 {
465     NV_FORMAT_UNKNOWN           =  0,       //!< unknown. Driver will choose one as following value.
466     NV_FORMAT_P8                = 41,       //!< for 8bpp mode
467     NV_FORMAT_R5G6B5            = 23,       //!< for 16bpp mode
468     NV_FORMAT_A8R8G8B8          = 21,       //!< for 32bpp mode
469     NV_FORMAT_A16B16G16R16F     = 113,      //!< for 64bpp(floating point) mode.
470 
471 } NV_FORMAT;
472 
473 // TV standard
474 
475 typedef struct
476 {
477     float x;    //!<  x-coordinate of the viewport top-left point
478     float y;    //!<  y-coordinate of the viewport top-left point
479     float w;    //!<  Width of the viewport
480     float h;    //!<  Height of the viewport
481 } NV_VIEWPORTF;
482 
483 
484 
485 //! \ingroup dispcontrol
486 //! The timing override is not supported yet; must be set to _AUTO. \n
487 
488 
489 typedef enum _NV_TIMING_OVERRIDE
490 {
491     NV_TIMING_OVERRIDE_CURRENT = 0,          //!< get the current timing
492     NV_TIMING_OVERRIDE_AUTO,                 //!< the timing the driver will use based the current policy
493     NV_TIMING_OVERRIDE_EDID,                 //!< EDID timing
494     NV_TIMING_OVERRIDE_DMT,                  //!< VESA DMT timing
495     NV_TIMING_OVERRIDE_DMT_RB,               //!< VESA DMT timing with reduced blanking
496     NV_TIMING_OVERRIDE_CVT,                  //!< VESA CVT timing
497     NV_TIMING_OVERRIDE_CVT_RB,               //!< VESA CVT timing with reduced blanking
498     NV_TIMING_OVERRIDE_GTF,                  //!< VESA GTF timing
499     NV_TIMING_OVERRIDE_EIA861,               //!< EIA 861x pre-defined timing
500     NV_TIMING_OVERRIDE_ANALOG_TV,            //!< analog SD/HDTV timing
501     NV_TIMING_OVERRIDE_CUST,                 //!< NV custom timings
502     NV_TIMING_OVERRIDE_NV_PREDEFINED,        //!< NV pre-defined timing (basically the PsF timings)
503     NV_TIMING_OVERRIDE_NV_PSF                = NV_TIMING_OVERRIDE_NV_PREDEFINED,
504     NV_TIMING_OVERRIDE_NV_ASPR,
505     NV_TIMING_OVERRIDE_SDI,                  //!< Override for SDI timing
506 
507     NV_TIMING_OVRRIDE_MAX,
508 }NV_TIMING_OVERRIDE;
509 
510 
511 #ifndef NV_TIMING_STRUCTS_DEFINED
512 #define NV_TIMING_STRUCTS_DEFINED
513 
514 //***********************
515 // The Timing Structure
516 //***********************
517 //
518 //! \ingroup dispcontrol
519 //!  NVIDIA-specific timing extras \n
520 //! Used in NV_TIMING.
521 typedef struct tagNV_TIMINGEXT
522 {
523     NvU32   flag;          //!< Reserved for NVIDIA hardware-based enhancement, such as double-scan.
524     NvU16   rr;            //!< Logical refresh rate to present
525     NvU32   rrx1k;         //!< Physical vertical refresh rate in 0.001Hz
526     NvU32   aspect;        //!< Display aspect ratio Hi(aspect):horizontal-aspect, Low(aspect):vertical-aspect
527     NvU16   rep;           //!< Bit-wise pixel repetition factor: 0x1:no pixel repetition; 0x2:each pixel repeats twice horizontally,..
528     NvU32   status;        //!< Timing standard
529     NvU8    name[40];      //!< Timing name
530 }NV_TIMINGEXT;
531 
532 
533 
534 //! \ingroup dispcontrol
535 //!The very basic timing structure based on the VESA standard:
536 //! \code
537 //!            |<----------------------------htotal--------------------------->|
538 //!             ---------"active" video-------->|<-------blanking------>|<-----
539 //!            |<-------hvisible-------->|<-hb->|<-hfp->|<-hsw->|<-hbp->|<-hb->|
540 //! --------- -+-------------------------+      |       |       |       |      |
541 //!   A      A |                         |      |       |       |       |      |
542 //!   :      : |                         |      |       |       |       |      |
543 //!   :      : |                         |      |       |       |       |      |
544 //!   :vertical|    addressable video    |      |       |       |       |      |
545 //!   : visible|                         |      |       |       |       |      |
546 //!   :      : |                         |      |       |       |       |      |
547 //!   :      : |                         |      |       |       |       |      |
548 //! vertical V |                         |      |       |       |       |      |
549 //!  total   --+-------------------------+      |       |       |       |      |
550 //!   :      vb         border                  |       |       |       |      |
551 //!   :      -----------------------------------+       |       |       |      |
552 //!   :      vfp        front porch                     |       |       |      |
553 //!   :      -------------------------------------------+       |       |      |
554 //!   :      vsw        sync width                              |       |      |
555 //!   :      ---------------------------------------------------+       |      |
556 //!   :      vbp        back porch                                      |      |
557 //!   :      -----------------------------------------------------------+      |
558 //!   V      vb         border                                                 |
559 //! ---------------------------------------------------------------------------+
560 //! \endcode
561 typedef struct _NV_TIMING
562 {
563     // VESA scan out timing parameters:
564     NvU16 HVisible;         //!< horizontal visible
565     NvU16 HBorder;          //!< horizontal border
566     NvU16 HFrontPorch;      //!< horizontal front porch
567     NvU16 HSyncWidth;       //!< horizontal sync width
568     NvU16 HTotal;           //!< horizontal total
569     NvU8  HSyncPol;         //!< horizontal sync polarity: 1-negative, 0-positive
570 
571     NvU16 VVisible;         //!< vertical visible
572     NvU16 VBorder;          //!< vertical border
573     NvU16 VFrontPorch;      //!< vertical front porch
574     NvU16 VSyncWidth;       //!< vertical sync width
575     NvU16 VTotal;           //!< vertical total
576     NvU8  VSyncPol;         //!< vertical sync polarity: 1-negative, 0-positive
577 
578     NvU16 interlaced;       //!< 1-interlaced, 0-progressive
579     NvU32 pclk;             //!< pixel clock in 10 kHz
580 
581     //other timing related extras
582     NV_TIMINGEXT etc;
583 }NV_TIMING;
584 #endif //NV_TIMING_STRUCTS_DEFINED
585 
586 
587 //! \addtogroup dispcontrol
588 //! Timing-related constants
589 //! @{
590 #define NV_TIMING_H_SYNC_POSITIVE                             0
591 #define NV_TIMING_H_SYNC_NEGATIVE                             1
592 #define NV_TIMING_H_SYNC_DEFAULT                              NV_TIMING_H_SYNC_NEGATIVE
593 //
594 #define NV_TIMING_V_SYNC_POSITIVE                             0
595 #define NV_TIMING_V_SYNC_NEGATIVE                             1
596 #define NV_TIMING_V_SYNC_DEFAULT                              NV_TIMING_V_SYNC_POSITIVE
597 //
598 #define NV_TIMING_PROGRESSIVE                                 0
599 #define NV_TIMING_INTERLACED                                  1
600 #define NV_TIMING_INTERLACED_EXTRA_VBLANK_ON_FIELD2           1
601 #define NV_TIMING_INTERLACED_NO_EXTRA_VBLANK_ON_FIELD2        2
602 //! @}
603 
604 ///////////////////////////////////////////////////////////////////////////////
605 //
606 // FUNCTION NAME:   NvAPI_SetView
607 //
608 //! \fn NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView)
609 //!  This function lets the caller modify the target display arrangement of the selected source display handle in any nView mode.
610 //!  It can also modify or extend the source display in Dualview mode.
611 //!  \note Maps the selected source to the associated target Ids.
612 //!  \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API.
613 //!
614 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.
615 //! SUPPORTED OS:  Windows Vista and higher
616 //!
617 //!
618 //! \since Release: 90
619 //!
620 //! \param [in]  hNvDisplay       NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
621 //! \param [in]  pTargetInfo      Pointer to array of NV_VIEW_TARGET_INFO, specifying device properties in this view.
622 //!                               The first device entry in the array is the physical primary.
623 //!                               The device entry with the lowest source id is the desktop primary.
624 //! \param [in]  targetCount      Count of target devices specified in pTargetInfo.
625 //! \param [in]  targetView       Target view selected from NV_TARGET_VIEW_MODE.
626 //!
627 //! \retval  NVAPI_OK               Completed request
628 //! \retval  NVAPI_ERROR            Miscellaneous error occurred
629 //! \retval  NVAPI_INVALID_ARGUMENT Invalid input parameter.
630 //
631 ///////////////////////////////////////////////////////////////////////////////
632 
633 //! \ingroup dispcontrol
634 //! Used in NvAPI_SetView() and NvAPI_GetView()
635 typedef struct
636 {
637     NvU32 version;     //!< (IN) structure version
638     NvU32 count;       //!< (IN) target count
639     struct
640     {
641         NvU32 deviceMask;    //!< (IN/OUT) Device mask
642         NvU32 sourceId;      //!< (IN/OUT) Source ID - values will be based on the number of heads exposed per GPU.
643         NvU32 bPrimary:1;    //!< (OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary.
644                              //!< NvAPI_SetView automatically selects the first target in NV_VIEW_TARGET_INFO index 0 as the GPU's primary view.
645         NvU32 bInterlaced:1; //!< (IN/OUT) Indicates if the timing being used on this monitor is interlaced.
646         NvU32 bGDIPrimary:1; //!< (IN/OUT) Indicates if this is the desktop GDI primary.
647         NvU32 bForceModeSet:1;//!< (IN) Used only on Win7 and higher during a call to NvAPI_SetView(). Turns off optimization & forces OS to set supplied mode.
648     } target[NVAPI_MAX_VIEW_TARGET];
649 } NV_VIEW_TARGET_INFO;
650 
651 //! \ingroup dispcontrol
652 #define NV_VIEW_TARGET_INFO_VER  MAKE_NVAPI_VERSION(NV_VIEW_TARGET_INFO,2)
653 
654 
655 //! \ingroup dispcontrol
656 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.")
657 NVAPI_INTERFACE NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView);
658 
659 
660 ///////////////////////////////////////////////////////////////////////////////
661 //
662 // FUNCTION NAME:   NvAPI_SetViewEx
663 //
664 //!  \fn NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView)
665 //!  This function lets caller to modify the display arrangement for selected source display handle in any of the nview modes.
666 //!  It also allows to modify or extend the source display in dualview mode.
667 //!   \note Maps the selected source to the associated target Ids.
668 //!   \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API.
669 //!
670 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.
671 //! SUPPORTED OS:  Windows Vista and higher
672 //!
673 //!
674 //! \since Release: 95
675 //!
676 //! \param [in]  hNvDisplay   NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with
677 //!                           NvAPI_EnumNVidiaDisplayHandle().
678 //! \param [in]  pPathInfo    Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view.
679 //!                           The first device entry in the array is the physical primary.
680 //!                           The device entry with the lowest source id is the desktop primary.
681 //! \param [in]  pathCount    Count of paths specified in pPathInfo.
682 //! \param [in]  displayView  Display view selected from NV_TARGET_VIEW_MODE.
683 //!
684 //! \retval  NVAPI_OK                Completed request
685 //! \retval  NVAPI_ERROR             Miscellaneous error occurred
686 //! \retval  NVAPI_INVALID_ARGUMENT  Invalid input parameter.
687 //
688 ///////////////////////////////////////////////////////////////////////////////
689 
690 //! \ingroup dispcontrol
691 #define NVAPI_MAX_DISPLAY_PATH  NVAPI_MAX_VIEW_TARGET
692 
693 //! \ingroup dispcontrol
694 #define NVAPI_ADVANCED_MAX_DISPLAY_PATH  NVAPI_ADVANCED_MAX_VIEW_TARGET
695 
696 
697 
698 //! \ingroup dispcontrol
699 //! Used in NV_DISPLAY_PATH_INFO.
700 typedef struct
701 {
702     NvU32                   deviceMask;     //!< (IN) Device mask
703     NvU32                   sourceId;       //!< (IN) Values will be based on the number of heads exposed per GPU(0, 1?)
704     NvU32                   bPrimary:1;     //!< (IN/OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary.
705                                             //!< NvAPI_SetViewEx() automatically selects the first target in NV_DISPLAY_PATH_INFO index 0 as the GPU's primary view.
706     NV_GPU_CONNECTOR_TYPE   connector;      //!< (IN) Specify connector type. For TV only.
707 
708     // source mode information
709     NvU32                   width;          //!< (IN) Width of the mode
710     NvU32                   height;         //!< (IN) Height of the mode
711     NvU32                   depth;          //!< (IN) Depth of the mode
712     NV_FORMAT               colorFormat;    //!<      Color format if it needs to be specified. Not used now.
713 
714     //rotation setting of the mode
715     NV_ROTATE               rotation;       //!< (IN) Rotation setting.
716 
717     // the scaling mode
718     NV_SCALING              scaling;        //!< (IN) Scaling setting
719 
720     // Timing info
721     NvU32                   refreshRate;    //!< (IN) Refresh rate of the mode
722     NvU32                   interlaced:1;   //!< (IN) Interlaced mode flag
723 
724     NV_DISPLAY_TV_FORMAT    tvFormat;       //!< (IN) To choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE
725 
726     // Windows desktop position
727     NvU32                   posx;           //!< (IN/OUT) X-offset of this display on the Windows desktop
728     NvU32                   posy;           //!< (IN/OUT) Y-offset of this display on the Windows desktop
729     NvU32                   bGDIPrimary:1;  //!< (IN/OUT) Indicates if this is the desktop GDI primary.
730 
731     NvU32                   bForceModeSet:1;//!< (IN) Used only on Win7 and higher during a call to NvAPI_SetViewEx(). Turns off optimization & forces OS to set supplied mode.
732     NvU32                   bFocusDisplay:1;//!< (IN) If set, this display path should have the focus after the GPU topology change
733     NvU32                   gpuId:24;       //!< (IN) the physical display/target Gpu id which is the owner of the scan out (for SLI multimon, display from the slave Gpu)
734 
735 } NV_DISPLAY_PATH;
736 
737 //! \ingroup dispcontrol
738 //! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx().
739 typedef struct
740 {
741     NvU32 version;     //!< (IN) Structure version
742     NvU32 count;       //!< (IN) Path count
743     NV_DISPLAY_PATH path[NVAPI_MAX_DISPLAY_PATH];
744 } NV_DISPLAY_PATH_INFO_V3;
745 
746 //! \ingroup dispcontrol
747 //! Used in NvAPI_SetViewEx() and NvAPI_GetViewEx().
748 typedef struct
749 {
750     NvU32 version;     //!< (IN) Structure version
751     NvU32 count;       //!< (IN) Path count
752     NV_DISPLAY_PATH path[NVAPI_ADVANCED_MAX_DISPLAY_PATH];
753 } NV_DISPLAY_PATH_INFO;
754 
755 //! \addtogroup dispcontrol
756 //! Macro for constructing the version fields of NV_DISPLAY_PATH_INFO
757 //! @{
758 #define NV_DISPLAY_PATH_INFO_VER  NV_DISPLAY_PATH_INFO_VER4
759 #define NV_DISPLAY_PATH_INFO_VER4 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,4)
760 #define NV_DISPLAY_PATH_INFO_VER3 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,3)
761 #define NV_DISPLAY_PATH_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,2)
762 #define NV_DISPLAY_PATH_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,1)
763 //! @}
764 
765 
766 //! \ingroup dispcontrol
767 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_SetDisplayConfig.")
768 NVAPI_INTERFACE NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView);
769 
770 
771 
772 ///////////////////////////////////////////////////////////////////////////////
773 // SetDisplayConfig/GetDisplayConfig
774 ///////////////////////////////////////////////////////////////////////////////
775 //! \ingroup dispcontrol
776 
777 typedef struct _NV_POSITION
778 {
779     NvS32   x;
780     NvS32   y;
781 } NV_POSITION;
782 
783 //! \ingroup dispcontrol
784 typedef struct _NV_RESOLUTION
785 {
786     NvU32   width;
787     NvU32   height;
788     NvU32   colorDepth;
789 } NV_RESOLUTION;
790 
791 //! \ingroup dispcontrol
792 typedef struct _NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1
793 {
794     NvU32                   version;
795 
796     // Rotation and Scaling
797     NV_ROTATE               rotation;       //!< (IN) rotation setting.
798     NV_SCALING              scaling;        //!< (IN) scaling setting.
799 
800     // Refresh Rate
801     NvU32                   refreshRate1K;  //!< (IN) Non-interlaced Refresh Rate of the mode, multiplied by 1000, 0 = ignored
802                                             //!< This is the value which driver reports to the OS.
803     // Flags
804     NvU32                   interlaced:1;   //!< (IN) Interlaced mode flag, ignored if refreshRate == 0
805     NvU32                   primary:1;      //!< (IN) Declares primary display in clone configuration. This is *NOT* GDI Primary.
806                                             //!< Only one target can be primary per source. If no primary is specified, the first
807                                             //!< target will automatically be primary.
808 #ifdef NV_PAN_AND_SCAN_DEFINED
809     NvU32                   isPanAndScanTarget:1; //!< Whether on this target Pan and Scan is enabled or has to be enabled. Valid only
810 	                                              //!< when the target is part of clone topology.
811     NvU32                   reserved:29;
812 #else
813     NvU32                   reserved:30;
814 #endif
815     // TV format information
816     NV_GPU_CONNECTOR_TYPE   connector;      //!< Specify connector type. For TV only, ignored if tvFormat == NV_DISPLAY_TV_FORMAT_NONE
817     NV_DISPLAY_TV_FORMAT    tvFormat;       //!< (IN) to choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE
818 
819     // Backend (raster) timing standard
820     NV_TIMING_OVERRIDE      timingOverride;     //!< Ignored if timingOverride == NV_TIMING_OVERRIDE_CURRENT
821     NV_TIMING               timing;             //!< Scan out timing, valid only if timingOverride == NV_TIMING_OVERRIDE_CUST
822                                                 //!< The value NV_TIMING::NV_TIMINGEXT::rrx1k is obtained from the EDID. The driver may
823                                                 //!< tweak this value for HDTV, stereo, etc., before reporting it to the OS.
824 } NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1;
825 
826 //! \ingroup dispcontrol
827 typedef NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1 NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO;
828 
829 //! \ingroup dispcontrol
830 #define NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER1     MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_V1,1)
831 
832 //! \ingroup dispcontrol
833 #define NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER      NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO_VER1
834 
835 //! \ingroup dispcontrol
836 typedef struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1
837 {
838     NvU32                                           displayId;  //!< Display ID
839     NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO*     details;    //!< May be NULL if no advanced settings are required. NULL for Non-NVIDIA Display.
840 } NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1;
841 
842 //! \ingroup dispcontrol
843 typedef struct _NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2
844 {
845     NvU32                                           displayId;  //!< Display ID
846     NV_DISPLAYCONFIG_PATH_ADVANCED_TARGET_INFO*     details;    //!< May be NULL if no advanced settings are required
847     NvU32                                           targetId;   //!< Windows CCD target ID. Must be present only for non-NVIDIA adapter, for NVIDIA adapter this parameter is ignored.
848 } NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2;
849 
850 
851 //! \ingroup dispcontrol
852 //! As version is not defined for this structure, we will be using version of NV_DISPLAYCONFIG_PATH_INFO
853 typedef NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2 NV_DISPLAYCONFIG_PATH_TARGET_INFO;
854 
855 
856 //! \ingroup dispcontrol
857 typedef enum _NV_DISPLAYCONFIG_SPANNING_ORIENTATION
858 {
859     NV_DISPLAYCONFIG_SPAN_NONE          = 0,
860     NV_DISPLAYCONFIG_SPAN_HORIZONTAL    = 1,
861     NV_DISPLAYCONFIG_SPAN_VERTICAL      = 2,
862 } NV_DISPLAYCONFIG_SPANNING_ORIENTATION;
863 
864 //! \ingroup dispcontrol
865 typedef struct _NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1
866 {
867     NV_RESOLUTION                           resolution;
868     NV_FORMAT                               colorFormat;                //!< Ignored at present, must be NV_FORMAT_UNKNOWN (0)
869     NV_POSITION                             position;                   //!< Is all positions are 0 or invalid, displays will be automatically
870                                                                         //!< positioned from left to right with GDI Primary at 0,0, and all
871                                                                         //!< other displays in the order of the path array.
872     NV_DISPLAYCONFIG_SPANNING_ORIENTATION   spanningOrientation;        //!< Spanning is only supported on XP
873     NvU32                                   bGDIPrimary : 1;
874     NvU32                                   bSLIFocus : 1;
875     NvU32                                   reserved : 30;              //!< Must be 0
876 } NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1;
877 
878 //! \ingroup dispcontrol
879 //! As version is not defined for this structure we will be using version of NV_DISPLAYCONFIG_PATH_INFO
880 typedef NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1 NV_DISPLAYCONFIG_SOURCE_MODE_INFO;
881 
882 //! \ingroup dispcontrol
883 typedef struct _NV_DISPLAYCONFIG_PATH_INFO_V1
884 {
885     NvU32                                   version;
886     NvU32                                   reserved_sourceId;     	//!< This field is reserved. There is ongoing debate if we need this field.
887                                                                         //!< Identifies sourceIds used by Windows. If all sourceIds are 0,
888                                                                         //!< these will be computed automatically.
889     NvU32                                   targetInfoCount;            //!< Number of elements in targetInfo array
890     NV_DISPLAYCONFIG_PATH_TARGET_INFO_V1*   targetInfo;
891     NV_DISPLAYCONFIG_SOURCE_MODE_INFO*      sourceModeInfo;             //!< May be NULL if mode info is not important
892 } NV_DISPLAYCONFIG_PATH_INFO_V1;
893 
894 //! \ingroup dispcontrol
895 //! This define is temporary and must be removed once DVS failure is fixed.
896 #define _NV_DISPLAYCONFIG_PATH_INFO_V2 _NV_DISPLAYCONFIG_PATH_INFO
897 
898 //! \ingroup dispcontrol
899 typedef struct _NV_DISPLAYCONFIG_PATH_INFO_V2
900 {
901     NvU32                                   version;
902     union {
903         NvU32                                   sourceId;            	//!< Identifies sourceId used by Windows CCD. This can be optionally set.
904         NvU32                                   reserved_sourceId;      //!< Only for compatibility
905     };
906 
907     NvU32                                   targetInfoCount;            //!< Number of elements in targetInfo array
908     NV_DISPLAYCONFIG_PATH_TARGET_INFO*      targetInfo;
909     NV_DISPLAYCONFIG_SOURCE_MODE_INFO*      sourceModeInfo;             //!< May be NULL if mode info is not important
910     NvU32                                   IsNonNVIDIAAdapter : 1;     //!< True for non-NVIDIA adapter.
911     NvU32                                   reserved : 31;              //!< Must be 0
912     void                                    *pOSAdapterID;              //!< Used by Non-NVIDIA adapter for pointer to OS Adapter of LUID
913                                                                         //!< type, type casted to void *.
914 } NV_DISPLAYCONFIG_PATH_INFO_V2;
915 
916 //! \ingroup dispcontrol
917 typedef NV_DISPLAYCONFIG_PATH_INFO_V2 NV_DISPLAYCONFIG_PATH_INFO;
918 
919 //! \ingroup dispcontrol
920 #define NV_DISPLAYCONFIG_PATH_INFO_VER1                 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V1,1)
921 
922 //! \ingroup dispcontrol
923 #define NV_DISPLAYCONFIG_PATH_INFO_VER2                 MAKE_NVAPI_VERSION(NV_DISPLAYCONFIG_PATH_INFO_V2,2)
924 
925 //! \ingroup dispcontrol
926 #define NV_DISPLAYCONFIG_PATH_INFO_VER                  NV_DISPLAYCONFIG_PATH_INFO_VER2
927 
928 //! \ingroup dispcontrol
929 typedef enum _NV_DISPLAYCONFIG_FLAGS
930 {
931     NV_DISPLAYCONFIG_VALIDATE_ONLY          = 0x00000001,
932     NV_DISPLAYCONFIG_SAVE_TO_PERSISTENCE    = 0x00000002,
933     NV_DISPLAYCONFIG_DRIVER_RELOAD_ALLOWED  = 0x00000004,               //!< Driver reload is permitted if necessary
934     NV_DISPLAYCONFIG_FORCE_MODE_ENUMERATION = 0x00000008,               //!< Refresh OS mode list.
935 } NV_DISPLAYCONFIG_FLAGS;
936 
937 
938 #define NVAPI_UNICODE_STRING_MAX                             2048
939 #define NVAPI_BINARY_DATA_MAX                                4096
940 
941 typedef NvU16 NvAPI_UnicodeString[NVAPI_UNICODE_STRING_MAX];
942 typedef const NvU16 *NvAPI_LPCWSTR;
943 ///////////////////////////////////////////////////////////////////////////////
944 //
945 // FUNCTION NAME: NvAPI_GetDisplayDriverVersion
946 //! \fn NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion)
947 //! This function returns a struct that describes aspects of the display driver
948 //!                build.
949 //!
950 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_SYS_GetDriverAndBranchVersion.
951 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
952 //!
953 //!
954 //! \since Release: 80
955 //!
956 //! \param [in]  hNvDisplay NVIDIA display handle.
957 //! \param [out] pVersion Pointer to NV_DISPLAY_DRIVER_VERSION struc
958 //!
959 //! \retval NVAPI_ERROR
960 //! \retval NVAPI_OK
961 ///////////////////////////////////////////////////////////////////////////////
962 
963 //! \ingroup driverapi
964 //! Used in NvAPI_GetDisplayDriverVersion()
965 typedef struct
966 {
967     NvU32              version;             // Structure version
968     NvU32              drvVersion;
969     NvU32              bldChangeListNum;
970     NvAPI_ShortString  szBuildBranchString;
971     NvAPI_ShortString  szAdapterString;
972 } NV_DISPLAY_DRIVER_VERSION;
973 
974 //! \ingroup driverapi
975 #define NV_DISPLAY_DRIVER_VERSION_VER  MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_VERSION,1)
976 
977 
978 //! \ingroup driverapi
979 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_SYS_GetDriverAndBranchVersion.")
980 NVAPI_INTERFACE NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion);
981 
982 
983 
984 
985 
986 
987 ///////////////////////////////////////////////////////////////////////////////
988 //
989 // FUNCTION NAME: NvAPI_OGL_ExpertModeSet[Get]
990 //
991 //! \name NvAPI_OGL_ExpertModeSet[Get] Functions
992 //@{
993 //!  This function configures OpenGL Expert Mode, an API usage feedback and
994 //!  advice reporting mechanism. The effects of this call are
995 //!  applied only to the current context, and are reset to the
996 //!  defaults when the context is destroyed.
997 //!
998 //!  \note  This feature is valid at runtime only when GLExpert
999 //!         functionality has been built into the OpenGL driver
1000 //!         installed on the system. All Windows Vista OpenGL
1001 //!         drivers provided by NVIDIA have this instrumentation
1002 //!         included by default. Windows XP, however, requires a
1003 //!         special display driver available with the NVIDIA
1004 //!         PerfSDK found at developer.nvidia.com.
1005 //!
1006 //!  \note These functions are valid only for the current OpenGL
1007 //!        context. Calling these functions prior to creating a
1008 //!        context and calling MakeCurrent with it will result
1009 //!        in errors and undefined behavior.
1010 //!
1011 //! SUPPORTED OS:  Windows XP and higher
1012 //!
1013 //!
1014 //! \since Release: 80
1015 //!
1016 //! \param   expertDetailMask  Mask made up of NVAPI_OGLEXPERT_DETAIL bits,
1017 //!                            this parameter specifies the detail level in
1018 //!                            the feedback stream.
1019 //!
1020 //! \param   expertReportMask  Mask made up of NVAPI_OGLEXPERT_REPORT bits,
1021 //!                            this parameter specifies the areas of
1022 //!                            functional interest.
1023 //!
1024 //! \param   expertOutputMask  Mask made up of NVAPI_OGLEXPERT_OUTPUT bits,
1025 //!                            this parameter specifies the feedback output
1026 //!                            location.
1027 //!
1028 //! \param   expertCallback    Used in conjunction with OUTPUT_TO_CALLBACK,
1029 //!                            this is a simple callback function the user
1030 //!                            may use to obtain the feedback stream. The
1031 //!                            function will be called once per fully
1032 //!                            qualified feedback stream extry.
1033 //!
1034 //! \retval  NVAPI_API_NOT_INTIALIZED          NVAPI not initialized
1035 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND     No NVIDIA GPU found
1036 //! \retval  NVAPI_OPENGL_CONTEXT_NOT_CURRENT  No NVIDIA OpenGL context
1037 //!                                            which supports GLExpert
1038 //!                                            has been made current
1039 //! \retval  NVAPI_ERROR                       OpenGL driver failed to load properly
1040 //! \retval  NVAPI_OK                          Success
1041 //
1042 ///////////////////////////////////////////////////////////////////////////////
1043 
1044 //! \addtogroup oglapi
1045 //! @{
1046 #define NVAPI_OGLEXPERT_DETAIL_NONE                 0x00000000
1047 #define NVAPI_OGLEXPERT_DETAIL_ERROR                0x00000001
1048 #define NVAPI_OGLEXPERT_DETAIL_SWFALLBACK           0x00000002
1049 #define NVAPI_OGLEXPERT_DETAIL_BASIC_INFO           0x00000004
1050 #define NVAPI_OGLEXPERT_DETAIL_DETAILED_INFO        0x00000008
1051 #define NVAPI_OGLEXPERT_DETAIL_PERFORMANCE_WARNING  0x00000010
1052 #define NVAPI_OGLEXPERT_DETAIL_QUALITY_WARNING      0x00000020
1053 #define NVAPI_OGLEXPERT_DETAIL_USAGE_WARNING        0x00000040
1054 #define NVAPI_OGLEXPERT_DETAIL_ALL                  0xFFFFFFFF
1055 
1056 #define NVAPI_OGLEXPERT_REPORT_NONE                 0x00000000
1057 #define NVAPI_OGLEXPERT_REPORT_ERROR                0x00000001
1058 #define NVAPI_OGLEXPERT_REPORT_SWFALLBACK           0x00000002
1059 #define NVAPI_OGLEXPERT_REPORT_PIPELINE_VERTEX      0x00000004
1060 #define NVAPI_OGLEXPERT_REPORT_PIPELINE_GEOMETRY    0x00000008
1061 #define NVAPI_OGLEXPERT_REPORT_PIPELINE_XFB         0x00000010
1062 #define NVAPI_OGLEXPERT_REPORT_PIPELINE_RASTER      0x00000020
1063 #define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAGMENT    0x00000040
1064 #define NVAPI_OGLEXPERT_REPORT_PIPELINE_ROP         0x00000080
1065 #define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAMEBUFFER 0x00000100
1066 #define NVAPI_OGLEXPERT_REPORT_PIPELINE_PIXEL       0x00000200
1067 #define NVAPI_OGLEXPERT_REPORT_PIPELINE_TEXTURE     0x00000400
1068 #define NVAPI_OGLEXPERT_REPORT_OBJECT_BUFFEROBJECT  0x00000800
1069 #define NVAPI_OGLEXPERT_REPORT_OBJECT_TEXTURE       0x00001000
1070 #define NVAPI_OGLEXPERT_REPORT_OBJECT_PROGRAM       0x00002000
1071 #define NVAPI_OGLEXPERT_REPORT_OBJECT_FBO           0x00004000
1072 #define NVAPI_OGLEXPERT_REPORT_FEATURE_SLI          0x00008000
1073 #define NVAPI_OGLEXPERT_REPORT_ALL                  0xFFFFFFFF
1074 
1075 
1076 #define NVAPI_OGLEXPERT_OUTPUT_TO_NONE       0x00000000
1077 #define NVAPI_OGLEXPERT_OUTPUT_TO_CONSOLE    0x00000001
1078 #define NVAPI_OGLEXPERT_OUTPUT_TO_DEBUGGER   0x00000004
1079 #define NVAPI_OGLEXPERT_OUTPUT_TO_CALLBACK   0x00000008
1080 #define NVAPI_OGLEXPERT_OUTPUT_TO_ALL        0xFFFFFFFF
1081 
1082 //! @}
1083 
1084 ///////////////////////////////////////////////////////////////////////////////
1085 //
1086 // FUNCTION TYPE: NVAPI_OGLEXPERT_CALLBACK
1087 //
1088 //!   DESCRIPTION: Used in conjunction with OUTPUT_TO_CALLBACK, this is a simple
1089 //!                callback function the user may use to obtain the feedback
1090 //!                stream. The function will be called once per fully qualified
1091 //!                feedback stream entry.
1092 //!
1093 //!   \param   categoryId    Contains the bit from the NVAPI_OGLEXPERT_REPORT
1094 //!                          mask that corresponds to the current message
1095 //!   \param   messageId     Unique ID for the current message
1096 //!   \param   detailLevel   Contains the bit from the NVAPI_OGLEXPERT_DETAIL
1097 //!                          mask that corresponds to the current message
1098 //!   \param   objectId      Unique ID of the object that corresponds to the
1099 //!                          current message
1100 //!   \param   messageStr    Text string from the current message
1101 //!
1102 //!   \ingroup oglapi
1103 ///////////////////////////////////////////////////////////////////////////////
1104 typedef void (* NVAPI_OGLEXPERT_CALLBACK) (unsigned int categoryId, unsigned int messageId, unsigned int detailLevel, int objectId, const char *messageStr);
1105 
1106 
1107 
1108 //! \ingroup oglapi
1109 //! SUPPORTED OS:  Windows XP and higher
1110 //!
1111 NVAPI_INTERFACE NvAPI_OGL_ExpertModeSet(NvU32 expertDetailLevel,
1112                                         NvU32 expertReportMask,
1113                                         NvU32 expertOutputMask,
1114                      NVAPI_OGLEXPERT_CALLBACK expertCallback);
1115 
1116 //! \addtogroup oglapi
1117 //! SUPPORTED OS:  Windows XP and higher
1118 //!
1119 NVAPI_INTERFACE NvAPI_OGL_ExpertModeGet(NvU32 *pExpertDetailLevel,
1120                                         NvU32 *pExpertReportMask,
1121                                         NvU32 *pExpertOutputMask,
1122                      NVAPI_OGLEXPERT_CALLBACK *pExpertCallback);
1123 
1124 //@}
1125 ///////////////////////////////////////////////////////////////////////////////
1126 //
1127 //! \name NvAPI_OGL_ExpertModeDefaultsSet[Get] Functions
1128 //!
1129 //@{
1130 //!  This function configures OpenGL Expert Mode global defaults. These settings
1131 //!  apply to any OpenGL application which starts up after these
1132 //!  values are applied (i.e. these settings *do not* apply to
1133 //!  currently running applications).
1134 //!
1135 //! SUPPORTED OS:  Windows XP and higher
1136 //!
1137 //!
1138 //! \since Release: 80
1139 //!
1140 //! \param   expertDetailLevel Value which specifies the detail level in
1141 //!                            the feedback stream. This is a mask made up
1142 //!                            of NVAPI_OGLEXPERT_LEVEL bits.
1143 //!
1144 //! \param   expertReportMask  Mask made up of NVAPI_OGLEXPERT_REPORT bits,
1145 //!                            this parameter specifies the areas of
1146 //!                            functional interest.
1147 //!
1148 //! \param   expertOutputMask  Mask made up of NVAPI_OGLEXPERT_OUTPUT bits,
1149 //!                            this parameter specifies the feedback output
1150 //!                            location. Note that using OUTPUT_TO_CALLBACK
1151 //!                            here is meaningless and has no effect, but
1152 //!                            using it will not cause an error.
1153 //!
1154 //! \return  ::NVAPI_ERROR or ::NVAPI_OK
1155 //
1156 ///////////////////////////////////////////////////////////////////////////////
1157 
1158 //! \ingroup oglapi
1159 //! SUPPORTED OS:  Windows XP and higher
1160 //!
1161 NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsSet(NvU32 expertDetailLevel,
1162                                                 NvU32 expertReportMask,
1163                                                 NvU32 expertOutputMask);
1164 
1165 //! \addtogroup oglapi
1166 //! SUPPORTED OS:  Windows XP and higher
1167 //!
1168 NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsGet(NvU32 *pExpertDetailLevel,
1169                                                 NvU32 *pExpertReportMask,
1170                                                 NvU32 *pExpertOutputMask);
1171 //@}
1172 
1173 
1174 
1175 
1176 ///////////////////////////////////////////////////////////////////////////////
1177 //
1178 // FUNCTION NAME: NvAPI_EnumTCCPhysicalGPUs
1179 //
1180 //! This function returns an array of physical GPU handles that are in TCC Mode.
1181 //! Each handle represents a physical GPU present in the system in TCC Mode.
1182 //! That GPU may not be visible to the OS directly.
1183 //!
1184 //! The array nvGPUHandle will be filled with physical GPU handle values. The returned
1185 //! gpuCount determines how many entries in the array are valid.
1186 //!
1187 //! NOTE: Handles enumerated by this API are only valid for NvAPIs that are tagged as TCC_SUPPORTED
1188 //!       If handle is passed to any other API, it will fail with NVAPI_INVALID_HANDLE
1189 //!
1190 //!       For WDDM GPU handles please use NvAPI_EnumPhysicalGPUs()
1191 //!
1192 //! SUPPORTED OS:  Windows Vista and higher,  Mac OS X
1193 //!
1194 //!
1195 //!
1196 //! \param [out]   nvGPUHandle      Physical GPU array that will contain all TCC Physical GPUs
1197 //! \param [out]   pGpuCount        count represent the number of valid entries in nvGPUHandle
1198 //!
1199 //!
1200 //! \retval NVAPI_INVALID_ARGUMENT         nvGPUHandle or pGpuCount is NULL
1201 //! \retval NVAPI_OK                       One or more handles were returned
1202 //! \ingroup gpu
1203 ///////////////////////////////////////////////////////////////////////////////
1204 NVAPI_INTERFACE NvAPI_EnumTCCPhysicalGPUs( NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
1205 
1206 ///////////////////////////////////////////////////////////////////////////////
1207 //
1208 // FUNCTION NAME: NvAPI_EnumLogicalGPUs
1209 //
1210 //! This function returns an array of logical GPU handles.
1211 //!
1212 //! Each handle represents one or more GPUs acting in concert as a single graphics device.
1213 //!
1214 //! At least one GPU must be present in the system and running an NVIDIA display driver.
1215 //!
1216 //! The array nvGPUHandle will be filled with logical GPU handle values.  The returned
1217 //! gpuCount determines how many entries in the array are valid.
1218 //!
1219 //! \note All logical GPUs handles get invalidated on a GPU topology change, so the calling
1220 //!       application is required to renum the logical GPU handles to get latest physical handle
1221 //!       mapping after every GPU topology change activated by a call to NvAPI_SetGpuTopologies().
1222 //!
1223 //! To detect if SLI rendering is enabled, use NvAPI_D3D_GetCurrentSLIState().
1224 //!
1225 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
1226 //!
1227 //!
1228 //! \since Release: 80
1229 //!
1230 //! \retval NVAPI_INVALID_ARGUMENT         nvGPUHandle or pGpuCount is NULL
1231 //! \retval NVAPI_OK                       One or more handles were returned
1232 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
1233 //! \ingroup gpu
1234 ///////////////////////////////////////////////////////////////////////////////
1235 NVAPI_INTERFACE NvAPI_EnumLogicalGPUs(NvLogicalGpuHandle nvGPUHandle[NVAPI_MAX_LOGICAL_GPUS], NvU32 *pGpuCount);
1236 
1237 ///////////////////////////////////////////////////////////////////////////////
1238 //
1239 // FUNCTION NAME: NvAPI_GetPhysicalGPUsFromDisplay
1240 //
1241 //! This function returns an array of physical GPU handles associated with the specified display.
1242 //!
1243 //! At least one GPU must be present in the system and running an NVIDIA display driver.
1244 //!
1245 //! The array nvGPUHandle will be filled with physical GPU handle values.  The returned
1246 //! gpuCount determines how many entries in the array are valid.
1247 //!
1248 //! If the display corresponds to more than one physical GPU, the first GPU returned
1249 //! is the one with the attached active output.
1250 //!
1251 //! SUPPORTED OS:  Windows XP and higher
1252 //!
1253 //!
1254 //! \since Release: 80
1255 //!
1256 //! \retval NVAPI_INVALID_ARGUMENT         hNvDisp is not valid; nvGPUHandle or pGpuCount is NULL
1257 //! \retval NVAPI_OK                       One or more handles were returned
1258 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  no NVIDIA GPU driving a display was found
1259 //! \ingroup gpu
1260 ///////////////////////////////////////////////////////////////////////////////
1261 NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromDisplay(NvDisplayHandle hNvDisp, NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
1262 
1263 
1264 ///////////////////////////////////////////////////////////////////////////////
1265 //
1266 // FUNCTION NAME: NvAPI_GetPhysicalGPUFromUnAttachedDisplay
1267 //
1268 //! This function returns a physical GPU handle associated with the specified unattached display.
1269 //! The source GPU is a physical render GPU which renders the frame buffer but may or may not drive the scan out.
1270 //!
1271 //! At least one GPU must be present in the system and running an NVIDIA display driver.
1272 //!
1273 //! SUPPORTED OS:  Windows XP and higher
1274 //!
1275 //!
1276 //! \since Release: 80
1277 //!
1278 //! \retval NVAPI_INVALID_ARGUMENT         hNvUnAttachedDisp is not valid or pPhysicalGpu is NULL.
1279 //! \retval NVAPI_OK                       One or more handles were returned
1280 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
1281 //! \ingroup gpu
1282 ///////////////////////////////////////////////////////////////////////////////
1283 NVAPI_INTERFACE NvAPI_GetPhysicalGPUFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvPhysicalGpuHandle *pPhysicalGpu);
1284 
1285 
1286 
1287 ///////////////////////////////////////////////////////////////////////////////
1288 //
1289 // FUNCTION NAME: NvAPI_GetLogicalGPUFromDisplay
1290 //
1291 //! This function returns the logical GPU handle associated with the specified display.
1292 //! At least one GPU must be present in the system and running an NVIDIA display driver.
1293 //!
1294 //! SUPPORTED OS:  Windows XP and higher
1295 //!
1296 //!
1297 //! \since Release: 80
1298 //!
1299 //! \retval NVAPI_INVALID_ARGUMENT         hNvDisp is not valid; pLogicalGPU is NULL
1300 //! \retval NVAPI_OK                       One or more handles were returned
1301 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
1302 //! \ingroup gpu
1303 ///////////////////////////////////////////////////////////////////////////////
1304 NVAPI_INTERFACE NvAPI_GetLogicalGPUFromDisplay(NvDisplayHandle hNvDisp, NvLogicalGpuHandle *pLogicalGPU);
1305 
1306 
1307 ///////////////////////////////////////////////////////////////////////////////
1308 //
1309 // FUNCTION NAME: NvAPI_GetLogicalGPUFromPhysicalGPU
1310 //
1311 //! This function returns the logical GPU handle associated with specified physical GPU handle.
1312 //! At least one GPU must be present in the system and running an NVIDIA display driver.
1313 //!
1314 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
1315 //!
1316 //!
1317 //! \since Release: 80
1318 //!
1319 //! \retval NVAPI_INVALID_ARGUMENT         hPhysicalGPU is not valid; pLogicalGPU is NULL
1320 //! \retval NVAPI_OK                       One or more handles were returned
1321 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
1322 //! \ingroup gpu
1323 ///////////////////////////////////////////////////////////////////////////////
1324 NVAPI_INTERFACE NvAPI_GetLogicalGPUFromPhysicalGPU(NvPhysicalGpuHandle hPhysicalGPU, NvLogicalGpuHandle *pLogicalGPU);
1325 
1326 ///////////////////////////////////////////////////////////////////////////////
1327 //
1328 // FUNCTION NAME: NvAPI_GetPhysicalGPUsFromLogicalGPU
1329 //
1330 //!  This function returns the physical GPU handles associated with the specified logical GPU handle.
1331 //!  At least one GPU must be present in the system and running an NVIDIA display driver.
1332 //!
1333 //!  The array hPhysicalGPU will be filled with physical GPU handle values.  The returned
1334 //!  gpuCount determines how many entries in the array are valid.
1335 //!
1336 //! SUPPORTED OS:  Windows XP and higher
1337 //!
1338 //!
1339 //! \since Release: 80
1340 //!
1341 //! \retval NVAPI_INVALID_ARGUMENT             hLogicalGPU is not valid; hPhysicalGPU is NULL
1342 //! \retval NVAPI_OK                           One or more handles were returned
1343 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND      No NVIDIA GPU driving a display was found
1344 //! \retval NVAPI_EXPECTED_LOGICAL_GPU_HANDLE  hLogicalGPU was not a logical GPU handle
1345 //! \ingroup gpu
1346 ///////////////////////////////////////////////////////////////////////////////
1347 NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromLogicalGPU(NvLogicalGpuHandle hLogicalGPU,NvPhysicalGpuHandle hPhysicalGPU[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
1348 
1349 ///////////////////////////////////////////////////////////////////////////////
1350 //
1351 // FUNCTION NAME: NvAPI_GPU_GetGpuCoreCount
1352 //
1353 //!   DESCRIPTION: Retrieves the total number of cores defined for a GPU.
1354 //!                Returns 0 on architectures that don't define GPU cores.
1355 //!
1356 //! SUPPORTED OS:  Windows XP and higher
1357 //!
1358 //!
1359 //! TCC_SUPPORTED
1360 //!
1361 //! \retval ::NVAPI_INVALID_ARGUMENT              pCount is NULL
1362 //! \retval ::NVAPI_OK                            *pCount is set
1363 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND       no NVIDIA GPU driving a display was found
1364 //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
1365 //! \retval ::NVAPI_NOT_SUPPORTED                 API call is not supported on current architecture
1366 //!
1367 //! \ingroup gpu
1368 ///////////////////////////////////////////////////////////////////////////////
1369 NVAPI_INTERFACE NvAPI_GPU_GetGpuCoreCount(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pCount);
1370 
1371 
1372 ///////////////////////////////////////////////////////////////////////////////
1373 //
1374 // FUNCTION NAME: NvAPI_GPU_GetAllOutputs
1375 //
1376 //!  This function returns set of all GPU-output identifiers as a bitmask.
1377 //!
1378 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetAllDisplayIds.
1379 //! SUPPORTED OS:  Windows XP and higher
1380 //!
1381 //!
1382 //! \since Release: 85
1383 //!
1384 //! \retval   NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL.
1385 //! \retval   NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers.
1386 //! \retval   NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
1387 //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
1388 //! \ingroup gpu
1389 ///////////////////////////////////////////////////////////////////////////////
1390 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetAllDisplayIds.")
1391 NVAPI_INTERFACE NvAPI_GPU_GetAllOutputs(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pOutputsMask);
1392 
1393 
1394 
1395 ///////////////////////////////////////////////////////////////////////////////
1396 //
1397 // FUNCTION NAME: NvAPI_GPU_GetConnectedOutputs
1398 //
1399 //! This function is the same as NvAPI_GPU_GetAllOutputs() but returns only the set of GPU output
1400 //! identifiers that are connected to display devices.
1401 //!
1402 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
1403 //! SUPPORTED OS:  Windows XP and higher
1404 //!
1405 //!
1406 //! \since Release: 80
1407 //!
1408 //! \retval   NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL.
1409 //! \retval   NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers.
1410 //! \retval   NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
1411 //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
1412 //! \ingroup gpu
1413 ///////////////////////////////////////////////////////////////////////////////
1414 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
1415 NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
1416 
1417 
1418 ///////////////////////////////////////////////////////////////////////////////
1419 //
1420 // FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputs
1421 //
1422 //!   DESCRIPTION: This function is the same as NvAPI_GPU_GetConnectedOutputs() but returns only the set of GPU-output
1423 //!                identifiers that can be selected in an SLI configuration.
1424 //!                 NOTE: This function matches NvAPI_GPU_GetConnectedOutputs()
1425 //!                 - On systems which are not SLI capable.
1426 //!                 - If the queried GPU is not part of a valid SLI group.
1427 //!
1428 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
1429 //! SUPPORTED OS:  Windows XP and higher
1430 //!
1431 //!
1432 //! \since Release: 170
1433 //!
1434 //! \retval   NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL
1435 //! \retval   NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers
1436 //! \retval   NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
1437 //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
1438 //!
1439 //! \ingroup gpu
1440 ///////////////////////////////////////////////////////////////////////////////
1441 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
1442 NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
1443 
1444 
1445 
1446 
1447 //! \ingroup gpu
1448 typedef enum
1449 {
1450     NV_MONITOR_CONN_TYPE_UNINITIALIZED = 0,
1451     NV_MONITOR_CONN_TYPE_VGA,
1452     NV_MONITOR_CONN_TYPE_COMPONENT,
1453     NV_MONITOR_CONN_TYPE_SVIDEO,
1454     NV_MONITOR_CONN_TYPE_HDMI,
1455     NV_MONITOR_CONN_TYPE_DVI,
1456     NV_MONITOR_CONN_TYPE_LVDS,
1457     NV_MONITOR_CONN_TYPE_DP,
1458     NV_MONITOR_CONN_TYPE_COMPOSITE,
1459     NV_MONITOR_CONN_TYPE_UNKNOWN =  -1
1460 } NV_MONITOR_CONN_TYPE;
1461 
1462 
1463 
1464 //! \addtogroup gpu
1465 //! @{
1466 #define NV_GPU_CONNECTED_IDS_FLAG_UNCACHED          NV_BIT(0) //!< Get uncached connected devices
1467 #define NV_GPU_CONNECTED_IDS_FLAG_SLI               NV_BIT(1) //!< Get devices such that those can be selected in an SLI configuration
1468 #define NV_GPU_CONNECTED_IDS_FLAG_LIDSTATE          NV_BIT(2) //!< Get devices such that to reflect the Lid State
1469 #define NV_GPU_CONNECTED_IDS_FLAG_FAKE              NV_BIT(3) //!< Get devices that includes the fake connected monitors
1470 #define NV_GPU_CONNECTED_IDS_FLAG_EXCLUDE_MST       NV_BIT(4) //!< Excludes devices that are part of the multi stream topology.
1471 
1472 //! @}
1473 
1474 //! \ingroup gpu
1475 typedef struct _NV_GPU_DISPLAYIDS
1476 {
1477     NvU32    version;
1478     NV_MONITOR_CONN_TYPE connectorType; //!< out: vga, tv, dvi, hdmi and dp. This is reserved for future use and clients should not rely on this information. Instead get the
1479                                         //!< GPU connector type from NvAPI_GPU_GetConnectorInfo/NvAPI_GPU_GetConnectorInfoEx
1480     NvU32    displayId;                 //!< this is a unique identifier for each device
1481     NvU32    isDynamic:1;               //!< if bit is set then this display is part of MST topology and it's a dynamic
1482     NvU32    isMultiStreamRootNode:1;   //!< if bit is set then this displayID belongs to a multi stream enabled connector(root node). Note that when multi stream is enabled and
1483                                         //!< a single multi stream capable monitor is connected to it, the monitor will share the display id with the RootNode.
1484                                         //!< When there is more than one monitor connected in a multi stream topology, then the root node will have a separate displayId.
1485     NvU32    isActive:1;                //!< if bit is set then this display is being actively driven
1486     NvU32    isCluster:1;               //!< if bit is set then this display is the representative display
1487     NvU32    isOSVisible:1;             //!< if bit is set, then this display is reported to the OS
1488     NvU32    isWFD:1;                   //!< if bit is set, then this display is wireless
1489     NvU32    isConnected:1;             //!< if bit is set, then this display is connected
1490     NvU32    reserved: 23;              //!< must be zero
1491 } NV_GPU_DISPLAYIDS;
1492 
1493 //! \ingroup gpu
1494 //! Macro for constructing the version field of ::_NV_GPU_DISPLAYIDS
1495 #define NV_GPU_DISPLAYIDS_VER1          MAKE_NVAPI_VERSION(NV_GPU_DISPLAYIDS,1)
1496 
1497 #define NV_GPU_DISPLAYIDS_VER NV_GPU_DISPLAYIDS_VER1
1498 
1499 ///////////////////////////////////////////////////////////////////////////////
1500 //
1501 // FUNCTION NAME: NvAPI_GPU_GetConnectedDisplayIds
1502 //
1503 //! \code
1504 //!   DESCRIPTION: Due to space limitation NvAPI_GPU_GetConnectedOutputs can return maximum 32 devices, but
1505 //!                this is no longer true for DPMST. NvAPI_GPU_GetConnectedDisplayIds will return all
1506 //!                the connected display devices in the form of displayIds for the associated hPhysicalGpu.
1507 //!                This function can accept set of flags to request cached, uncached, sli and lid to get the connected devices.
1508 //!                Default value for flags will be cached .
1509 //! HOW TO USE: 1) for each PhysicalGpu, make a call to get the number of connected displayId's
1510 //!                using NvAPI_GPU_GetConnectedDisplayIds by passing the pDisplayIds as NULL
1511 //!                On call success:
1512 //!             2) Allocate memory based on pDisplayIdCount then make a call NvAPI_GPU_GetConnectedDisplayIds to populate DisplayIds
1513 //! SUPPORTED OS:  Windows XP and higher
1514 //!
1515 //! PARAMETERS:     hPhysicalGpu (IN)  - GPU selection
1516 //!                 flags        (IN)  - One or more defines from NV_GPU_CONNECTED_IDS_FLAG_* as valid flags.
1517 //!                 pDisplayIds  (IN/OUT) - Pointer to an NV_GPU_DISPLAYIDS struct, each entry represents a one displayID and its attributes
1518 //!                 pDisplayIdCount(OUT)- Number of displayId's.
1519 //!
1520 //! RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pDisplayIds or pDisplayIdCount is NULL
1521 //!                NVAPI_OK: *pDisplayIds contains a set of GPU-output identifiers
1522 //!                NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
1523 //!                NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
1524 //! \endcode
1525 //! \ingroup gpu
1526 ///////////////////////////////////////////////////////////////////////////////
1527 NVAPI_INTERFACE NvAPI_GPU_GetConnectedDisplayIds(__in NvPhysicalGpuHandle hPhysicalGpu,  __inout_ecount_part_opt(*pDisplayIdCount, *pDisplayIdCount) NV_GPU_DISPLAYIDS* pDisplayIds, __inout NvU32* pDisplayIdCount, __in NvU32 flags);
1528 
1529 
1530 ///////////////////////////////////////////////////////////////////////////////
1531 //
1532 // FUNCTION NAME: NvAPI_GPU_GetAllDisplayIds
1533 //
1534 //!   DESCRIPTION: This API returns display IDs for all possible outputs on the GPU.
1535 //!                For DPMST connector, it will return display IDs for all the video sinks in the topology. \n
1536 //! HOW TO USE: 1. The first call should be made to get the all display ID count. To get the display ID count, send in \n
1537 //!                  a) hPhysicalGpu    - a valid GPU handle(enumerated using NvAPI_EnumPhysicalGPUs()) as input,      \n
1538 //!                  b) pDisplayIds     - NULL, as we just want to get the display ID count.                           \n
1539 //!                  c) pDisplayIdCount - a valid pointer to NvU32, whose value is set to ZERO.                        \n
1540 //!                If all parameters are correct and this call is successful, this call will return the display ID's count. \n
1541 //!             2. To get the display ID array, make the second call to NvAPI_GPU_GetAllDisplayIds() with              \n
1542 //!                  a) hPhysicalGpu    - should be same value which was sent in first call,                           \n
1543 //!                  b) pDisplayIds     - pointer to the display ID array allocated by caller based on display ID count,    \n
1544 //!                                       eg. malloc(sizeof(NV_GPU_DISPLAYIDS) * pDisplayIdCount).                     \n
1545 //!                  c) pDisplayIdCount - a valid pointer to NvU32. This indicates for how many display IDs            \n
1546 //!                                       the memory is allocated(pDisplayIds) by the caller.                          \n
1547 //!                If all parameters are correct and this call is successful, this call will return the display ID array and actual
1548 //!                display ID count (which was obtained in the first call to NvAPI_GPU_GetAllDisplayIds). If the input display ID count is
1549 //!                less than the actual display ID count, it will overwrite the input and give the pDisplayIdCount as actual count and the
1550 //!                API will return NVAPI_INSUFFICIENT_BUFFER.
1551 //!
1552 //! SUPPORTED OS:  Windows XP and higher
1553 //!
1554 //!
1555 //! \param [in]     hPhysicalGpu         GPU selection.
1556 //! \param [in,out] DisplayIds           Pointer to an array of NV_GPU_DISPLAYIDS structures, each entry represents one displayID
1557 //!                                      and its attributes.
1558 //! \param [in,out] pDisplayIdCount      As input, this parameter indicates the number of display's id's for which caller has
1559 //!                                      allocated the memory. As output, it will return the actual number of display IDs.
1560 //!
1561 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
1562 //!          specific meaning for this API, they are listed below.
1563 //!
1564 //! \retval  NVAPI_INSUFFICIENT_BUFFER  When the input buffer(pDisplayIds) is less than the actual number of display IDs, this API
1565 //!                                     will return NVAPI_INSUFFICIENT_BUFFER.
1566 //!
1567 //! \ingroup gpu
1568 ///////////////////////////////////////////////////////////////////////////////
1569 NVAPI_INTERFACE NvAPI_GPU_GetAllDisplayIds(__in NvPhysicalGpuHandle hPhysicalGpu, __inout_ecount_part_opt(*pDisplayIdCount, *pDisplayIdCount) NV_GPU_DISPLAYIDS* pDisplayIds, __inout NvU32* pDisplayIdCount);
1570 
1571 
1572 
1573 
1574 ///////////////////////////////////////////////////////////////////////////////
1575 //
1576 // FUNCTION NAME: NvAPI_GPU_GetConnectedOutputsWithLidState
1577 //
1578 //!  This function is similar to NvAPI_GPU_GetConnectedOutputs(), and returns the connected display identifiers that are connected
1579 //!  as an output mask but unlike NvAPI_GPU_GetConnectedOutputs() this API "always" reflects the Lid State in the output mask.
1580 //!  Thus if you expect the LID close state to be available in the connection mask use this API.
1581 //!  - If LID is closed then this API will remove the LID panel from the connected display identifiers.
1582 //!  - If LID is open then this API will reflect the LID panel in the connected display identifiers.
1583 //!
1584 //! \note This API should be used on notebook systems and on systems where the LID state is required in the connection
1585 //!       output mask. On desktop systems the returned identifiers will match NvAPI_GPU_GetConnectedOutputs().
1586 //!
1587 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
1588 //! SUPPORTED OS:  Windows XP and higher
1589 //!
1590 //!
1591 //! \since Release: 95
1592 //!
1593 //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL
1594 //! \retval  NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers
1595 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
1596 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
1597 //! \ingroup gpu
1598 ///////////////////////////////////////////////////////////////////////////////
1599 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
1600 NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
1601 
1602 
1603 ///////////////////////////////////////////////////////////////////////////////
1604 //
1605 // FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputsWithLidState
1606 //
1607 //!   DESCRIPTION: This function is the same as NvAPI_GPU_GetConnectedOutputsWithLidState() but returns only the set
1608 //!                of GPU-output identifiers that can be selected in an SLI configuration. With SLI disabled,
1609 //!                this function matches NvAPI_GPU_GetConnectedOutputsWithLidState().
1610 //!
1611 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.
1612 //! SUPPORTED OS:  Windows XP and higher
1613 //!
1614 //!
1615 //! \since Release: 170
1616 //!
1617 //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL
1618 //! \retval  NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers
1619 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
1620 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
1621 //!
1622 //! \ingroup gpu
1623 ///////////////////////////////////////////////////////////////////////////////
1624 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_GPU_GetConnectedDisplayIds.")
1625 NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
1626 
1627 
1628 ///////////////////////////////////////////////////////////////////////////////
1629 //
1630 // FUNCTION NAME: NvAPI_GPU_GetSystemType
1631 //
1632 //! \fn NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType)
1633 //!  This function identifies whether the GPU is a notebook GPU or a desktop GPU.
1634 //!
1635 //! SUPPORTED OS:  Windows XP and higher
1636 //!
1637 //!
1638 //! \since Release: 95
1639 //!
1640 //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL
1641 //! \retval  NVAPI_OK                           *pSystemType contains the GPU system type
1642 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
1643 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
1644 //
1645 ///////////////////////////////////////////////////////////////////////////////
1646 
1647 //! \ingroup gpu
1648 //! Used in NvAPI_GPU_GetSystemType()
1649 typedef enum
1650 {
1651     NV_SYSTEM_TYPE_UNKNOWN = 0,
1652     NV_SYSTEM_TYPE_LAPTOP  = 1,
1653     NV_SYSTEM_TYPE_DESKTOP = 2,
1654 
1655 } NV_SYSTEM_TYPE;
1656 
1657 
1658 
1659 //! \ingroup gpu
1660 NVAPI_INTERFACE NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType);
1661 
1662 
1663 ///////////////////////////////////////////////////////////////////////////////
1664 //
1665 // FUNCTION NAME: NvAPI_GPU_GetActiveOutputs
1666 //
1667 //!  This function is the same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU output
1668 //!  identifiers that are actively driving display devices.
1669 //!
1670 //! SUPPORTED OS:  Windows XP and higher
1671 //!
1672 //!
1673 //! \since Release: 85
1674 //!
1675 //! \retval    NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pOutputsMask is NULL.
1676 //! \retval    NVAPI_OK                           *pOutputsMask contains a set of GPU-output identifiers.
1677 //! \retval    NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
1678 //! \retval    NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
1679 //! \ingroup gpu
1680 ///////////////////////////////////////////////////////////////////////////////
1681 NVAPI_INTERFACE NvAPI_GPU_GetActiveOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
1682 
1683 
1684 
1685 ///////////////////////////////////////////////////////////////////////////////
1686 //
1687 // FUNCTION NAME: NvAPI_GPU_SetEDID
1688 //
1689 //!  Thus function sets the EDID data for the specified GPU handle and connection bit mask.
1690 //!  displayOutputId should have exactly 1 bit set to indicate a single display. See \ref handles.
1691 //!  \note The EDID will be cached across the boot session and will be enumerated to the OS in this call.
1692 //!        To remove the EDID set sizeofEDID to zero.
1693 //!        OS and NVAPI connection status APIs will reflect the newly set or removed EDID dynamically.
1694 //!
1695 //!                This feature will NOT be supported on the following boards:
1696 //!                - GeForce
1697 //!                - Quadro VX
1698 //!                - Tesla
1699 //!
1700 //! SUPPORTED OS:  Windows XP and higher
1701 //!
1702 //!
1703 //! \since Release: 100
1704 //!
1705 //! \retval  NVAPI_INVALID_ARGUMENT              pEDID is NULL; displayOutputId has 0 or > 1 bits set
1706 //! \retval  NVAPI_OK                           *pEDID data was applied to the requested displayOutputId.
1707 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
1708 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle.
1709 //! \retval  NVAPI_NOT_SUPPORTED                 For the above mentioned GPUs
1710 //! \ingroup gpu
1711 ///////////////////////////////////////////////////////////////////////////////
1712 NVAPI_INTERFACE NvAPI_GPU_SetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID);
1713 
1714 
1715 ///////////////////////////////////////////////////////////////////////////////
1716 //
1717 // FUNCTION NAME: NvAPI_GPU_GetOutputType
1718 //
1719 //! \fn NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType)
1720 //!  This function returns the output type for a specific physical GPU handle and outputId (exactly 1 bit set - see \ref handles).
1721 //!
1722 //! SUPPORTED OS:  Windows XP and higher
1723 //!
1724 //!
1725 //! \Version Earliest supported ForceWare version: 82.61
1726 //!
1727 //! \retval     NVAPI_INVALID_ARGUMENT              hPhysicalGpu, outputId, or pOutputsMask is NULL; or outputId has > 1 bit set
1728 //! \retval     NVAPI_OK                           *pOutputType contains a NvGpuOutputType value
1729 //! \retval     NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
1730 //! \retval     NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
1731 //
1732 ///////////////////////////////////////////////////////////////////////////////
1733 
1734 //! \ingroup gpu
1735 //! used in NvAPI_GPU_GetOutputType()
1736 typedef enum _NV_GPU_OUTPUT_TYPE
1737 {
1738     NVAPI_GPU_OUTPUT_UNKNOWN  = 0,
1739     NVAPI_GPU_OUTPUT_CRT      = 1,     //!<  CRT display device
1740     NVAPI_GPU_OUTPUT_DFP      = 2,     //!<  Digital Flat Panel display device
1741     NVAPI_GPU_OUTPUT_TV       = 3,     //!<  TV display device
1742 } NV_GPU_OUTPUT_TYPE;
1743 
1744 
1745 
1746 
1747 //! \ingroup gpu
1748 NVAPI_INTERFACE NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType);
1749 
1750 
1751 ///////////////////////////////////////////////////////////////////////////////
1752 //
1753 // FUNCTION NAME: NvAPI_GPU_ValidateOutputCombination
1754 //
1755 //!  This function determines if a set of GPU outputs can be active
1756 //!  simultaneously.  While a GPU may have <n> outputs, typically they cannot
1757 //!  all be active at the same time due to internal resource sharing.
1758 //!
1759 //!  Given a physical GPU handle and a mask of candidate outputs, this call
1760 //!  will return NVAPI_OK if all of the specified outputs can be driven
1761 //!  simultaneously.  It will return NVAPI_INVALID_COMBINATION if they cannot.
1762 //!
1763 //!  Use NvAPI_GPU_GetAllOutputs() to determine which outputs are candidates.
1764 //!
1765 //! SUPPORTED OS:  Windows XP and higher
1766 //!
1767 //!
1768 //! \since Release: 85
1769 //!
1770 //! \retval  NVAPI_OK                            Combination of outputs in outputsMask are valid (can be active simultaneously).
1771 //! \retval  NVAPI_INVALID_COMBINATION           Combination of outputs in outputsMask are NOT valid.
1772 //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or outputsMask does not have at least 2 bits set.
1773 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
1774 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
1775 //! \ingroup gpu
1776 ///////////////////////////////////////////////////////////////////////////////
1777 NVAPI_INTERFACE NvAPI_GPU_ValidateOutputCombination(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputsMask);
1778 
1779 
1780 
1781 
1782 ///////////////////////////////////////////////////////////////////////////////
1783 //
1784 // FUNCTION NAME: NvAPI_GPU_GetFullName
1785 //
1786 //!  This function retrieves the full GPU name as an ASCII string - for example, "Quadro FX 1400".
1787 //!
1788 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
1789 //!
1790 //!
1791 //! TCC_SUPPORTED
1792 //!
1793 //! \since Release: 90
1794 //!
1795 //! \return  NVAPI_ERROR or NVAPI_OK
1796 //! \ingroup gpu
1797 ///////////////////////////////////////////////////////////////////////////////
1798 NVAPI_INTERFACE NvAPI_GPU_GetFullName(NvPhysicalGpuHandle hPhysicalGpu, NvAPI_ShortString szName);
1799 
1800 ///////////////////////////////////////////////////////////////////////////////
1801 //
1802 // FUNCTION NAME: NvAPI_GPU_GetPCIIdentifiers
1803 //
1804 //!  This function returns the PCI identifiers associated with this GPU.
1805 //!
1806 //! SUPPORTED OS:  Windows XP and higher
1807 //!
1808 //!
1809 //! TCC_SUPPORTED
1810 //!
1811 //! \since Release: 90
1812 //!
1813 //! \param   DeviceId      The internal PCI device identifier for the GPU.
1814 //! \param   SubSystemId   The internal PCI subsystem identifier for the GPU.
1815 //! \param   RevisionId    The internal PCI device-specific revision identifier for the GPU.
1816 //! \param   ExtDeviceId   The external PCI device identifier for the GPU.
1817 //!
1818 //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or an argument is NULL
1819 //! \retval  NVAPI_OK                            Arguments are populated with PCI identifiers
1820 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
1821 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
1822 //! \ingroup gpu
1823 ///////////////////////////////////////////////////////////////////////////////
1824 NVAPI_INTERFACE NvAPI_GPU_GetPCIIdentifiers(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pDeviceId,NvU32 *pSubSystemId,NvU32 *pRevisionId,NvU32 *pExtDeviceId);
1825 
1826 
1827 
1828 
1829 //! \ingroup gpu
1830 //! Used in NvAPI_GPU_GetGPUType().
1831 typedef enum _NV_GPU_TYPE
1832 {
1833     NV_SYSTEM_TYPE_GPU_UNKNOWN     = 0,
1834     NV_SYSTEM_TYPE_IGPU            = 1, //!< Integrated GPU
1835     NV_SYSTEM_TYPE_DGPU            = 2, //!< Discrete GPU
1836 } NV_GPU_TYPE;
1837 
1838 
1839 ///////////////////////////////////////////////////////////////////////////////
1840 //
1841 // FUNCTION NAME: NvAPI_GPU_GetGPUType
1842 //
1843 //!  DESCRIPTION: This function returns the GPU type (integrated or discrete).
1844 //!               See ::NV_GPU_TYPE.
1845 //!
1846 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
1847 //!
1848 //!
1849 //! TCC_SUPPORTED
1850 //!
1851 //! \since Release: 173
1852 //!
1853 //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu
1854 //! \retval  NVAPI_OK                           *pGpuType contains the GPU type
1855 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
1856 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
1857 //!
1858 //!  \ingroup gpu
1859 ///////////////////////////////////////////////////////////////////////////////
1860 NVAPI_INTERFACE NvAPI_GPU_GetGPUType(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_TYPE *pGpuType);
1861 
1862 
1863 
1864 
1865 //! \ingroup gpu
1866 //! Used in NvAPI_GPU_GetBusType()
1867 typedef enum _NV_GPU_BUS_TYPE
1868 {
1869     NVAPI_GPU_BUS_TYPE_UNDEFINED    = 0,
1870     NVAPI_GPU_BUS_TYPE_PCI          = 1,
1871     NVAPI_GPU_BUS_TYPE_AGP          = 2,
1872     NVAPI_GPU_BUS_TYPE_PCI_EXPRESS  = 3,
1873     NVAPI_GPU_BUS_TYPE_FPCI         = 4,
1874     NVAPI_GPU_BUS_TYPE_AXI          = 5,
1875 } NV_GPU_BUS_TYPE;
1876 ///////////////////////////////////////////////////////////////////////////////
1877 //
1878 // FUNCTION NAME: NvAPI_GPU_GetBusType
1879 //
1880 //!  This function returns the type of bus associated with this GPU.
1881 //!
1882 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
1883 //!
1884 //!
1885 //! TCC_SUPPORTED
1886 //!
1887 //! \since Release: 90
1888 //!
1889 //! \return      This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
1890 //!              specific meaning for this API, they are listed below.
1891 //! \retval      NVAPI_INVALID_ARGUMENT             hPhysicalGpu or pBusType is NULL.
1892 //! \retval      NVAPI_OK                          *pBusType contains bus identifier.
1893 //! \ingroup gpu
1894 ///////////////////////////////////////////////////////////////////////////////
1895 NVAPI_INTERFACE NvAPI_GPU_GetBusType(NvPhysicalGpuHandle hPhysicalGpu,NV_GPU_BUS_TYPE *pBusType);
1896 
1897 
1898 ///////////////////////////////////////////////////////////////////////////////
1899 //
1900 // FUNCTION NAME: NvAPI_GPU_GetBusId
1901 //
1902 //!   DESCRIPTION: Returns the ID of the bus associated with this GPU.
1903 //!
1904 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
1905 //!
1906 //!
1907 //! TCC_SUPPORTED
1908 //!
1909 //! \since Release: 167
1910 //!
1911 //!  \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pBusId is NULL.
1912 //!  \retval  NVAPI_OK                           *pBusId contains the bus ID.
1913 //!  \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
1914 //!  \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
1915 //!
1916 //!  \ingroup gpu
1917 ///////////////////////////////////////////////////////////////////////////////
1918 NVAPI_INTERFACE NvAPI_GPU_GetBusId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId);
1919 
1920 ///////////////////////////////////////////////////////////////////////////////
1921 //
1922 // FUNCTION NAME: NvAPI_GPU_GetBusSlotId
1923 //
1924 //!   DESCRIPTION: Returns the ID of the bus slot associated with this GPU.
1925 //!
1926 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
1927 //!
1928 //!
1929 //! TCC_SUPPORTED
1930 //!
1931 //! \since Release: 167
1932 //!
1933 //!  \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pBusSlotId is NULL.
1934 //!  \retval  NVAPI_OK                           *pBusSlotId contains the bus slot ID.
1935 //!  \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
1936 //!  \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
1937 //!
1938 //!  \ingroup gpu
1939 ///////////////////////////////////////////////////////////////////////////////
1940 NVAPI_INTERFACE NvAPI_GPU_GetBusSlotId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId);
1941 
1942 
1943 
1944 ///////////////////////////////////////////////////////////////////////////////
1945 //
1946 // FUNCTION NAME: NvAPI_GPU_GetIRQ
1947 //
1948 //!  This function returns the interrupt number associated with this GPU.
1949 //!
1950 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
1951 //!
1952 //!
1953 //! TCC_SUPPORTED
1954 //!
1955 //! \since Release: 90
1956 //!
1957 //! \retval  NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pIRQ is NULL.
1958 //! \retval  NVAPI_OK                           *pIRQ contains interrupt number.
1959 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
1960 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
1961 //! \ingroup gpu
1962 ///////////////////////////////////////////////////////////////////////////////
1963 NVAPI_INTERFACE NvAPI_GPU_GetIRQ(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pIRQ);
1964 
1965 ///////////////////////////////////////////////////////////////////////////////
1966 //
1967 // FUNCTION NAME: NvAPI_GPU_GetVbiosRevision
1968 //
1969 //!  This function returns the revision of the video BIOS associated with this GPU.
1970 //!
1971 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
1972 //!
1973 //!
1974 //! TCC_SUPPORTED
1975 //!
1976 //! \since Release: 90
1977 //!
1978 //! \retval    NVAPI_INVALID_ARGUMENT               hPhysicalGpu or pBiosRevision is NULL.
1979 //! \retval    NVAPI_OK                            *pBiosRevision contains revision number.
1980 //! \retval    NVAPI_NVIDIA_DEVICE_NOT_FOUND        No NVIDIA GPU driving a display was found.
1981 //! \retval    NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE   hPhysicalGpu was not a physical GPU handle.
1982 //! \ingroup   gpu
1983 ///////////////////////////////////////////////////////////////////////////////
1984 NVAPI_INTERFACE NvAPI_GPU_GetVbiosRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pBiosRevision);
1985 
1986 ///////////////////////////////////////////////////////////////////////////////
1987 //
1988 // FUNCTION NAME: NvAPI_GPU_GetVbiosOEMRevision
1989 //
1990 //!  This function returns the OEM revision of the video BIOS associated with this GPU.
1991 //!
1992 //! SUPPORTED OS:  Windows XP and higher
1993 //!
1994 //!
1995 //! \since Release: 90
1996 //!
1997 //! \retval    NVAPI_INVALID_ARGUMENT              hPhysicalGpu or pBiosRevision is NULL
1998 //! \retval    NVAPI_OK                           *pBiosRevision contains revision number
1999 //! \retval    NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
2000 //! \retval    NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
2001 //! \ingroup   gpu
2002 ///////////////////////////////////////////////////////////////////////////////
2003 NVAPI_INTERFACE NvAPI_GPU_GetVbiosOEMRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pBiosRevision);
2004 
2005 ///////////////////////////////////////////////////////////////////////////////
2006 //
2007 // FUNCTION NAME: NvAPI_GPU_GetVbiosVersionString
2008 //
2009 //!  This function returns the full video BIOS version string in the form of xx.xx.xx.xx.yy where
2010 //!  - xx numbers come from NvAPI_GPU_GetVbiosRevision() and
2011 //!  - yy comes from NvAPI_GPU_GetVbiosOEMRevision().
2012 //!
2013 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
2014 //!
2015 //!
2016 //! TCC_SUPPORTED
2017 //!
2018 //! \since Release: 90
2019 //!
2020 //! \retval   NVAPI_INVALID_ARGUMENT              hPhysicalGpu is NULL.
2021 //! \retval   NVAPI_OK                            szBiosRevision contains version string.
2022 //! \retval   NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
2023 //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
2024 //! \ingroup gpu
2025 ///////////////////////////////////////////////////////////////////////////////
2026 NVAPI_INTERFACE NvAPI_GPU_GetVbiosVersionString(NvPhysicalGpuHandle hPhysicalGpu,NvAPI_ShortString szBiosRevision);
2027 
2028 
2029 ///////////////////////////////////////////////////////////////////////////////
2030 //
2031 // FUNCTION NAME: NvAPI_GPU_GetAGPAperture
2032 //
2033 //!  This function returns the AGP aperture in megabytes.
2034 //!
2035 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
2036 //!
2037 //!
2038 //! \since Release: 90
2039 //!
2040 //! \retval   NVAPI_INVALID_ARGUMENT              pSize is NULL.
2041 //! \retval   NVAPI_OK                            Call successful.
2042 //! \retval   NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
2043 //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
2044 //! \ingroup gpu
2045 ///////////////////////////////////////////////////////////////////////////////
2046 NVAPI_INTERFACE NvAPI_GPU_GetAGPAperture(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize);
2047 
2048 ///////////////////////////////////////////////////////////////////////////////
2049 //
2050 // FUNCTION NAME: NvAPI_GPU_GetCurrentAGPRate
2051 //
2052 //!  This function returns the current AGP Rate (0 = AGP not present, 1 = 1x, 2 = 2x, etc.).
2053 //!
2054 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
2055 //!
2056 //!
2057 //! \since Release: 90
2058 //!
2059 //! \retval   NVAPI_INVALID_ARGUMENT              pRate is NULL.
2060 //! \retval   NVAPI_OK                            Call successful.
2061 //! \retval   NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
2062 //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
2063 //! \ingroup gpu
2064 ///////////////////////////////////////////////////////////////////////////////
2065 NVAPI_INTERFACE NvAPI_GPU_GetCurrentAGPRate(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pRate);
2066 
2067 ///////////////////////////////////////////////////////////////////////////////
2068 //
2069 // FUNCTION NAME: NvAPI_GPU_GetCurrentPCIEDownstreamWidth
2070 //
2071 //!  This function returns the number of PCIE lanes being used for the PCIE interface
2072 //!  downstream from the GPU.
2073 //!
2074 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
2075 //!
2076 //!
2077 //! \since Release: 90
2078 //!
2079 //! \retval  NVAPI_INVALID_ARGUMENT              pWidth is NULL.
2080 //! \retval  NVAPI_OK                            Call successful.
2081 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
2082 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
2083 //! \ingroup gpu
2084 ///////////////////////////////////////////////////////////////////////////////
2085 NVAPI_INTERFACE NvAPI_GPU_GetCurrentPCIEDownstreamWidth(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pWidth);
2086 
2087 
2088 
2089 ///////////////////////////////////////////////////////////////////////////////
2090 //
2091 // FUNCTION NAME: NvAPI_GPU_GetPhysicalFrameBufferSize
2092 //
2093 //!   This function returns the physical size of framebuffer in KB.  This does NOT include any
2094 //!   system RAM that may be dedicated for use by the GPU.
2095 //!
2096 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
2097 //!
2098 //!
2099 //! TCC_SUPPORTED
2100 //!
2101 //! \since Release: 90
2102 //!
2103 //! \retval  NVAPI_INVALID_ARGUMENT              pSize is NULL
2104 //! \retval  NVAPI_OK                            Call successful
2105 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found
2106 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle
2107 //! \ingroup gpu
2108 ///////////////////////////////////////////////////////////////////////////////
2109 NVAPI_INTERFACE NvAPI_GPU_GetPhysicalFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize);
2110 
2111 ///////////////////////////////////////////////////////////////////////////////
2112 //
2113 // FUNCTION NAME: NvAPI_GPU_GetVirtualFrameBufferSize
2114 //
2115 //!  This function returns the virtual size of framebuffer in KB.  This includes the physical RAM plus any
2116 //!  system RAM that has been dedicated for use by the GPU.
2117 //!
2118 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
2119 //!
2120 //!
2121 //! TCC_SUPPORTED
2122 //!
2123 //! \since Release: 90
2124 //!
2125 //! \retval  NVAPI_INVALID_ARGUMENT              pSize is NULL.
2126 //! \retval  NVAPI_OK                            Call successful.
2127 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND       No NVIDIA GPU driving a display was found.
2128 //! \retval  NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu was not a physical GPU handle.
2129 //! \ingroup gpu
2130 ///////////////////////////////////////////////////////////////////////////////
2131 NVAPI_INTERFACE NvAPI_GPU_GetVirtualFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize);
2132 
2133 
2134 
2135 
2136 
2137 //! \ingroup gpu
2138 typedef struct _NV_BOARD_INFO
2139 {
2140     NvU32 version;                   //!< structure version
2141     NvU8 BoardNum[16];               //!< Board Serial Number
2142 
2143 }NV_BOARD_INFO_V1;
2144 
2145 //! \ingroup gpu
2146 typedef NV_BOARD_INFO_V1    NV_BOARD_INFO;
2147 //! \ingroup gpu
2148 #define NV_BOARD_INFO_VER1  MAKE_NVAPI_VERSION(NV_BOARD_INFO_V1,1)
2149 //! \ingroup gpu
2150 #define NV_BOARD_INFO_VER   NV_BOARD_INFO_VER1
2151 
2152 //! SUPPORTED OS:  Windows XP and higher
2153 //!
2154 ///////////////////////////////////////////////////////////////////////////////
2155 //
2156 // FUNCTION NAME: NvAPI_GPU_GetBoardInfo
2157 //
2158 //!   DESCRIPTION: This API Retrieves the Board information (a unique GPU Board Serial Number) stored in the InfoROM.
2159 //!
2160 //! \param [in]      hPhysicalGpu       Physical GPU Handle.
2161 //! \param [in,out]  NV_BOARD_INFO      Board Information.
2162 //!
2163 //! TCC_SUPPORTED
2164 //!
2165 //! \retval ::NVAPI_OK                     completed request
2166 //! \retval ::NVAPI_ERROR                  miscellaneous error occurred
2167 //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  handle passed is not a physical GPU handle
2168 //! \retval ::NVAPI_API_NOT_INTIALIZED            NVAPI not initialized
2169 //! \retval ::NVAPI_INVALID_POINTER               pBoardInfo is NULL
2170 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION   the version of the INFO struct is not supported
2171 //!
2172 //! \ingroup gpu
2173 ///////////////////////////////////////////////////////////////////////////////
2174 NVAPI_INTERFACE NvAPI_GPU_GetBoardInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_BOARD_INFO *pBoardInfo);
2175 
2176 
2177 
2178 
2179 ///////////////////////////////////////////////////////////////////////////////
2180 //
2181 //  GPU Clock Control
2182 //
2183 //  These APIs allow the user to get and set individual clock domains
2184 //  on a per-GPU basis.
2185 //
2186 ///////////////////////////////////////////////////////////////////////////////
2187 
2188 
2189 //! \ingroup gpuclock
2190 //! @{
2191 #define NVAPI_MAX_GPU_CLOCKS 32
2192 #define NVAPI_MAX_GPU_PUBLIC_CLOCKS     32
2193 #define NVAPI_MAX_GPU_PERF_CLOCKS       32
2194 #define NVAPI_MAX_GPU_PERF_VOLTAGES     16
2195 #define NVAPI_MAX_GPU_PERF_PSTATES      16
2196 //! @}
2197 
2198 //! \ingroup gpuclock
2199 typedef enum _NV_GPU_PUBLIC_CLOCK_ID
2200 {
2201     NVAPI_GPU_PUBLIC_CLOCK_GRAPHICS  = 0,
2202     NVAPI_GPU_PUBLIC_CLOCK_MEMORY    = 4,
2203     NVAPI_GPU_PUBLIC_CLOCK_PROCESSOR = 7,
2204     NVAPI_GPU_PUBLIC_CLOCK_UNDEFINED = NVAPI_MAX_GPU_PUBLIC_CLOCKS,
2205 } NV_GPU_PUBLIC_CLOCK_ID;
2206 
2207 
2208 //! \ingroup gpuclock
2209 typedef enum _NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID
2210 {
2211     NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_CORE      = 0,
2212     NVAPI_GPU_PERF_VOLTAGE_INFO_DOMAIN_UNDEFINED = NVAPI_MAX_GPU_PERF_VOLTAGES,
2213 } NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID;
2214 
2215 
2216 
2217 //! \ingroup gpuclock
2218 //! Used in NvAPI_GPU_GetAllClockFrequencies()
2219 typedef struct
2220 {
2221     NvU32   version;    //!< Structure version
2222     NvU32   reserved;   //!< These bits are reserved for future use.
2223     struct
2224     {
2225         NvU32 bIsPresent:1;         //!< Set if this domain is present on this GPU
2226         NvU32 reserved:31;          //!< These bits are reserved for future use.
2227         NvU32 frequency;            //!< Clock frequency (kHz)
2228     }domain[NVAPI_MAX_GPU_PUBLIC_CLOCKS];
2229 } NV_GPU_CLOCK_FREQUENCIES_V1;
2230 
2231 //! \ingroup gpuclock
2232 //! Used in NvAPI_GPU_GetAllClockFrequencies()
2233 typedef enum
2234 {
2235     NV_GPU_CLOCK_FREQUENCIES_CURRENT_FREQ =   0,
2236     NV_GPU_CLOCK_FREQUENCIES_BASE_CLOCK   =   1,
2237     NV_GPU_CLOCK_FREQUENCIES_BOOST_CLOCK  =   2,
2238     NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE_NUM = 3
2239 }   NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE;
2240 
2241 //! \ingroup gpuclock
2242 //! Used in NvAPI_GPU_GetAllClockFrequencies()
2243 typedef struct
2244 {
2245     NvU32   version;        //!< Structure version
2246     NvU32   ClockType:2;    //!< One of NV_GPU_CLOCK_FREQUENCIES_CLOCK_TYPE. Used to specify the type of clock to be returned.
2247     NvU32   reserved:22;    //!< These bits are reserved for future use. Must be set to 0.
2248     NvU32   reserved1:8;    //!< These bits are reserved.
2249     struct
2250     {
2251         NvU32 bIsPresent:1;         //!< Set if this domain is present on this GPU
2252         NvU32 reserved:31;          //!< These bits are reserved for future use.
2253         NvU32 frequency;            //!< Clock frequency (kHz)
2254     }domain[NVAPI_MAX_GPU_PUBLIC_CLOCKS];
2255 } NV_GPU_CLOCK_FREQUENCIES_V2;
2256 
2257 //! \ingroup gpuclock
2258 //! Used in NvAPI_GPU_GetAllClockFrequencies()
2259 typedef NV_GPU_CLOCK_FREQUENCIES_V2 NV_GPU_CLOCK_FREQUENCIES;
2260 
2261 //! \addtogroup gpuclock
2262 //! @{
2263 #define NV_GPU_CLOCK_FREQUENCIES_VER_1    MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V1,1)
2264 #define NV_GPU_CLOCK_FREQUENCIES_VER_2    MAKE_NVAPI_VERSION(NV_GPU_CLOCK_FREQUENCIES_V2,2)
2265 #define NV_GPU_CLOCK_FREQUENCIES_VER	  NV_GPU_CLOCK_FREQUENCIES_VER_2
2266 //! @}
2267 
2268 ///////////////////////////////////////////////////////////////////////////////
2269 //
2270 // FUNCTION NAME: NvAPI_GPU_GetAllClockFrequencies
2271 //
2272 //!   This function retrieves the NV_GPU_CLOCK_FREQUENCIES structure for the specified physical GPU.
2273 //!
2274 //!   For each clock domain:
2275 //!      - bIsPresent is set for each domain that is present on the GPU
2276 //!      - frequency is the domain's clock freq in kHz
2277 //!
2278 //!   Each domain's info is indexed in the array.  For example:
2279 //!   clkFreqs.domain[NVAPI_GPU_PUBLIC_CLOCK_MEMORY] holds the info for the MEMORY domain.
2280 //!
2281 //! SUPPORTED OS:  Windows XP and higher
2282 //!
2283 //!
2284 //! \since Release: 295
2285 //!
2286 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
2287 //!          If there are return error codes with specific meaning for this API,
2288 //!          they are listed below.
2289 //! \retval  NVAPI_INVALID_ARGUMENT     pClkFreqs is NULL.
2290 //! \ingroup gpuclock
2291 ///////////////////////////////////////////////////////////////////////////////
2292 NVAPI_INTERFACE NvAPI_GPU_GetAllClockFrequencies(__in NvPhysicalGpuHandle hPhysicalGPU, __inout NV_GPU_CLOCK_FREQUENCIES *pClkFreqs);
2293 
2294 
2295 //! \addtogroup gpupstate
2296 //! @{
2297 
2298 typedef enum _NV_GPU_PERF_PSTATE_ID
2299 {
2300     NVAPI_GPU_PERF_PSTATE_P0 = 0,
2301     NVAPI_GPU_PERF_PSTATE_P1,
2302     NVAPI_GPU_PERF_PSTATE_P2,
2303     NVAPI_GPU_PERF_PSTATE_P3,
2304     NVAPI_GPU_PERF_PSTATE_P4,
2305     NVAPI_GPU_PERF_PSTATE_P5,
2306     NVAPI_GPU_PERF_PSTATE_P6,
2307     NVAPI_GPU_PERF_PSTATE_P7,
2308     NVAPI_GPU_PERF_PSTATE_P8,
2309     NVAPI_GPU_PERF_PSTATE_P9,
2310     NVAPI_GPU_PERF_PSTATE_P10,
2311     NVAPI_GPU_PERF_PSTATE_P11,
2312     NVAPI_GPU_PERF_PSTATE_P12,
2313     NVAPI_GPU_PERF_PSTATE_P13,
2314     NVAPI_GPU_PERF_PSTATE_P14,
2315     NVAPI_GPU_PERF_PSTATE_P15,
2316     NVAPI_GPU_PERF_PSTATE_UNDEFINED = NVAPI_MAX_GPU_PERF_PSTATES,
2317     NVAPI_GPU_PERF_PSTATE_ALL,
2318 
2319 } NV_GPU_PERF_PSTATE_ID;
2320 
2321 //! @}
2322 
2323 
2324 
2325 //! \ingroup gpupstate
2326 //! Used in NvAPI_GPU_GetPstatesInfoEx()
2327 typedef struct
2328 {
2329     NvU32   version;
2330     NvU32   flags;           //!< - bit 0 indicates if perfmon is enabled or not
2331                              //!< - bit 1 indicates if dynamic Pstate is capable or not
2332                              //!< - bit 2 indicates if dynamic Pstate is enable or not
2333                              //!< - all other bits must be set to 0
2334     NvU32   numPstates;      //!< The number of available p-states
2335     NvU32   numClocks;       //!< The number of clock domains supported by each P-State
2336     struct
2337     {
2338         NV_GPU_PERF_PSTATE_ID   pstateId; //!< ID of the p-state.
2339         NvU32                   flags;    //!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2
2340                                           //!< - bit 1 indicates if the Pstate is overclocked or not
2341                                           //!< - bit 2 indicates if the Pstate is overclockable or not
2342                                           //!< - all other bits must be set to 0
2343         struct
2344         {
2345             NV_GPU_PUBLIC_CLOCK_ID           domainId;  //!< ID of the clock domain
2346             NvU32                               flags;  //!< Reserved. Must be set to 0
2347             NvU32                                freq;  //!< Clock frequency in kHz
2348 
2349         } clocks[NVAPI_MAX_GPU_PERF_CLOCKS];
2350     } pstates[NVAPI_MAX_GPU_PERF_PSTATES];
2351 
2352 } NV_GPU_PERF_PSTATES_INFO_V1;
2353 
2354 
2355 //! \ingroup gpupstate
2356 typedef struct
2357 {
2358     NvU32   version;
2359     NvU32   flags;             //!< - bit 0 indicates if perfmon is enabled or not
2360                                //!< - bit 1 indicates if dynamic Pstate is capable or not
2361                                //!< - bit 2 indicates if dynamic Pstate is enable or not
2362                                //!< - all other bits must be set to 0
2363     NvU32   numPstates;        //!< The number of available p-states
2364     NvU32   numClocks;         //!< The number of clock domains supported by each P-State
2365     NvU32   numVoltages;
2366     struct
2367     {
2368         NV_GPU_PERF_PSTATE_ID   pstateId;  //!< ID of the p-state.
2369         NvU32                   flags;     //!< - bit 0 indicates if the PCIE limit is GEN1 or GEN2
2370                                            //!< - bit 1 indicates if the Pstate is overclocked or not
2371                                            //!< - bit 2 indicates if the Pstate is overclockable or not
2372                                            //!< - all other bits must be set to 0
2373         struct
2374         {
2375             NV_GPU_PUBLIC_CLOCK_ID            domainId;
2376             NvU32                                flags; //!< bit 0 indicates if this clock is overclockable
2377                                                         //!< all other bits must be set to 0
2378             NvU32                                 freq;
2379 
2380         } clocks[NVAPI_MAX_GPU_PERF_CLOCKS];
2381         struct
2382         {
2383             NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID domainId; //!< ID of the voltage domain, containing flags and mvolt info
2384             NvU32                       flags;           //!< Reserved for future use. Must be set to 0
2385             NvU32                       mvolt;           //!< Voltage in mV
2386 
2387         } voltages[NVAPI_MAX_GPU_PERF_VOLTAGES];
2388 
2389     } pstates[NVAPI_MAX_GPU_PERF_PSTATES];  //!< Valid index range is 0 to numVoltages-1
2390 
2391 } NV_GPU_PERF_PSTATES_INFO_V2;
2392 
2393 //! \ingroup gpupstate
2394 typedef  NV_GPU_PERF_PSTATES_INFO_V2 NV_GPU_PERF_PSTATES_INFO;
2395 
2396 
2397 //! \ingroup gpupstate
2398 //! @{
2399 
2400 //! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V1
2401 #define NV_GPU_PERF_PSTATES_INFO_VER1  MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V1,1)
2402 
2403 //! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO_V2
2404 #define NV_GPU_PERF_PSTATES_INFO_VER2  MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES_INFO_V2,2)
2405 
2406 //! Macro for constructing the version field of NV_GPU_PERF_PSTATES_INFO
2407 #define NV_GPU_PERF_PSTATES_INFO_VER   NV_GPU_PERF_PSTATES_INFO_VER2
2408 
2409 //! @}
2410 
2411 ///////////////////////////////////////////////////////////////////////////////
2412 //
2413 // FUNCTION NAME:   NvAPI_GPU_GetPstatesInfoEx
2414 //
2415 //! DESCRIPTION:     This API retrieves all performance states (P-States) information. This is the same as
2416 //!                  NvAPI_GPU_GetPstatesInfo(), but supports an input flag for various options.
2417 //!
2418 //!                  P-States are GPU active/executing performance capability and power consumption states.
2419 //!
2420 //!                  P-States ranges from P0 to P15, with P0 being the highest performance/power state, and
2421 //!                  P15 being the lowest performance/power state. Each P-State, if available, maps to a
2422 //!                  performance level. Not all P-States are available on a given system. The definitions
2423 //!                  of each P-State are currently as follows: \n
2424 //!                  - P0/P1 - Maximum 3D performance
2425 //!                  - P2/P3 - Balanced 3D performance-power
2426 //!                  - P8 - Basic HD video playback
2427 //!                  - P10 - DVD playback
2428 //!                  - P12 - Minimum idle power consumption
2429 //!
2430 //! \deprecated  Do not use this function - it is deprecated in release 304. Instead, use NvAPI_GPU_GetPstates20.
2431 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
2432 //!
2433 //!
2434 //! \param [in]     hPhysicalGPU       GPU selection.
2435 //! \param [out]    pPerfPstatesInfo   P-States information retrieved, as detailed below: \n
2436 //!                  - flags is reserved for future use.
2437 //!                  - numPstates is the number of available P-States
2438 //!                  - numClocks is the number of clock domains supported by each P-State
2439 //!                  - pstates has valid index range from 0 to numPstates - 1
2440 //!                  - pstates[i].pstateId is the ID of the P-State,
2441 //!                      containing the following info:
2442 //!                    - pstates[i].flags containing the following info:
2443 //!                        - bit 0 indicates if the PCIE limit is GEN1 or GEN2
2444 //!                        - bit 1 indicates if the Pstate is overclocked or not
2445 //!                        - bit 2 indicates if the Pstate is overclockable or not
2446 //!                    - pstates[i].clocks has valid index range from 0 to numClocks -1
2447 //!                    - pstates[i].clocks[j].domainId is the public ID of the clock domain,
2448 //!                        containing the following info:
2449 //!                      - pstates[i].clocks[j].flags containing the following info:
2450 //!                          bit 0 indicates if the clock domain is overclockable or not
2451 //!                      - pstates[i].clocks[j].freq is the clock frequency in kHz
2452 //!                    - pstates[i].voltages has a valid index range from 0 to numVoltages - 1
2453 //!                    - pstates[i].voltages[j].domainId is the ID of the voltage domain,
2454 //!                        containing the following info:
2455 //!                      - pstates[i].voltages[j].flags is reserved for future use.
2456 //!                      - pstates[i].voltages[j].mvolt is the voltage in mV
2457 //!                  inputFlags(IN)   - This can be used to select various options:
2458 //!                    - if bit 0 is set, pPerfPstatesInfo would contain the default settings
2459 //!                        instead of the current, possibily overclocked settings.
2460 //!                    - if bit 1 is set, pPerfPstatesInfo would contain the maximum clock
2461 //!                        frequencies instead of the nominal frequencies.
2462 //!                    - if bit 2 is set, pPerfPstatesInfo would contain the minimum clock
2463 //!                        frequencies instead of the nominal frequencies.
2464 //!                    - all other bits must be set to 0.
2465 //!
2466 //! \retval ::NVAPI_OK                            Completed request
2467 //! \retval ::NVAPI_ERROR                         Miscellaneous error occurred
2468 //! \retval ::NVAPI_HANDLE_INVALIDATED            Handle passed has been invalidated (see user guide)
2469 //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  Handle passed is not a physical GPU handle
2470 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION   The version of the NV_GPU_PERF_PSTATES struct is not supported
2471 //!
2472 //! \ingroup gpupstate
2473 ///////////////////////////////////////////////////////////////////////////////
2474 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 304. Instead, use NvAPI_GPU_GetPstates20.")
2475 NVAPI_INTERFACE NvAPI_GPU_GetPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_PSTATES_INFO *pPerfPstatesInfo, NvU32 inputFlags);
2476 
2477 
2478 //! \addtogroup gpupstate
2479 //! @{
2480 
2481 #define NVAPI_MAX_GPU_PSTATE20_PSTATES          16
2482 #define NVAPI_MAX_GPU_PSTATE20_CLOCKS           8
2483 #define NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES    4
2484 
2485 //! Used to identify clock type
2486 typedef enum
2487 {
2488     //! Clock domains that use single frequency value within given pstate
2489     NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_SINGLE = 0,
2490 
2491     //! Clock domains that allow range of frequency values within given pstate
2492     NVAPI_GPU_PERF_PSTATE20_CLOCK_TYPE_RANGE,
2493 } NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID;
2494 
2495 //! Used to describe both voltage and frequency deltas
2496 typedef struct
2497 {
2498     //! Value of parameter delta (in respective units [kHz, uV])
2499     NvS32       value;
2500 
2501     struct
2502     {
2503         //! Min value allowed for parameter delta (in respective units [kHz, uV])
2504         NvS32   min;
2505 
2506         //! Max value allowed for parameter delta (in respective units [kHz, uV])
2507         NvS32   max;
2508     } valueRange;
2509 } NV_GPU_PERF_PSTATES20_PARAM_DELTA;
2510 
2511 //! Used to describe single clock entry
2512 typedef struct
2513 {
2514     //! ID of the clock domain
2515     NV_GPU_PUBLIC_CLOCK_ID                      domainId;
2516 
2517     //! Clock type ID
2518     NV_GPU_PERF_PSTATE20_CLOCK_TYPE_ID          typeId;
2519     NvU32                                       bIsEditable:1;
2520 
2521     //! These bits are reserved for future use (must be always 0)
2522     NvU32                                       reserved:31;
2523 
2524     //! Current frequency delta from nominal settings in (kHz)
2525     NV_GPU_PERF_PSTATES20_PARAM_DELTA           freqDelta_kHz;
2526 
2527     //! Clock domain type dependant information
2528     union
2529     {
2530         struct
2531         {
2532             //! Clock frequency within given pstate in (kHz)
2533             NvU32                               freq_kHz;
2534         } single;
2535 
2536         struct
2537         {
2538             //! Min clock frequency within given pstate in (kHz)
2539             NvU32                               minFreq_kHz;
2540 
2541             //! Max clock frequency within given pstate in (kHz)
2542             NvU32                               maxFreq_kHz;
2543 
2544             //! Voltage domain ID and value range in (uV) required for this clock
2545             NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID  domainId;
2546             NvU32                               minVoltage_uV;
2547             NvU32                               maxVoltage_uV;
2548         } range;
2549     } data;
2550 } NV_GPU_PSTATE20_CLOCK_ENTRY_V1;
2551 
2552 //! Used to describe single base voltage entry
2553 typedef struct
2554 {
2555     //! ID of the voltage domain
2556     NV_GPU_PERF_VOLTAGE_INFO_DOMAIN_ID  domainId;
2557     NvU32                               bIsEditable:1;
2558 
2559     //! These bits are reserved for future use (must be always 0)
2560     NvU32                               reserved:31;
2561 
2562     //! Current base voltage settings in [uV]
2563     NvU32                               volt_uV;
2564 
2565     NV_GPU_PERF_PSTATES20_PARAM_DELTA   voltDelta_uV; // Current base voltage delta from nominal settings in [uV]
2566 } NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1;
2567 
2568 //! Used in NvAPI_GPU_GetPstates20() interface call.
2569 
2570 typedef struct
2571 {
2572     //! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER<n>)
2573     NvU32   version;
2574 
2575     NvU32   bIsEditable:1;
2576 
2577     //! These bits are reserved for future use (must be always 0)
2578     NvU32   reserved:31;
2579 
2580     //! Number of populated pstates
2581     NvU32   numPstates;
2582 
2583     //! Number of populated clocks (per pstate)
2584     NvU32   numClocks;
2585 
2586     //! Number of populated base voltages (per pstate)
2587     NvU32   numBaseVoltages;
2588 
2589     //! Performance state (P-State) settings
2590     //! Valid index range is 0 to numPstates-1
2591     struct
2592     {
2593     //! ID of the P-State
2594         NV_GPU_PERF_PSTATE_ID                   pstateId;
2595 
2596         NvU32                                   bIsEditable:1;
2597 
2598         //! These bits are reserved for future use (must be always 0)
2599         NvU32                                   reserved:31;
2600 
2601         //! Array of clock entries
2602         //! Valid index range is 0 to numClocks-1
2603         NV_GPU_PSTATE20_CLOCK_ENTRY_V1          clocks[NVAPI_MAX_GPU_PSTATE20_CLOCKS];
2604 
2605         //! Array of baseVoltage entries
2606         //! Valid index range is 0 to numBaseVoltages-1
2607         NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1   baseVoltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES];
2608     } pstates[NVAPI_MAX_GPU_PSTATE20_PSTATES];
2609 } NV_GPU_PERF_PSTATES20_INFO_V1;
2610 
2611 //! Used in NvAPI_GPU_GetPstates20() interface call.
2612 
2613 typedef struct _NV_GPU_PERF_PSTATES20_INFO_V2
2614 {
2615     //! Version info of the structure (NV_GPU_PERF_PSTATES20_INFO_VER<n>)
2616     NvU32   version;
2617 
2618     NvU32   bIsEditable:1;
2619 
2620     //! These bits are reserved for future use (must be always 0)
2621     NvU32   reserved:31;
2622 
2623     //! Number of populated pstates
2624     NvU32   numPstates;
2625 
2626     //! Number of populated clocks (per pstate)
2627     NvU32   numClocks;
2628 
2629     //! Number of populated base voltages (per pstate)
2630     NvU32   numBaseVoltages;
2631 
2632     //! Performance state (P-State) settings
2633     //! Valid index range is 0 to numPstates-1
2634     struct
2635     {
2636     //! ID of the P-State
2637         NV_GPU_PERF_PSTATE_ID                   pstateId;
2638 
2639         NvU32                                   bIsEditable:1;
2640 
2641         //! These bits are reserved for future use (must be always 0)
2642         NvU32                                   reserved:31;
2643 
2644         //! Array of clock entries
2645         //! Valid index range is 0 to numClocks-1
2646         NV_GPU_PSTATE20_CLOCK_ENTRY_V1          clocks[NVAPI_MAX_GPU_PSTATE20_CLOCKS];
2647 
2648         //! Array of baseVoltage entries
2649         //! Valid index range is 0 to numBaseVoltages-1
2650         NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1   baseVoltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES];
2651     } pstates[NVAPI_MAX_GPU_PSTATE20_PSTATES];
2652 
2653     //! OV settings - Please refer to NVIDIA over-volting recommendation to understand impact of this functionality
2654     //! Valid index range is 0 to numVoltages-1
2655     struct
2656     {
2657         //! Number of populated voltages
2658         NvU32                                 numVoltages;
2659 
2660         //! Array of voltage entries
2661         //! Valid index range is 0 to numVoltages-1
2662         NV_GPU_PSTATE20_BASE_VOLTAGE_ENTRY_V1 voltages[NVAPI_MAX_GPU_PSTATE20_BASE_VOLTAGES];
2663     } ov;
2664 } NV_GPU_PERF_PSTATES20_INFO_V2;
2665 
2666 typedef NV_GPU_PERF_PSTATES20_INFO_V2   NV_GPU_PERF_PSTATES20_INFO;
2667 
2668 //! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V1
2669 #define NV_GPU_PERF_PSTATES20_INFO_VER1 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V1,1)
2670 
2671 //! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO_V2
2672 #define NV_GPU_PERF_PSTATES20_INFO_VER2 MAKE_NVAPI_VERSION(NV_GPU_PERF_PSTATES20_INFO_V2,2)
2673 
2674 //! Macro for constructing the version field of NV_GPU_PERF_PSTATES20_INFO
2675 #define NV_GPU_PERF_PSTATES20_INFO_VER  NV_GPU_PERF_PSTATES20_INFO_VER2
2676 
2677 //! @}
2678 
2679 ///////////////////////////////////////////////////////////////////////////////
2680 //
2681 // FUNCTION NAME:   NvAPI_GPU_GetPstates20
2682 //
2683 //! DESCRIPTION:    This API retrieves all performance states (P-States) 2.0 information.
2684 //!
2685 //!                 P-States are GPU active/executing performance capability states.
2686 //!                 They range from P0 to P15, with P0 being the highest performance state,
2687 //!                 and P15 being the lowest performance state. Each P-State, if available,
2688 //!                 maps to a performance level. Not all P-States are available on a given system.
2689 //!                 The definition of each P-States are currently as follow:
2690 //!                 - P0/P1 - Maximum 3D performance
2691 //!                 - P2/P3 - Balanced 3D performance-power
2692 //!                 - P8 - Basic HD video playback
2693 //!                 - P10 - DVD playback
2694 //!                 - P12 - Minimum idle power consumption
2695 //!
2696 //! TCC_SUPPORTED
2697 //!
2698 //! \since Release: 295
2699 //!
2700 //! SUPPORTED OS:  Windows XP and higher
2701 //!
2702 //!
2703 //! \param [in]   hPhysicalGPU  GPU selection
2704 //! \param [out]  pPstatesInfo  P-States information retrieved, as documented in declaration above
2705 //!
2706 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
2707 //!          If there are return error codes with specific meaning for this API,
2708 //!          they are listed below.
2709 //!
2710 //! \ingroup gpupstate
2711 ///////////////////////////////////////////////////////////////////////////////
2712 NVAPI_INTERFACE NvAPI_GPU_GetPstates20(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_PERF_PSTATES20_INFO *pPstatesInfo);
2713 
2714 ///////////////////////////////////////////////////////////////////////////////
2715 //
2716 // FUNCTION NAME:   NvAPI_GPU_GetCurrentPstate
2717 //
2718 //! DESCRIPTION:     This function retrieves the current performance state (P-State).
2719 //!
2720 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
2721 //!
2722 //!
2723 //! \since Release: 165
2724 //!
2725 //! TCC_SUPPORTED
2726 //!
2727 //! \param [in]      hPhysicalGPU     GPU selection
2728 //! \param [out]     pCurrentPstate   The ID of the current P-State of the GPU - see \ref NV_GPU_PERF_PSTATES.
2729 //!
2730 //! \retval    NVAPI_OK                             Completed request
2731 //! \retval    NVAPI_ERROR                          Miscellaneous error occurred.
2732 //! \retval    NVAPI_HANDLE_INVALIDATED             Handle passed has been invalidated (see user guide).
2733 //! \retval    NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE   Handle passed is not a physical GPU handle.
2734 //! \retval    NVAPI_NOT_SUPPORTED                  P-States is not supported on this setup.
2735 //!
2736 //! \ingroup   gpupstate
2737 ///////////////////////////////////////////////////////////////////////////////
2738 NVAPI_INTERFACE NvAPI_GPU_GetCurrentPstate(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_PSTATE_ID *pCurrentPstate);
2739 
2740 
2741 
2742 
2743 //! \ingroup gpupstate
2744 #define NVAPI_MAX_GPU_UTILIZATIONS 8
2745 
2746 
2747 
2748 //! \ingroup gpupstate
2749 //! Used in NvAPI_GPU_GetDynamicPstatesInfoEx().
2750 typedef struct
2751 {
2752     NvU32       version;        //!< Structure version
2753     NvU32       flags;          //!< bit 0 indicates if the dynamic Pstate is enabled or not
2754     struct
2755     {
2756         NvU32   bIsPresent:1;   //!< Set if this utilization domain is present on this GPU
2757         NvU32   percentage;     //!< Percentage of time where the domain is considered busy in the last 1 second interval
2758     } utilization[NVAPI_MAX_GPU_UTILIZATIONS];
2759 } NV_GPU_DYNAMIC_PSTATES_INFO_EX;
2760 
2761 //! \ingroup gpupstate
2762 //! Macro for constructing the version field of NV_GPU_DYNAMIC_PSTATES_INFO_EX
2763 #define NV_GPU_DYNAMIC_PSTATES_INFO_EX_VER MAKE_NVAPI_VERSION(NV_GPU_DYNAMIC_PSTATES_INFO_EX,1)
2764 
2765 ///////////////////////////////////////////////////////////////////////////////
2766 //
2767 // FUNCTION NAME: NvAPI_GPU_GetDynamicPstatesInfoEx
2768 //
2769 //! DESCRIPTION:   This API retrieves the NV_GPU_DYNAMIC_PSTATES_INFO_EX structure for the specified physical GPU.
2770 //!                Each domain's info is indexed in the array.  For example:
2771 //!                - pDynamicPstatesInfo->utilization[NVAPI_GPU_UTILIZATION_DOMAIN_GPU] holds the info for the GPU domain. \p
2772 //!                There are currently 4 domains for which GPU utilization and dynamic P-State thresholds can be retrieved:
2773 //!                   graphic engine (GPU), frame buffer (FB), video engine (VID), and bus interface (BUS).
2774 //!
2775 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
2776 //!
2777 //!
2778 //! \since Release: 185
2779 //!
2780 //! \retval ::NVAPI_OK
2781 //! \retval ::NVAPI_ERROR
2782 //! \retval ::NVAPI_INVALID_ARGUMENT  pDynamicPstatesInfo is NULL
2783 //! \retval ::NVAPI_HANDLE_INVALIDATED
2784 //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE
2785 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the INFO struct is not supported
2786 //!
2787 //! \ingroup gpupstate
2788 ///////////////////////////////////////////////////////////////////////////////
2789 NVAPI_INTERFACE NvAPI_GPU_GetDynamicPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_DYNAMIC_PSTATES_INFO_EX *pDynamicPstatesInfoEx);
2790 
2791 
2792 ///////////////////////////////////////////////////////////////////////////////////
2793 //  Thermal API
2794 //  Provides ability to get temperature levels from the various thermal sensors associated with the GPU
2795 
2796 //! \ingroup gputhermal
2797 #define NVAPI_MAX_THERMAL_SENSORS_PER_GPU 3
2798 
2799 //! \ingroup gputhermal
2800 //! Used in NV_GPU_THERMAL_SETTINGS
2801 typedef enum
2802 {
2803     NVAPI_THERMAL_TARGET_NONE          = 0,
2804     NVAPI_THERMAL_TARGET_GPU           = 1,     //!< GPU core temperature requires NvPhysicalGpuHandle
2805     NVAPI_THERMAL_TARGET_MEMORY        = 2,     //!< GPU memory temperature requires NvPhysicalGpuHandle
2806     NVAPI_THERMAL_TARGET_POWER_SUPPLY  = 4,     //!< GPU power supply temperature requires NvPhysicalGpuHandle
2807     NVAPI_THERMAL_TARGET_BOARD         = 8,     //!< GPU board ambient temperature requires NvPhysicalGpuHandle
2808     NVAPI_THERMAL_TARGET_VCD_BOARD     = 9,     //!< Visual Computing Device Board temperature requires NvVisualComputingDeviceHandle
2809     NVAPI_THERMAL_TARGET_VCD_INLET     = 10,    //!< Visual Computing Device Inlet temperature requires NvVisualComputingDeviceHandle
2810     NVAPI_THERMAL_TARGET_VCD_OUTLET    = 11,    //!< Visual Computing Device Outlet temperature requires NvVisualComputingDeviceHandle
2811 
2812     NVAPI_THERMAL_TARGET_ALL           = 15,
2813     NVAPI_THERMAL_TARGET_UNKNOWN       = -1,
2814 } NV_THERMAL_TARGET;
2815 
2816 //! \ingroup gputhermal
2817 //! Used in NV_GPU_THERMAL_SETTINGS
2818 typedef enum
2819 {
2820     NVAPI_THERMAL_CONTROLLER_NONE = 0,
2821     NVAPI_THERMAL_CONTROLLER_GPU_INTERNAL,
2822     NVAPI_THERMAL_CONTROLLER_ADM1032,
2823     NVAPI_THERMAL_CONTROLLER_MAX6649,
2824     NVAPI_THERMAL_CONTROLLER_MAX1617,
2825     NVAPI_THERMAL_CONTROLLER_LM99,
2826     NVAPI_THERMAL_CONTROLLER_LM89,
2827     NVAPI_THERMAL_CONTROLLER_LM64,
2828     NVAPI_THERMAL_CONTROLLER_ADT7473,
2829     NVAPI_THERMAL_CONTROLLER_SBMAX6649,
2830     NVAPI_THERMAL_CONTROLLER_VBIOSEVT,
2831     NVAPI_THERMAL_CONTROLLER_OS,
2832     NVAPI_THERMAL_CONTROLLER_UNKNOWN = -1,
2833 } NV_THERMAL_CONTROLLER;
2834 
2835 //! \ingroup gputhermal
2836 //! Used in NvAPI_GPU_GetThermalSettings()
2837 typedef struct
2838 {
2839     NvU32   version;                //!< structure version
2840     NvU32   count;                  //!< number of associated thermal sensors
2841     struct
2842     {
2843         NV_THERMAL_CONTROLLER       controller;        //!< internal, ADM1032, MAX6649...
2844         NvU32                       defaultMinTemp;    //!< The min default temperature value of the thermal sensor in degree Celsius
2845         NvU32                       defaultMaxTemp;    //!< The max default temperature value of the thermal sensor in degree Celsius
2846         NvU32                       currentTemp;       //!< The current temperature value of the thermal sensor in degree Celsius
2847         NV_THERMAL_TARGET           target;            //!< Thermal sensor targeted @ GPU, memory, chipset, powersupply, Visual Computing Device, etc.
2848     } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU];
2849 
2850 } NV_GPU_THERMAL_SETTINGS_V1;
2851 
2852 //! \ingroup gputhermal
2853 typedef struct
2854 {
2855     NvU32   version;                //!< structure version
2856     NvU32   count;                  //!< number of associated thermal sensors
2857     struct
2858     {
2859         NV_THERMAL_CONTROLLER       controller;         //!< internal, ADM1032, MAX6649...
2860         NvS32                       defaultMinTemp;     //!< Minimum default temperature value of the thermal sensor in degree Celsius
2861         NvS32                       defaultMaxTemp;     //!< Maximum default temperature value of the thermal sensor in degree Celsius
2862         NvS32                       currentTemp;        //!< Current temperature value of the thermal sensor in degree Celsius
2863         NV_THERMAL_TARGET           target;             //!< Thermal sensor targeted - GPU, memory, chipset, powersupply, Visual Computing Device, etc
2864     } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU];
2865 
2866 } NV_GPU_THERMAL_SETTINGS_V2;
2867 
2868 //! \ingroup gputhermal
2869 typedef NV_GPU_THERMAL_SETTINGS_V2  NV_GPU_THERMAL_SETTINGS;
2870 
2871 //! \ingroup gputhermal
2872 //! @{
2873 
2874 //! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS_V1
2875 #define NV_GPU_THERMAL_SETTINGS_VER_1   MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V1,1)
2876 
2877 //! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS_V2
2878 #define NV_GPU_THERMAL_SETTINGS_VER_2   MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V2,2)
2879 
2880 //! Macro for constructing the version field of NV_GPU_THERMAL_SETTINGS
2881 #define NV_GPU_THERMAL_SETTINGS_VER     NV_GPU_THERMAL_SETTINGS_VER_2
2882 //! @}
2883 
2884 
2885 
2886 
2887 ///////////////////////////////////////////////////////////////////////////////
2888 //
2889 // FUNCTION NAME:   NvAPI_GPU_GetThermalSettings
2890 //
2891 //!  This function retrieves the thermal information of all thermal sensors or specific thermal sensor associated with the selected GPU.
2892 //!  Thermal sensors are indexed 0 to NVAPI_MAX_THERMAL_SENSORS_PER_GPU-1.
2893 //!
2894 //!  - To retrieve specific thermal sensor info, set the sensorIndex to the required thermal sensor index.
2895 //!  - To retrieve info for all sensors, set sensorIndex to NVAPI_THERMAL_TARGET_ALL.
2896 //!
2897 //! SUPPORTED OS:  Windows XP and higher
2898 //!
2899 //!
2900 //! TCC_SUPPORTED
2901 //!
2902 //! \since Release: 85
2903 //!
2904 //! \param [in]   hPhysicalGPU      GPU selection.
2905 //! \param [in]   sensorIndex       Explicit thermal sensor index selection.
2906 //! \param [out]  pThermalSettings  Array of thermal settings.
2907 //!
2908 //! \retval   NVAPI_OK                           Completed request
2909 //! \retval   NVAPI_ERROR                        Miscellaneous error occurred.
2910 //! \retval   NVAPI_INVALID_ARGUMENT             pThermalInfo is NULL.
2911 //! \retval   NVAPI_HANDLE_INVALIDATED           Handle passed has been invalidated (see user guide).
2912 //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE Handle passed is not a physical GPU handle.
2913 //! \retval   NVAPI_INCOMPATIBLE_STRUCT_VERSION  The version of the INFO struct is not supported.
2914 //! \ingroup gputhermal
2915 ///////////////////////////////////////////////////////////////////////////////
2916 NVAPI_INTERFACE NvAPI_GPU_GetThermalSettings(NvPhysicalGpuHandle hPhysicalGpu, NvU32 sensorIndex, NV_GPU_THERMAL_SETTINGS *pThermalSettings);
2917 
2918 
2919 ///////////////////////////////////////////////////////////////////////////////////
2920 //  I2C API
2921 //  Provides ability to read or write data using I2C protocol.
2922 //  These APIs allow I2C access only to DDC monitors
2923 
2924 
2925 //! \addtogroup i2capi
2926 //! @{
2927 #define NVAPI_MAX_SIZEOF_I2C_DATA_BUFFER    4096
2928 #define NVAPI_MAX_SIZEOF_I2C_REG_ADDRESS       4
2929 #define NVAPI_DISPLAY_DEVICE_MASK_MAX         24
2930 #define NVAPI_I2C_SPEED_DEPRECATED        0xFFFF
2931 
2932 typedef enum
2933 {
2934     NVAPI_I2C_SPEED_DEFAULT,    //!< Set i2cSpeedKhz to I2C_SPEED_DEFAULT if default I2C speed is to be chosen, ie.use the current frequency setting.
2935     NVAPI_I2C_SPEED_3KHZ,
2936     NVAPI_I2C_SPEED_10KHZ,
2937     NVAPI_I2C_SPEED_33KHZ,
2938     NVAPI_I2C_SPEED_100KHZ,
2939     NVAPI_I2C_SPEED_200KHZ,
2940     NVAPI_I2C_SPEED_400KHZ,
2941 } NV_I2C_SPEED;
2942 
2943 //! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()
2944 typedef struct
2945 {
2946     NvU32                   version;            //!< The structure version.
2947     NvU32                   displayMask;        //!< The Display Mask of the concerned display.
2948     NvU8                    bIsDDCPort;         //!< This flag indicates either the DDC port (TRUE) or the communication port
2949                                                 //!< (FALSE) of the concerned display.
2950     NvU8                    i2cDevAddress;      //!< The address of the I2C slave.  The address should be shifted left by one.  For
2951                                                 //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored
2952                                                 //!< here as 0xA0.  This matches the position within the byte sent by the master, as
2953                                                 //!< the last bit is reserved to specify the read or write direction.
2954     NvU8*                   pbI2cRegAddress;    //!< The I2C target register address.  May be NULL, which indicates no register
2955                                                 //!< address should be sent.
2956     NvU32                   regAddrSize;        //!< The size in bytes of target register address.  If pbI2cRegAddress is NULL, this
2957                                                 //!< field must be 0.
2958     NvU8*                   pbData;             //!< The buffer of data which is to be read or written (depending on the command).
2959     NvU32                   cbSize;             //!< The size of the data buffer, pbData, to be read or written.
2960     NvU32                   i2cSpeed;           //!< The target speed of the transaction (between 28Kbps to 40Kbps; not guaranteed).
2961 } NV_I2C_INFO_V1;
2962 
2963 //! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()
2964 typedef struct
2965 {
2966     NvU32                   version;            //!< The structure version.
2967     NvU32                   displayMask;        //!< The Display Mask of the concerned display.
2968     NvU8                    bIsDDCPort;         //!< This flag indicates either the DDC port (TRUE) or the communication port
2969                                                 //!< (FALSE) of the concerned display.
2970     NvU8                    i2cDevAddress;      //!< The address of the I2C slave.  The address should be shifted left by one.  For
2971                                                 //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored
2972                                                 //!< here as 0xA0.  This matches the position within the byte sent by the master, as
2973                                                 //!< the last bit is reserved to specify the read or write direction.
2974     NvU8*                   pbI2cRegAddress;    //!< The I2C target register address.  May be NULL, which indicates no register
2975                                                 //!< address should be sent.
2976     NvU32                   regAddrSize;        //!< The size in bytes of target register address.  If pbI2cRegAddress is NULL, this
2977                                                 //!< field must be 0.
2978     NvU8*                   pbData;             //!< The buffer of data which is to be read or written (depending on the command).
2979     NvU32                   cbSize;             //!< The size of the data buffer, pbData, to be read or written.
2980     NvU32                   i2cSpeed;           //!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED.
2981     NV_I2C_SPEED            i2cSpeedKhz;        //!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED).
2982 } NV_I2C_INFO_V2;
2983 
2984 //! Used in NvAPI_I2CRead() and NvAPI_I2CWrite()
2985 typedef struct
2986 {
2987     NvU32                   version;            //!< The structure version.
2988     NvU32                   displayMask;        //!< The Display Mask of the concerned display.
2989     NvU8                    bIsDDCPort;         //!< This flag indicates either the DDC port (TRUE) or the communication port
2990                                                 //!< (FALSE) of the concerned display.
2991     NvU8                    i2cDevAddress;      //!< The address of the I2C slave.  The address should be shifted left by one.  For
2992                                                 //!< example, the I2C address 0x50, often used for reading EDIDs, would be stored
2993                                                 //!< here as 0xA0.  This matches the position within the byte sent by the master, as
2994                                                 //!< the last bit is reserved to specify the read or write direction.
2995     NvU8*                   pbI2cRegAddress;    //!< The I2C target register address.  May be NULL, which indicates no register
2996                                                 //!< address should be sent.
2997     NvU32                   regAddrSize;        //!< The size in bytes of target register address.  If pbI2cRegAddress is NULL, this
2998                                                 //!< field must be 0.
2999     NvU8*                   pbData;             //!< The buffer of data which is to be read or written (depending on the command).
3000     NvU32                   cbSize;             //!< The size of the data buffer, pbData, to be read or written.
3001     NvU32                   i2cSpeed;           //!< Deprecated, Must be set to NVAPI_I2C_SPEED_DEPRECATED.
3002     NV_I2C_SPEED            i2cSpeedKhz;        //!< The target speed of the transaction in (kHz) (Chosen from the enum NV_I2C_SPEED).
3003     NvU8                    portId;             //!< The portid on which device is connected (remember to set bIsPortIdSet if this value is set)
3004                                                 //!< Optional for pre-Kepler
3005     NvU32                   bIsPortIdSet;       //!< set this flag on if and only if portid value is set
3006 } NV_I2C_INFO_V3;
3007 
3008 typedef NV_I2C_INFO_V3                     NV_I2C_INFO;
3009 
3010 #define NV_I2C_INFO_VER3  MAKE_NVAPI_VERSION(NV_I2C_INFO_V3,3)
3011 #define NV_I2C_INFO_VER2  MAKE_NVAPI_VERSION(NV_I2C_INFO_V2,2)
3012 #define NV_I2C_INFO_VER1  MAKE_NVAPI_VERSION(NV_I2C_INFO_V1,1)
3013 
3014 #define NV_I2C_INFO_VER  NV_I2C_INFO_VER3
3015 //! @}
3016 
3017 /***********************************************************************************/
3018 
3019 
3020 ///////////////////////////////////////////////////////////////////////////////
3021 //
3022 // FUNCTION NAME:  NvAPI_I2CRead
3023 //
3024 //!  This function reads the data buffer from the I2C port.
3025 //!                 The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1.
3026 //!
3027 //!                 A data buffer size larger than 16 bytes may be rejected if a register address is specified.  In such a case,
3028 //!                 NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned.
3029 //!
3030 //!                 If a register address is specified (i.e. regAddrSize is positive), then the transaction will be performed in
3031 //!                 the combined format described in the I2C specification.  The register address will be written, followed by
3032 //!                 reading into the data buffer.
3033 //!
3034 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
3035 //!
3036 //!
3037 //! \since Release: 85
3038 //!
3039 //! \param [in]   hPhysicalGPU     GPU selection.
3040 //! \param [out]  NV_I2C_INFO     *pI2cInfo The I2C data input structure
3041 //!
3042 //! \retval   NVAPI_OK                            Completed request
3043 //! \retval   NVAPI_ERROR                         Miscellaneous error occurred.
3044 //! \retval   NVAPI_HANDLE_INVALIDATED            Handle passed has been invalidated (see user guide).
3045 //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  Handle passed is not a physical GPU handle.
3046 //! \retval   NVAPI_INCOMPATIBLE_STRUCT_VERSION   Structure version is not supported.
3047 //! \retval   NVAPI_INVALID_ARGUMENT - argument does not meet specified requirements
3048 //! \retval   NVAPI_ARGUMENT_EXCEED_MAX_SIZE - an argument exceeds the maximum
3049 //!
3050 //! \ingroup i2capi
3051 ///////////////////////////////////////////////////////////////////////////////
3052 NVAPI_INTERFACE NvAPI_I2CRead(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo);
3053 
3054 ///////////////////////////////////////////////////////////////////////////////
3055 //
3056 // FUNCTION NAME:  NvAPI_I2CWrite
3057 //
3058 //!  This function writes the data buffer to the I2C port.
3059 //!
3060 //!                 The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1.
3061 //!
3062 //!                 A data buffer size larger than 16 bytes may be rejected if a register address is specified.  In such a case,
3063 //!                 NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned.
3064 //!
3065 //!                 If a register address is specified (i.e. regAddrSize is positive), then the register address will be written
3066 //!                 and the data buffer will immediately follow without a restart.
3067 //!
3068 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
3069 //!
3070 //!
3071 //! \since Release: 85
3072 //!
3073 //! \param [in]   hPhysicalGPU     GPU selection.
3074 //! \param [in]   pI2cInfo         The I2C data input structure
3075 //!
3076 //! \retval   NVAPI_OK                            Completed request
3077 //! \retval   NVAPI_ERROR                         Miscellaneous error occurred.
3078 //! \retval   NVAPI_HANDLE_INVALIDATED            Handle passed has been invalidated (see user guide).
3079 //! \retval   NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  Handle passed is not a physical GPU handle.
3080 //! \retval   NVAPI_INCOMPATIBLE_STRUCT_VERSION    Structure version is not supported.
3081 //! \retval   NVAPI_INVALID_ARGUMENT              Argument does not meet specified requirements
3082 //! \retval   NVAPI_ARGUMENT_EXCEED_MAX_SIZE      Argument exceeds the maximum
3083 //!
3084 //! \ingroup i2capi
3085 ///////////////////////////////////////////////////////////////////////////////
3086 NVAPI_INTERFACE NvAPI_I2CWrite(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo);
3087 
3088 
3089 ///////////////////////////////////////////////////////////////////////////////
3090 //
3091 // FUNCTION NAME: NvAPI_GPU_WorkstationFeatureSetup
3092 //
3093 //! \fn NvAPI_GPU_WorkstationFeatureSetup(NvPhysicalGpuHandle hPhysicalGpu, NvU32 featureEnableMask, NvU32 featureDisableMask)
3094 //!   DESCRIPTION: This API configures the driver for a set of workstation features.
3095 //!                The driver can allocate the memory resources accordingly.
3096 //!
3097 //! SUPPORTED OS:  Windows 7
3098 //!
3099 //!
3100 //! \param [in]   hPhysicalGpu       Physical GPU Handle of the display adapter to be configured. GPU handles may be retrieved
3101 //!                                  using NvAPI_EnumPhysicalGPUs. A value of NULL is permitted and applies the same operation
3102 //!                                  to all GPU handles enumerated by NvAPI_EnumPhysicalGPUs.
3103 //! \param [in]   featureEnableMask  Mask of features the caller requests to enable for use
3104 //! \param [in]   featureDisableMask Mask of features the caller requests to disable
3105 //!
3106 //!                As a general rule, features in the enable and disable masks are expected to be disjoint, although the disable
3107 //!                mask has precedence and a feature flagged in both masks will be disabled.
3108 //!
3109 //! \retval ::NVAPI_OK                            configuration request succeeded
3110 //! \retval ::NVAPI_ERROR                         configuration request failed
3111 //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu is not a physical GPU handle.
3112 //! \retval ::NVAPI_GPU_WORKSTATION_FEATURE_INCOMPLETE  requested feature set does not have all resources allocated for completeness.
3113 //! \retval ::NVAPI_NO_IMPLEMENTATION             only implemented for Win7
3114 //
3115 ///////////////////////////////////////////////////////////////////////////////
3116 
3117 //! \ingroup gpu
3118 typedef enum
3119 {
3120     NVAPI_GPU_WORKSTATION_FEATURE_MASK_SWAPGROUP     = 0x00000001,
3121     NVAPI_GPU_WORKSTATION_FEATURE_MASK_STEREO        = 0x00000010,
3122     NVAPI_GPU_WORKSTATION_FEATURE_MASK_WARPING       = 0x00000100,
3123     NVAPI_GPU_WORKSTATION_FEATURE_MASK_PIXINTENSITY  = 0x00000200,
3124     NVAPI_GPU_WORKSTATION_FEATURE_MASK_GRAYSCALE     = 0x00000400,
3125     NVAPI_GPU_WORKSTATION_FEATURE_MASK_BPC10         = 0x00001000
3126 } NVAPI_GPU_WORKSTATION_FEATURE_MASK;
3127 
3128 //! \ingroup gpu
3129 NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureSetup(__in NvPhysicalGpuHandle hPhysicalGpu, __in NvU32 featureEnableMask, __in NvU32 featureDisableMask);
3130 
3131 ///////////////////////////////////////////////////////////////////////////////
3132 //
3133 // FUNCTION NAME: NvAPI_GPU_WorkstationFeatureQuery
3134 //
3135 //!   DESCRIPTION: This API queries the current set of workstation features.
3136 //!
3137 //! SUPPORTED OS:  Windows 7
3138 //!
3139 //!
3140 //! \param [in]   hPhysicalGpu       Physical GPU Handle of the display adapter to be configured. GPU handles may be retrieved
3141 //!                                  using NvAPI_EnumPhysicalGPUs.
3142 //! \param [out]  pConfiguredFeatureMask  Mask of features requested for use by client drivers
3143 //! \param [out]  pConsistentFeatureMask  Mask of features that have all resources allocated for completeness.
3144 //!
3145 //! \retval ::NVAPI_OK                            configuration request succeeded
3146 //! \retval ::NVAPI_ERROR                         configuration request failed
3147 //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  hPhysicalGpu is not a physical GPU handle.
3148 //! \retval ::NVAPI_NO_IMPLEMENTATION             only implemented for Win7
3149 //
3150 ///////////////////////////////////////////////////////////////////////////////
3151 
3152 //! \ingroup gpu
3153 NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureQuery(__in NvPhysicalGpuHandle hPhysicalGpu, __out_opt NvU32 *pConfiguredFeatureMask, __out_opt NvU32 *pConsistentFeatureMask);
3154 
3155 ///////////////////////////////////////////////////////////////////////////////
3156 //
3157 // FUNCTION NAME: NvAPI_GPU_GetHDCPSupportStatus
3158 //
3159 //! \fn NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus)
3160 //! DESCRIPTION: This function returns a GPU's HDCP support status.
3161 //!
3162 //! SUPPORTED OS:  Windows XP and higher
3163 //!
3164 //!
3165 //! \since Release: 175
3166 //!
3167 //!  \retval ::NVAPI_OK
3168 //!  \retval ::NVAPI_ERROR
3169 //!  \retval ::NVAPI_INVALID_ARGUMENT
3170 //!  \retval ::NVAPI_HANDLE_INVALIDATED
3171 //!  \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE
3172 //!  \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION
3173 //
3174 ////////////////////////////////////////////////////////////////////////////////
3175 
3176 
3177 //! \addtogroup gpu
3178 //! @{
3179 
3180 
3181 //! HDCP fuse states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS
3182 typedef enum _NV_GPU_HDCP_FUSE_STATE
3183 {
3184     NV_GPU_HDCP_FUSE_STATE_UNKNOWN  = 0,
3185     NV_GPU_HDCP_FUSE_STATE_DISABLED = 1,
3186     NV_GPU_HDCP_FUSE_STATE_ENABLED  = 2,
3187 } NV_GPU_HDCP_FUSE_STATE;
3188 
3189 
3190 //! HDCP key sources - used in NV_GPU_GET_HDCP_SUPPORT_STATUS
3191 typedef enum _NV_GPU_HDCP_KEY_SOURCE
3192 {
3193     NV_GPU_HDCP_KEY_SOURCE_UNKNOWN    = 0,
3194     NV_GPU_HDCP_KEY_SOURCE_NONE       = 1,
3195     NV_GPU_HDCP_KEY_SOURCE_CRYPTO_ROM = 2,
3196     NV_GPU_HDCP_KEY_SOURCE_SBIOS      = 3,
3197     NV_GPU_HDCP_KEY_SOURCE_I2C_ROM    = 4,
3198     NV_GPU_HDCP_KEY_SOURCE_FUSES      = 5,
3199 } NV_GPU_HDCP_KEY_SOURCE;
3200 
3201 
3202 //! HDCP key source states - used in NV_GPU_GET_HDCP_SUPPORT_STATUS
3203 typedef enum _NV_GPU_HDCP_KEY_SOURCE_STATE
3204 {
3205     NV_GPU_HDCP_KEY_SOURCE_STATE_UNKNOWN = 0,
3206     NV_GPU_HDCP_KEY_SOURCE_STATE_ABSENT  = 1,
3207     NV_GPU_HDCP_KEY_SOURCE_STATE_PRESENT = 2,
3208 } NV_GPU_HDCP_KEY_SOURCE_STATE;
3209 
3210 
3211 //! HDPC support status - used in NvAPI_GPU_GetHDCPSupportStatus()
3212 typedef struct
3213 {
3214     NvU32                        version;               //! Structure version constucted by macro #NV_GPU_GET_HDCP_SUPPORT_STATUS
3215     NV_GPU_HDCP_FUSE_STATE       hdcpFuseState;         //! GPU's HDCP fuse state
3216     NV_GPU_HDCP_KEY_SOURCE       hdcpKeySource;         //! GPU's HDCP key source
3217     NV_GPU_HDCP_KEY_SOURCE_STATE hdcpKeySourceState;    //! GPU's HDCP key source state
3218 } NV_GPU_GET_HDCP_SUPPORT_STATUS;
3219 
3220 
3221 //! Macro for constructing the version for structure NV_GPU_GET_HDCP_SUPPORT_STATUS
3222 #define NV_GPU_GET_HDCP_SUPPORT_STATUS_VER MAKE_NVAPI_VERSION(NV_GPU_GET_HDCP_SUPPORT_STATUS,1)
3223 
3224 
3225 //! @}
3226 
3227 
3228 //!  \ingroup gpu
3229 NVAPI_INTERFACE NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus);
3230 
3231 
3232 
3233 ///////////////////////////////////////////////////////////////////////////////
3234 //
3235 // FUNCTION NAME: NvAPI_GPU_GetTachReading
3236 //
3237 //!   DESCRIPTION: This API retrieves the fan speed tachometer reading for the specified physical GPU.
3238 //!
3239 //!   HOW TO USE:
3240 //!                 - NvU32 Value = 0;
3241 //!                 - ret = NvAPI_GPU_GetTachReading(hPhysicalGpu, &Value);
3242 //!                 - On call success:
3243 //!                 - Value contains the tachometer reading
3244 //!
3245 //! SUPPORTED OS:  Windows XP and higher
3246 //!
3247 //!
3248 //! TCC_SUPPORTED
3249 //!
3250 //! \param [in]    hPhysicalGpu   GPU selection.
3251 //! \param [out]   pValue         Pointer to a variable to get the tachometer reading
3252 //!
3253 //! \retval ::NVAPI_OK - completed request
3254 //! \retval ::NVAPI_ERROR - miscellaneous error occurred
3255 //! \retval ::NVAPI_NOT_SUPPORTED - functionality not supported
3256 //! \retval ::NVAPI_API_NOT_INTIALIZED - nvapi not initialized
3257 //! \retval ::NVAPI_INVALID_ARGUMENT - invalid argument passed
3258 //! \retval ::NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
3259 //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
3260 //!
3261 //! \ingroup gpucooler
3262 ///////////////////////////////////////////////////////////////////////////////
3263 NVAPI_INTERFACE NvAPI_GPU_GetTachReading(NvPhysicalGpuHandle hPhysicalGPU, NvU32 *pValue);
3264 
3265 
3266 
3267 
3268 ///////////////////////////////////////////////////////////////////////////////
3269 //
3270 // FUNCTION NAME:   NvAPI_GPU_GetECCStatusInfo
3271 //
3272 //! \fn NvAPI_GPU_GetECCStatusInfo(NvPhysicalGpuHandle hPhysicalGpu,
3273 //!                                           NV_GPU_ECC_STATUS_INFO *pECCStatusInfo);
3274 //! DESCRIPTION:     This function returns ECC memory status information.
3275 //!
3276 //! SUPPORTED OS:  Windows XP and higher
3277 //!
3278 //!
3279 //! \param [in]      hPhysicalGpu      A handle identifying the physical GPU for which ECC
3280 //!                                    status information is to be retrieved.
3281 //! \param [out]     pECCStatusInfo    A pointer to an ECC status structure.
3282 //!
3283 //! \retval ::NVAPI_OK                  The request was completed successfully.
3284 //! \retval ::NVAPI_ERROR               An unknown error occurred.
3285 //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE The provided GPU handle is not a physical GPU handle.
3286 //! \retval ::NVAPI_INVALID_HANDLE      The provided GPU handle is invalid.
3287 //! \retval ::NVAPI_HANDLE_INVALIDATED  The provided GPU handle is no longer valid.
3288 //! \retval ::NVAPI_INVALID_POINTER     An invalid argument pointer was provided.
3289 //! \retval ::NVAPI_NOT_SUPPORTED       The request is not supported.
3290 //! \retval ::NVAPI_API_NOT_INTIALIZED  NvAPI was not yet initialized.
3291 //
3292 ///////////////////////////////////////////////////////////////////////////////
3293 
3294 //! \addtogroup gpuecc
3295 //! Used in NV_GPU_ECC_STATUS_INFO.
3296 typedef enum _NV_ECC_CONFIGURATION
3297 {
3298     NV_ECC_CONFIGURATION_NOT_SUPPORTED = 0,
3299     NV_ECC_CONFIGURATION_DEFERRED,           //!< Changes require a POST to take effect
3300     NV_ECC_CONFIGURATION_IMMEDIATE,          //!< Changes can optionally be made to take effect immediately
3301 } NV_ECC_CONFIGURATION;
3302 
3303 //! \ingroup gpuecc
3304 //! Used in NvAPI_GPU_GetECCStatusInfo().
3305 typedef struct
3306 {
3307     NvU32                 version;               //!< Structure version
3308     NvU32                 isSupported : 1;       //!< ECC memory feature support
3309     NV_ECC_CONFIGURATION  configurationOptions;  //!< Supported ECC memory feature configuration options
3310     NvU32                 isEnabled : 1;         //!< Active ECC memory setting
3311 } NV_GPU_ECC_STATUS_INFO;
3312 
3313 //! \ingroup gpuecc
3314 //! Macro for constructing the version field of NV_GPU_ECC_STATUS_INFO
3315 #define NV_GPU_ECC_STATUS_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_STATUS_INFO,1)
3316 
3317 //! \ingroup gpuecc
3318 NVAPI_INTERFACE NvAPI_GPU_GetECCStatusInfo(NvPhysicalGpuHandle hPhysicalGpu,
3319                                            NV_GPU_ECC_STATUS_INFO *pECCStatusInfo);
3320 
3321 ///////////////////////////////////////////////////////////////////////////////
3322 //
3323 // FUNCTION NAME:   NvAPI_GPU_GetECCErrorInfo
3324 //
3325 //! \fn NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu,
3326 //!                                          NV_GPU_ECC_ERROR_INFO *pECCErrorInfo);
3327 //!
3328 //! DESCRIPTION:     This function returns ECC memory error information.
3329 //!
3330 //! SUPPORTED OS:  Windows XP and higher
3331 //!
3332 //!
3333 //! \param [in]      hPhysicalGpu  A handle identifying the physical GPU for
3334 //!                                which ECC error information is to be
3335 //!                                retrieved.
3336 //! \param [out]     pECCErrorInfo A pointer to an ECC error structure.
3337 //!
3338 //! \retval ::NVAPI_OK  The request was completed successfully.
3339 //! \retval ::NVAPI_ERROR  An unknown error occurred.
3340 //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  The provided GPU handle is not a physical GPU handle.
3341 //! \retval ::NVAPI_INVALID_ARGUMENT  incorrect param value
3342 //! \retval ::NVAPI_INVALID_POINTER  An invalid argument pointer was provided.
3343 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  structure version is not supported, initialize to NV_GPU_ECC_ERROR_INFO_VER.
3344 //! \retval ::NVAPI_HANDLE_INVALIDATED  The provided GPU handle is no longer valid.
3345 //! \retval ::NVAPI_NOT_SUPPORTED  The request is not supported.
3346 //! \retval ::NVAPI_API_NOT_INTIALIZED  NvAPI was not yet initialized.
3347 //
3348 ///////////////////////////////////////////////////////////////////////////////
3349 
3350 
3351 //! \ingroup gpuecc
3352 //! Used in NvAPI_GPU_GetECCErrorInfo()/
3353 typedef struct
3354 {
3355     NvU32   version;             //!< Structure version
3356     struct {
3357         NvU64  singleBitErrors;  //!< Number of single-bit ECC errors detected since last boot
3358         NvU64  doubleBitErrors;  //!< Number of double-bit ECC errors detected since last boot
3359     } current;
3360     struct {
3361         NvU64  singleBitErrors;  //!< Number of single-bit ECC errors detected since last counter reset
3362         NvU64  doubleBitErrors;  //!< Number of double-bit ECC errors detected since last counter reset
3363     } aggregate;
3364 } NV_GPU_ECC_ERROR_INFO;
3365 
3366 //! \ingroup gpuecc
3367 //! Macro for constructing the version field of NV_GPU_ECC_ERROR_INFO
3368 #define NV_GPU_ECC_ERROR_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_ERROR_INFO,1)
3369 
3370 //! \ingroup gpuecc
3371 NVAPI_INTERFACE NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu,
3372                                           NV_GPU_ECC_ERROR_INFO *pECCErrorInfo);
3373 
3374 
3375 ///////////////////////////////////////////////////////////////////////////////
3376 //
3377 // FUNCTION NAME:   NvAPI_GPU_ResetECCErrorInfo
3378 //
3379 //! DESCRIPTION:     This function resets ECC memory error counters.
3380 //!
3381 //! SUPPORTED OS:  Windows XP and higher
3382 //!
3383 //!
3384 //! \param [in]     hPhysicalGpu     A handle identifying the physical GPU for
3385 //!                                  which ECC error information is to be
3386 //!                                  cleared.
3387 //! \param [in]     bResetCurrent    Reset the current ECC error counters.
3388 //! \param [in]     bResetAggregate  Reset the aggregate ECC error counters.
3389 //!
3390 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
3391 //!          specific meaning for this API, they are listed below.
3392 //!
3393 //! \retval ::NVAPI_INVALID_USER_PRIVILEGE       - The caller does not have administrative privileges
3394 //!
3395 //! \ingroup gpuecc
3396 ///////////////////////////////////////////////////////////////////////////////
3397 NVAPI_INTERFACE NvAPI_GPU_ResetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, NvU8 bResetCurrent,
3398                                             NvU8 bResetAggregate);
3399 
3400 ///////////////////////////////////////////////////////////////////////////////
3401 //
3402 // FUNCTION NAME:   NvAPI_GPU_GetECCConfigurationInfo
3403 //
3404 //! \fn NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalGpu,
3405 //!                             NV_GPU_ECC_CONFIGURATION_INFO *pECCConfigurationInfo);
3406 //! DESCRIPTION:     This function returns ECC memory configuration information.
3407 //!
3408 //! SUPPORTED OS:  Windows XP and higher
3409 //!
3410 //!
3411 //! TCC_SUPPORTED
3412 //!
3413 //! \param [in]      hPhysicalGpu  A handle identifying the physical GPU for
3414 //!                                which ECC configuration information
3415 //!                               is to be retrieved.
3416 //! \param [out]     pECCConfigurationInfo  A pointer to an ECC
3417 //!                                                configuration structure.
3418 //!
3419 //! \retval ::NVAPI_OK  The request was completed successfully.
3420 //! \retval ::NVAPI_ERROR  An unknown error occurred.
3421 //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE  The provided GPU handle is not a physical GPU handle.
3422 //! \retval ::NVAPI_INVALID_HANDLE  The provided GPU handle is invalid.
3423 //! \retval ::NVAPI_HANDLE_INVALIDATED  The provided GPU handle is no longer valid.
3424 //! \retval ::NVAPI_INVALID_POINTER  An invalid argument pointer was provided.
3425 //! \retval ::NVAPI_NOT_SUPPORTED  The request is not supported.
3426 //! \retval ::NVAPI_API_NOT_INTIALIZED  NvAPI was not yet initialized.
3427 //
3428 ///////////////////////////////////////////////////////////////////////////////
3429 
3430 //! \ingroup gpuecc
3431 //! Used in NvAPI_GPU_GetECCConfigurationInfo().
3432 typedef struct
3433 {
3434     NvU32  version;                 //! Structure version
3435     NvU32  isEnabled : 1;           //! Current ECC configuration stored in non-volatile memory
3436     NvU32  isEnabledByDefault : 1;  //! Factory default ECC configuration (static)
3437 } NV_GPU_ECC_CONFIGURATION_INFO;
3438 
3439 //! \ingroup gpuecc
3440 //! Macro for consstructing the verion field of NV_GPU_ECC_CONFIGURATION_INFO
3441 #define NV_GPU_ECC_CONFIGURATION_INFO_VER MAKE_NVAPI_VERSION(NV_GPU_ECC_CONFIGURATION_INFO,1)
3442 
3443 //! \ingroup gpuecc
3444 NVAPI_INTERFACE NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalGpu,
3445                                                   NV_GPU_ECC_CONFIGURATION_INFO *pECCConfigurationInfo);
3446 
3447 
3448 ///////////////////////////////////////////////////////////////////////////////
3449 //
3450 // FUNCTION NAME:   NvAPI_GPU_SetECCConfiguration
3451 //
3452 //! DESCRIPTION:     This function updates the ECC memory configuration setting.
3453 //!
3454 //! SUPPORTED OS:  Windows XP and higher
3455 //!
3456 //!
3457 //! TCC_SUPPORTED
3458 //!
3459 //! \param [in]      hPhysicalGpu    A handle identifying the physical GPU for
3460 //!                                  which to update the ECC configuration
3461 //!                                  setting.
3462 //! \param [in]      bEnable         The new ECC configuration setting.
3463 //! \param [in]      bEnableImmediately   Request that the new setting take effect immediately.
3464 //!
3465 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
3466 //!          specific meaning for this API, they are listed below.
3467 //!
3468 //! \retval ::NVAPI_INVALID_CONFIGURATION  - Possibly SLI is enabled. Disable SLI and retry.
3469 //! \retval ::NVAPI_INVALID_USER_PRIVILEGE - The caller does not have administrative privileges
3470 //!
3471 //! \ingroup gpuecc
3472 ///////////////////////////////////////////////////////////////////////////////
3473 NVAPI_INTERFACE NvAPI_GPU_SetECCConfiguration(NvPhysicalGpuHandle hPhysicalGpu, NvU8 bEnable,
3474                                               NvU8 bEnableImmediately);
3475 
3476 
3477 
3478 //! \ingroup gpu
3479 typedef struct
3480 {
3481     NvU32  version;              //!< version of this structure
3482     NvU32  width;                //!< width of the input texture
3483     NvU32  height;               //!< height of the input texture
3484     float* blendingTexture;      //!< array of floating values building an intensity RGB texture
3485 } NV_SCANOUT_INTENSITY_DATA_V1;
3486 
3487 //! \ingroup gpu
3488 typedef struct
3489 {
3490     NvU32  version;              //!< version of this structure
3491     NvU32  width;                //!< width of the input texture
3492     NvU32  height;               //!< height of the input texture
3493     float* blendingTexture;      //!< array of floating values building an intensity RGB texture
3494     float* offsetTexture;        //!< array of floating values building an offset texture
3495     NvU32  offsetTexChannels;    //!< number of channels per pixel in the offset texture
3496 } NV_SCANOUT_INTENSITY_DATA_V2;
3497 
3498 typedef NV_SCANOUT_INTENSITY_DATA_V2 NV_SCANOUT_INTENSITY_DATA;
3499 
3500 //! \ingroup gpu
3501 #define NV_SCANOUT_INTENSITY_DATA_VER1    MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_DATA_V1, 1)
3502 #define NV_SCANOUT_INTENSITY_DATA_VER2    MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_DATA_V2, 2)
3503 #define NV_SCANOUT_INTENSITY_DATA_VER      NV_SCANOUT_INTENSITY_DATA_VER2
3504 
3505 ///////////////////////////////////////////////////////////////////////////////
3506 // FUNCTION NAME: NvAPI_GPU_SetScanoutIntensity
3507 //
3508 //!   DESCRIPTION: This API enables and sets up per-pixel intensity feature on the specified display.
3509 //!
3510 //! SUPPORTED OS:  Windows 7 and higher
3511 //!
3512 //!
3513 //! \param [in]   displayId              combined physical display and GPU identifier of the display to apply the intensity control.
3514 //! \param [in]   scanoutIntensityData   the intensity texture info.
3515 //! \param [out]  pbSticky(OUT)           indicates whether the settings will be kept over a reboot.
3516 //!
3517 //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
3518 //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
3519 //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs
3520 //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data.
3521 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_SCANOUT_INTENSITY_DATA structure version mismatch.
3522 //! \retval ::NVAPI_OK Feature enabled.
3523 //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
3524 //!
3525 //! \ingroup gpu
3526 ///////////////////////////////////////////////////////////////////////////////
3527 NVAPI_INTERFACE NvAPI_GPU_SetScanoutIntensity(NvU32 displayId, NV_SCANOUT_INTENSITY_DATA* scanoutIntensityData, int *pbSticky);
3528 
3529 
3530 //! \ingroup gpu
3531 typedef struct _NV_SCANOUT_INTENSITY_STATE_DATA
3532 {
3533     NvU32  version;                                 //!< version of this structure
3534     NvU32  bEnabled;                                //!< intensity is enabled or not
3535 } NV_SCANOUT_INTENSITY_STATE_DATA;
3536 
3537 //! \ingroup gpu
3538 #define NV_SCANOUT_INTENSITY_STATE_VER    MAKE_NVAPI_VERSION(NV_SCANOUT_INTENSITY_STATE_DATA, 1)
3539 
3540 ///////////////////////////////////////////////////////////////////////////////
3541 // FUNCTION NAME: NvAPI_GPU_GetScanoutIntensityState
3542 //
3543 //!   DESCRIPTION: This API queries current state of the intensity feature on the specified display.
3544 //!
3545 //! SUPPORTED OS:  Windows 7 and higher
3546 //!
3547 //!
3548 //! \param [in]     displayId                       combined physical display and GPU identifier of the display to query the configuration.
3549 //! \param [in,out] scanoutIntensityStateData       intensity state data.
3550 //!
3551 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
3552 //!          specific meaning for this API, they are listed below.
3553 //!
3554 //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
3555 //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
3556 //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
3557 //! \retval ::NVAPI_OK Feature enabled.
3558 //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
3559 //!
3560 //! \ingroup gpu
3561 ///////////////////////////////////////////////////////////////////////////////
3562 NVAPI_INTERFACE NvAPI_GPU_GetScanoutIntensityState(__in NvU32 displayId, __inout NV_SCANOUT_INTENSITY_STATE_DATA* scanoutIntensityStateData);
3563 
3564 
3565 //! \ingroup gpu
3566 typedef enum
3567 {
3568     NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLESTRIP_XYUVRQ = 0,
3569     NV_GPU_WARPING_VERTICE_FORMAT_TRIANGLES_XYUVRQ     = 1,
3570 } NV_GPU_WARPING_VERTICE_FORMAT;
3571 
3572 //! \ingroup gpu
3573 typedef struct
3574 {
3575     NvU32  version;                                 //!< version of this structure
3576     float* vertices;                                //!< width of the input texture
3577     NV_GPU_WARPING_VERTICE_FORMAT vertexFormat;     //!< format of the input vertices
3578     int    numVertices;                             //!< number of the input vertices
3579     NvSBox* textureRect;                            //!< rectangle in desktop coordinates describing the source area for the warping
3580 } NV_SCANOUT_WARPING_DATA;
3581 
3582 //! \ingroup gpu
3583 #define NV_SCANOUT_WARPING_VER    MAKE_NVAPI_VERSION(NV_SCANOUT_WARPING_DATA, 1)
3584 
3585 
3586 ///////////////////////////////////////////////////////////////////////////////
3587 // FUNCTION NAME: NvAPI_GPU_SetScanoutWarping
3588 //
3589 //!   DESCRIPTION: This API enables and sets up the warping feature on the specified display.
3590 //!
3591 //! SUPPORTED OS:  Windows 7 and higher
3592 //!
3593 //!
3594 //! \param [in]    displayId               Combined physical display and GPU identifier of the display to apply the intensity control
3595 //! \param [in]    scanoutWarpingData      The warping data info
3596 //! \param [out]   pbSticky                Indicates whether the settings will be kept over a reboot.
3597 //!
3598 //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
3599 //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
3600 //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs
3601 //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input data.
3602 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION NV_SCANOUT_INTENSITY_DATA structure version mismatch.
3603 //! \retval ::NVAPI_OK Feature enabled.
3604 //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
3605 //!
3606 //! \ingroup gpu
3607 ///////////////////////////////////////////////////////////////////////////////
3608 
3609 NVAPI_INTERFACE NvAPI_GPU_SetScanoutWarping(NvU32 displayId, NV_SCANOUT_WARPING_DATA* scanoutWarpingData, int* piMaxNumVertices, int* pbSticky);
3610 
3611 
3612 //! \ingroup gpu
3613 typedef struct _NV_SCANOUT_WARPING_STATE_DATA
3614 {
3615     NvU32  version;                                  //!< version of this structure
3616     NvU32  bEnabled;                                 //!< warping is enabled or not
3617 } NV_SCANOUT_WARPING_STATE_DATA;
3618 
3619 //! \ingroup gpu
3620 #define NV_SCANOUT_WARPING_STATE_VER    MAKE_NVAPI_VERSION(NV_SCANOUT_WARPING_STATE_DATA, 1)
3621 
3622 ///////////////////////////////////////////////////////////////////////////////
3623 // FUNCTION NAME: NvAPI_GPU_GetScanoutWarpingState
3624 //
3625 //!   DESCRIPTION: This API queries current state of the warping feature on the specified display.
3626 //!
3627 //! SUPPORTED OS:  Windows 7 and higher
3628 //!
3629 //!
3630 //! \param [in]     displayId                      combined physical display and GPU identifier of the display to query the configuration.
3631 //! \param [in,out] scanoutWarpingStateData        warping state data.
3632 //!
3633 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
3634 //!          specific meaning for this API, they are listed below.
3635 //!
3636 //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
3637 //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
3638 //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
3639 //! \retval ::NVAPI_OK Feature enabled.
3640 //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
3641 //!
3642 //! \ingroup gpu
3643 ///////////////////////////////////////////////////////////////////////////////
3644 NVAPI_INTERFACE NvAPI_GPU_GetScanoutWarpingState(__in NvU32 displayId, __inout NV_SCANOUT_WARPING_STATE_DATA* scanoutWarpingStateData);
3645 
3646 
3647 ///////////////////////////////////////////////////////////////////////////////
3648 // FUNCTION NAME: NvAPI_GPU_GetScanoutConfiguration
3649 //
3650 //!   DESCRIPTION: This API queries the desktop and scanout portion of the specified display.
3651 //!
3652 //! SUPPORTED OS:  Windows 7 and higher
3653 //!
3654 //!
3655 //! \param [in]     displayId          combined physical display and GPU identifier of the display to query the configuration.
3656 //! \param [in,out] desktopRect        desktop area of the display in desktop coordinates.
3657 //! \param [in,out] scanoutRect        scanout area of the display relative to desktopRect.
3658 //!
3659 //! \retval ::NVAPI_INVALID_ARGUMENT Invalid input parameters.
3660 //! \retval ::NVAPI_API_NOT_INITIALIZED NvAPI not initialized.
3661 //! \retval ::NVAPI_NOT_SUPPORTED Interface not supported by the driver used, or only supported on selected GPUs.
3662 //! \retval ::NVAPI_OK Feature enabled.
3663 //! \retval ::NVAPI_ERROR Miscellaneous error occurred.
3664 //!
3665 //! \ingroup gpu
3666 ///////////////////////////////////////////////////////////////////////////////
3667 NVAPI_INTERFACE NvAPI_GPU_GetScanoutConfiguration(NvU32 displayId, NvSBox* desktopRect, NvSBox* scanoutRect);
3668 
3669 
3670 
3671 //! \ingroup gpu
3672 //! Used in NvAPI_GPU_GetScanoutConfigurationEx().
3673 typedef struct _NV_SCANOUT_INFORMATION
3674 {
3675     NvU32      version;                 //!< Structure version, needs to be initialized with NV_SCANOUT_INFORMATION_VER.
3676 
3677     NvSBox     sourceDesktopRect;       //!< Operating system display device rect in desktop coordinates displayId is scanning out from.
3678     NvSBox     sourceViewportRect;      //!< Area inside the sourceDesktopRect which is scanned out to the display.
3679     NvSBox     targetViewportRect;      //!< Area inside the rect described by targetDisplayWidth/Height sourceViewportRect is scanned out to.
3680     NvU32      targetDisplayWidth;      //!< Horizontal size of the active resolution scanned out to the display.
3681     NvU32      targetDisplayHeight;     //!< Vertical size of the active resolution scanned out to the display.
3682     NvU32      cloneImportance;         //!< If targets are cloned views of the sourceDesktopRect the cloned targets have an imporantce assigned (0:primary,1 secondary,...).
3683     NV_ROTATE  sourceToTargetRotation;  //!< Rotation performed between the sourceViewportRect and the targetViewportRect.
3684 } NV_SCANOUT_INFORMATION;
3685 
3686 #define NV_SCANOUT_INFORMATION_VER  MAKE_NVAPI_VERSION(NV_SCANOUT_INFORMATION,1)
3687 
3688 ///////////////////////////////////////////////////////////////////////////////
3689 // FUNCTION NAME: NvAPI_GPU_GetScanoutConfigurationEx
3690 //
3691 //!   DESCRIPTION: This API queries the desktop and scanout portion of the specified display.
3692 //!
3693 //! SUPPORTED OS:  Windows 7 and higher
3694 //!
3695 //! \since Release: 331
3696 //!
3697 //! \param [in]     displayId            combined physical display and GPU identifier of the display to query the configuration.
3698 //! \param [in,out] pScanoutInformation  desktop area to displayId mapping information.
3699 //!
3700 //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
3701 //!
3702 //! \ingroup gpu
3703 ///////////////////////////////////////////////////////////////////////////////
3704 NVAPI_INTERFACE NvAPI_GPU_GetScanoutConfigurationEx(__in NvU32 displayId, __inout NV_SCANOUT_INFORMATION *pScanoutInformation);
3705 
3706 
3707 //! Used in NvAPI_GPU_GetPerfDecreaseInfo.
3708 //! Bit masks for knowing the exact reason for performance decrease
3709 typedef enum _NVAPI_GPU_PERF_DECREASE
3710 {
3711     NV_GPU_PERF_DECREASE_NONE                        = 0,          //!< No Slowdown detected
3712     NV_GPU_PERF_DECREASE_REASON_THERMAL_PROTECTION   = 0x00000001, //!< Thermal slowdown/shutdown/POR thermal protection
3713     NV_GPU_PERF_DECREASE_REASON_POWER_CONTROL        = 0x00000002, //!< Power capping / pstate cap
3714     NV_GPU_PERF_DECREASE_REASON_AC_BATT              = 0x00000004, //!< AC->BATT event
3715     NV_GPU_PERF_DECREASE_REASON_API_TRIGGERED        = 0x00000008, //!< API triggered slowdown
3716     NV_GPU_PERF_DECREASE_REASON_INSUFFICIENT_POWER   = 0x00000010, //!< Power connector missing
3717     NV_GPU_PERF_DECREASE_REASON_UNKNOWN              = 0x80000000, //!< Unknown reason
3718 } NVAPI_GPU_PERF_DECREASE;
3719 
3720 
3721 ///////////////////////////////////////////////////////////////////////////////
3722 //
3723 // FUNCTION NAME: NvAPI_GPU_GetPerfDecreaseInfo
3724 //
3725 //! DESCRIPTION:   This function retrieves - in NvU32 variable - reasons for the current performance decrease.
3726 //!
3727 //! SUPPORTED OS:  Windows XP and higher
3728 //!
3729 //! \param [in]      hPhysicalGPU    (IN)    - GPU for which performance decrease is to be evaluated.
3730 //! \param [out]  pPerfDecrInfo    (OUT)    - Pointer to a NvU32 variable containing performance decrease info
3731 //!
3732 //! \return      This API can return any of the error codes enumerated in #NvAPI_Status.
3733 //!
3734 //! \ingroup gpu
3735 ///////////////////////////////////////////////////////////////////////////////
3736 NVAPI_INTERFACE NvAPI_GPU_GetPerfDecreaseInfo(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NvU32 *pPerfDecrInfo);
3737 
3738 //! \ingroup gpu
3739 typedef enum _NV_GPU_ILLUMINATION_ATTRIB
3740 {
3741     NV_GPU_IA_LOGO_BRIGHTNESS  = 0,
3742     NV_GPU_IA_SLI_BRIGHTNESS   = 1,
3743 } NV_GPU_ILLUMINATION_ATTRIB;
3744 
3745 
3746 ///////////////////////////////////////////////////////////////////////////////
3747 //
3748 // FUNCTION NAME: NvAPI_GPU_QueryIlluminationSupport
3749 //
3750 //! \fn NvAPI_GPU_QueryIlluminationSupport(__inout  NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM *pIlluminationSupportInfo)
3751 //! DESCRIPTION:   This function reports if the specified illumination attribute is supported.
3752 //!
3753 //! \note Only a single GPU can manage an given attribute on a given HW element,
3754 //!       regardless of how many are attatched. I.E. only one GPU will be used to control
3755 //!       the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached.
3756 //!       You should enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
3757 //!
3758 //! SUPPORTED OS:  Windows Vista and higher
3759 //!
3760 //! \since Version: 300.05
3761 //!
3762 //! \param [in]  hPhysicalGpu        Physical GPU handle
3763 //! \param       Attribute           An enumeration value specifying the Illumination attribute to be querried
3764 //! \param [out] pSupported          A boolean indicating if the attribute is supported.
3765 //!
3766 //! \return See \ref nvapistatus for the list of possible return values.
3767 //
3768 //////////////////////////////////////////////////////////////////////////////
3769 
3770 //! \ingroup gpu
3771 typedef struct _NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1 {
3772 
3773     // IN
3774     NvU32   version;						//!< Version of this structure
3775     NvPhysicalGpuHandle hPhysicalGpu;		//!< The handle of the GPU that you are checking for the specified attribute.
3776                                             //!< note that this is the GPU that is managing the attribute.
3777                                             //!< Only a single GPU can manage an given attribute on a given HW element,
3778                                             //!< regardless of how many are attatched.
3779                                             //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,
3780                                             //!< regardless of how many are physicaly attached.
3781                                             //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
3782     NV_GPU_ILLUMINATION_ATTRIB Attribute;   //!< An enumeration value specifying the Illumination attribute to be querried.
3783                                             //!<     refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB.
3784 
3785     // OUT
3786     NvU32    bSupported;                    //!< A boolean indicating if the attribute is supported.
3787 
3788 } NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1;
3789 
3790 //! \ingroup gpu
3791 typedef NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1      NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM;
3792 //! \ingroup gpu
3793 #define NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER_1   MAKE_NVAPI_VERSION(NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_V1,1)
3794 //! \ingroup gpu
3795 #define NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER     NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM_VER_1
3796 
3797 //! \ingroup gpu
3798 NVAPI_INTERFACE NvAPI_GPU_QueryIlluminationSupport(__inout NV_GPU_QUERY_ILLUMINATION_SUPPORT_PARM *pIlluminationSupportInfo);
3799 
3800 
3801 
3802 
3803 ///////////////////////////////////////////////////////////////////////////////
3804 //
3805 // FUNCTION NAME: NvAPI_GPU_GetIllumination
3806 //
3807 //! \fn NvAPI_GPU_GetIllumination(NV_GPU_GET_ILLUMINATION_PARM *pIlluminationInfo)
3808 //! DESCRIPTION:   This function reports value of the specified illumination attribute.
3809 //!
3810 //! \note Only a single GPU can manage an given attribute on a given HW element,
3811 //!       regardless of how many are attatched. I.E. only one GPU will be used to control
3812 //!       the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached.
3813 //!       You should enumerate thru the GPUs with the \ref NvAPI_GPU_QueryIlluminationSupport call to
3814 //!       determine which GPU is managing the attribute.
3815 //!
3816 //! SUPPORTED OS:  Windows Vista and higher
3817 //!
3818 //! \since Version: 300.05
3819 //!
3820 //! \param [in]  hPhysicalGpu        Physical GPU handle
3821 //! \param       Attribute           An enumeration value specifying the Illumination attribute to be querried
3822 //! \param [out] Value               A DWORD containing the current value for the specified attribute.
3823 //!                                  This is specified as a percentage of the full range of the attribute
3824 //!                                  (0-100; 0 = off, 100 = full brightness)
3825 //!
3826 //! \return See \ref nvapistatus for the list of possible return values. Return values of special interest are:
3827 //!             NVAPI_INVALID_ARGUMENT The specified attibute is not known to the driver.
3828 //!             NVAPI_NOT_SUPPORTED:   The specified attribute is not supported on the specified GPU
3829 //
3830 //////////////////////////////////////////////////////////////////////////////
3831 
3832 //! \ingroup gpu
3833 typedef struct _NV_GPU_GET_ILLUMINATION_PARM_V1 {
3834 
3835     // IN
3836     NvU32   version;						//!< Version of this structure
3837     NvPhysicalGpuHandle hPhysicalGpu;		//!< The handle of the GPU that you are checking for the specified attribute.
3838                                             //!< Note that this is the GPU that is managing the attribute.
3839                                             //!< Only a single GPU can manage an given attribute on a given HW element,
3840                                             //!< regardless of how many are attatched.
3841                                             //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,
3842                                             //!< regardless of how many are physicaly attached.
3843                                             //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
3844     NV_GPU_ILLUMINATION_ATTRIB Attribute;   //!< An enumeration value specifying the Illumination attribute to be querried.
3845                                             //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB.
3846 
3847     // OUT
3848     NvU32    Value;                         //!< A DWORD that will contain the current value of the specified attribute.
3849                                             //! This is specified as a percentage of the full range of the attribute
3850                                             //! (0-100; 0 = off, 100 = full brightness)
3851 
3852 } NV_GPU_GET_ILLUMINATION_PARM_V1;
3853 
3854 //! \ingroup gpu
3855 typedef NV_GPU_GET_ILLUMINATION_PARM_V1      NV_GPU_GET_ILLUMINATION_PARM;
3856 //! \ingroup gpu
3857 #define NV_GPU_GET_ILLUMINATION_PARM_VER_1   MAKE_NVAPI_VERSION(NV_GPU_GET_ILLUMINATION_PARM_V1,1)
3858 //! \ingroup gpu
3859 #define NV_GPU_GET_ILLUMINATION_PARM_VER     NV_GPU_GET_ILLUMINATION_PARM_VER_1
3860 
3861 //! \ingroup gpu
3862 NVAPI_INTERFACE NvAPI_GPU_GetIllumination(NV_GPU_GET_ILLUMINATION_PARM *pIlluminationInfo);
3863 
3864 
3865 
3866 
3867 ///////////////////////////////////////////////////////////////////////////////
3868 //
3869 // FUNCTION NAME: NvAPI_GPU_SetIllumination
3870 //
3871 //! \fn NvAPI_GPU_SetIllumination(NV_GPU_SET_ILLUMINATION_PARM *pIlluminationInfo)
3872 //! DESCRIPTION:   This function sets the value of the specified illumination attribute.
3873 //!
3874 //! \note Only a single GPU can manage an given attribute on a given HW element,
3875 //!       regardless of how many are attatched. I.E. only one GPU will be used to control
3876 //!       the brightness of the LED on an SLI bridge, regardless of how many are physicaly attached.
3877 //!       You should enumerate thru the GPUs with the \ref NvAPI_GPU_QueryIlluminationSupport call to
3878 //!       determine which GPU is managing the attribute.
3879 //!
3880 //! SUPPORTED OS:  Windows Vista and higher
3881 //!
3882 //! \since Version: 300.05
3883 //!
3884 //! \param [in]  hPhysicalGpu        Physical GPU handle
3885 //! \param       Attribute           An enumeration value specifying the Illumination attribute to be set
3886 //! \param       Value               The new value for the specified attribute.
3887 //!                                  This should be specified as a percentage of the full range of the attribute
3888 //!                                  (0-100; 0 = off, 100 = full brightness)
3889 //!                                  If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned.
3890 //!
3891 //! \return See \ref nvapistatus for the list of possible return values. Return values of special interest are:
3892 //!             NVAPI_INVALID_ARGUMENT	The specified attibute is not known to the driver, or the specified value is out of range.
3893 //!             NVAPI_NOT_SUPPORTED     The specified attribute is not supported on the specified GPU.
3894 //
3895 ///////////////////////////////////////////////////////////////////////////////
3896 
3897 //! \ingroup gpu
3898 typedef struct _NV_GPU_SET_ILLUMINATION_PARM_V1 {
3899 
3900     // IN
3901     NvU32   version;						//!< Version of this structure
3902     NvPhysicalGpuHandle hPhysicalGpu;		//!< The handle of the GPU that you are checking for the specified attribute.
3903                                             //!< Note that this is the GPU that is managing the attribute.
3904                                             //!< Only a single GPU can manage an given attribute on a given HW element,
3905                                             //!< regardless of how many are attatched.
3906                                             //!< I.E. only one GPU will be used to control the brightness of the LED on an SLI bridge,
3907                                             //!< regardless of how many are physicaly attached.
3908                                             //!< You enumerate thru the GPUs with this call to determine which GPU is managing the attribute.
3909     NV_GPU_ILLUMINATION_ATTRIB Attribute;   //!< An enumeration value specifying the Illumination attribute to be querried.
3910                                             //!< refer to enum \ref NV_GPU_ILLUMINATION_ATTRIB.
3911     NvU32    Value;                         //!< A DWORD containing the new value for the specified attribute.
3912                                             //!< This should be specified as a percentage of the full range of the attribute
3913                                             //!< (0-100; 0 = off, 100 = full brightness)
3914                                             //!< If a value is specified outside this range, NVAPI_INVALID_ARGUMENT will be returned.
3915 
3916     // OUT
3917 
3918 } NV_GPU_SET_ILLUMINATION_PARM_V1;
3919 
3920 //! \ingroup gpu
3921 typedef NV_GPU_SET_ILLUMINATION_PARM_V1      NV_GPU_SET_ILLUMINATION_PARM;
3922 //! \ingroup gpu
3923 #define NV_GPU_SET_ILLUMINATION_PARM_VER_1   MAKE_NVAPI_VERSION(NV_GPU_SET_ILLUMINATION_PARM_V1,1)
3924 //! \ingroup gpu
3925 #define NV_GPU_SET_ILLUMINATION_PARM_VER     NV_GPU_SET_ILLUMINATION_PARM_VER_1
3926 
3927 //! \ingroup gpu
3928 NVAPI_INTERFACE NvAPI_GPU_SetIllumination(NV_GPU_SET_ILLUMINATION_PARM *pIlluminationInfo);
3929 
3930 
3931 
3932 ///////////////////////////////////////////////////////////////////////////////
3933 //
3934 // FUNCTION NAME: NvAPI_EnumNvidiaDisplayHandle
3935 //
3936 //! This function returns the handle of the NVIDIA display specified by the enum
3937 //!                index (thisEnum). The client should keep enumerating until it
3938 //!                returns NVAPI_END_ENUMERATION.
3939 //!
3940 //!                Note: Display handles can get invalidated on a modeset, so the calling applications need to
3941 //!                renum the handles after every modeset.
3942 //!
3943 //! SUPPORTED OS:  Windows XP and higher
3944 //!
3945 //!
3946 //! \since Release: 80
3947 //!
3948 //! \param [in]  thisEnum      The index of the NVIDIA display.
3949 //! \param [out] pNvDispHandle Pointer to the NVIDIA display handle.
3950 //!
3951 //! \retval NVAPI_INVALID_ARGUMENT        Either the handle pointer is NULL or enum index too big
3952 //! \retval NVAPI_OK                      Return a valid NvDisplayHandle based on the enum index
3953 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA device found in the system
3954 //! \retval NVAPI_END_ENUMERATION         No more display device to enumerate
3955 //! \ingroup disphandle
3956 ///////////////////////////////////////////////////////////////////////////////
3957 NVAPI_INTERFACE NvAPI_EnumNvidiaDisplayHandle(NvU32 thisEnum, NvDisplayHandle *pNvDispHandle);
3958 
3959 
3960 
3961 
3962 
3963 ///////////////////////////////////////////////////////////////////////////////
3964 //
3965 // FUNCTION NAME: NvAPI_EnumNvidiaUnAttachedDisplayHandle
3966 //
3967 //! This function returns the handle of the NVIDIA unattached display specified by the enum
3968 //!                index (thisEnum). The client should keep enumerating until it
3969 //!                returns error.
3970 //!                Note: Display handles can get invalidated on a modeset, so the calling applications need to
3971 //!                renum the handles after every modeset.
3972 //!
3973 //! SUPPORTED OS:  Windows XP and higher
3974 //!
3975 //!
3976 //! \since Release: 80
3977 //!
3978 //! \param [in]  thisEnum                  The index of the NVIDIA display.
3979 //! \param [out] pNvUnAttachedDispHandle   Pointer to the NVIDIA display handle of the unattached display.
3980 //!
3981 //! \retval NVAPI_INVALID_ARGUMENT         Either the handle pointer is NULL or enum index too big
3982 //! \retval NVAPI_OK                       Return a valid NvDisplayHandle based on the enum index
3983 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA device found in the system
3984 //! \retval NVAPI_END_ENUMERATION          No more display device to enumerate.
3985 //! \ingroup disphandle
3986 ///////////////////////////////////////////////////////////////////////////////
3987 NVAPI_INTERFACE NvAPI_EnumNvidiaUnAttachedDisplayHandle(NvU32 thisEnum, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle);
3988 
3989 
3990 
3991 ///////////////////////////////////////////////////////////////////////////////
3992 //
3993 // FUNCTION NAME: NvAPI_CreateDisplayFromUnAttachedDisplay
3994 //
3995 //! This function converts the unattached display handle to an active attached display handle.
3996 //!
3997 //! At least one GPU must be present in the system and running an NVIDIA display driver.
3998 //!
3999 //! SUPPORTED OS:  Windows XP and higher
4000 //!
4001 //!
4002 //! \since Release: 80
4003 //!
4004 //! \retval NVAPI_INVALID_ARGUMENT         hNvUnAttachedDisp is not valid or pNvDisplay is NULL.
4005 //! \retval NVAPI_OK                       One or more handles were returned
4006 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
4007 //! \ingroup dispcontrol
4008 ///////////////////////////////////////////////////////////////////////////////
4009 NVAPI_INTERFACE NvAPI_CreateDisplayFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvDisplayHandle *pNvDisplay);
4010 
4011 ///////////////////////////////////////////////////////////////////////////////
4012 //
4013 // FUNCTION NAME: NvAPI_GetAssociatedNVidiaDisplayHandle
4014 //
4015 //!  This function returns the handle of the NVIDIA display that is associated
4016 //!  with the given display "name" (such as "\\.\DISPLAY1").
4017 //!
4018 //! SUPPORTED OS:  Windows XP and higher
4019 //!
4020 //!
4021 //! \since Release: 80
4022 //!
4023 //! \retval NVAPI_INVALID_ARGUMENT         Either argument is NULL
4024 //! \retval NVAPI_OK                      *pNvDispHandle is now valid
4025 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA device maps to that display name
4026 //! \ingroup disphandle
4027 ///////////////////////////////////////////////////////////////////////////////
4028 NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayHandle(const char *szDisplayName, NvDisplayHandle *pNvDispHandle);
4029 
4030 
4031 ///////////////////////////////////////////////////////////////////////////////
4032 //
4033 // FUNCTION NAME: NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle
4034 //
4035 //!   DESCRIPTION: This function returns the handle of an unattached NVIDIA display that is
4036 //!                associated with the given display name (such as "\\DISPLAY1").
4037 //!
4038 //! SUPPORTED OS:  Windows XP and higher
4039 //!
4040 //!
4041 //! \since Release: 185
4042 //!
4043 //! \retval ::NVAPI_INVALID_ARGUMENT          Either argument is NULL.
4044 //! \retval ::NVAPI_OK                       *pNvUnAttachedDispHandle is now valid.
4045 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND   No NVIDIA device maps to that display name.
4046 //!
4047 //! \ingroup disphandle
4048 ///////////////////////////////////////////////////////////////////////////////
4049 NVAPI_INTERFACE NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle(const char *szDisplayName, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle);
4050 
4051 
4052 
4053 ///////////////////////////////////////////////////////////////////////////////
4054 //
4055 // FUNCTION NAME: NvAPI_GetAssociatedNVidiaDisplayName
4056 //
4057 //!  For a given NVIDIA display handle, this function returns a string (such as "\\.\DISPLAY1") to identify the display.
4058 //!
4059 //! SUPPORTED OS:  Windows XP and higher
4060 //!
4061 //!
4062 //! \since Release: 80
4063 //!
4064 //! \retval NVAPI_INVALID_ARGUMENT          Either argument is NULL
4065 //! \retval NVAPI_OK                       *pNvDispHandle is now valid
4066 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND   No NVIDIA device maps to that display name
4067 //! \ingroup dispcontrol
4068 ///////////////////////////////////////////////////////////////////////////////
4069 NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayName(NvDisplayHandle NvDispHandle, NvAPI_ShortString szDisplayName);
4070 
4071 ///////////////////////////////////////////////////////////////////////////////
4072 //
4073 // FUNCTION NAME: NvAPI_GetUnAttachedAssociatedDisplayName
4074 //
4075 //!  This function returns the display name given, for example, "\\DISPLAY1", using the unattached NVIDIA display handle
4076 //!
4077 //! SUPPORTED OS:  Windows XP and higher
4078 //!
4079 //!
4080 //! \since Release: 95
4081 //!
4082 //! \retval NVAPI_INVALID_ARGUMENT          Either argument is NULL
4083 //! \retval NVAPI_OK                       *pNvDispHandle is now valid
4084 //! \retval NVAPI_NVIDIA_DEVICE_NOT_FOUND   No NVIDIA device maps to that display name
4085 //! \ingroup dispcontrol
4086 ///////////////////////////////////////////////////////////////////////////////
4087 NVAPI_INTERFACE NvAPI_GetUnAttachedAssociatedDisplayName(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvAPI_ShortString szDisplayName);
4088 
4089 
4090 ///////////////////////////////////////////////////////////////////////////////
4091 //
4092 // FUNCTION NAME: NvAPI_EnableHWCursor
4093 //
4094 //!  This function enables hardware cursor support
4095 //!
4096 //! SUPPORTED OS:  Windows XP
4097 //!
4098 //!
4099 //!
4100 //! \since Release: 80
4101 //!
4102 //! \return NVAPI_ERROR or NVAPI_OK
4103 //! \ingroup dispcontrol
4104 ///////////////////////////////////////////////////////////////////////////////
4105 NVAPI_INTERFACE NvAPI_EnableHWCursor(NvDisplayHandle hNvDisplay);
4106 
4107 ///////////////////////////////////////////////////////////////////////////////
4108 //
4109 // FUNCTION NAME: NvAPI_DisableHWCursor
4110 //
4111 //! This function disables hardware cursor support
4112 //!
4113 //! SUPPORTED OS:  Windows XP
4114 //!
4115 //!
4116 //! \since Release: 80
4117 //!
4118 //! \return  NVAPI_ERROR or NVAPI_OK
4119 //! \ingroup dispcontrol
4120 ///////////////////////////////////////////////////////////////////////////////
4121 NVAPI_INTERFACE NvAPI_DisableHWCursor(NvDisplayHandle hNvDisplay);
4122 
4123 ///////////////////////////////////////////////////////////////////////////////
4124 //
4125 // FUNCTION NAME: NvAPI_GetVBlankCounter
4126 //
4127 //!  This function gets the V-blank counter
4128 //!
4129 //! SUPPORTED OS:  Windows XP and higher
4130 //!
4131 //!
4132 //! \since Release: 80
4133 //!
4134 //! \return NVAPI_ERROR or NVAPI_OK
4135 //! \ingroup dispcontrol
4136 ///////////////////////////////////////////////////////////////////////////////
4137 NVAPI_INTERFACE NvAPI_GetVBlankCounter(NvDisplayHandle hNvDisplay, NvU32 *pCounter);
4138 
4139 ///////////////////////////////////////////////////////////////////////////////
4140 // FUNCTION NAME:  NvAPI_SetRefreshRateOverride
4141 //
4142 //!  This function overrides the refresh rate on the given display/outputsMask.
4143 //!  The new refresh rate can be applied right away in this API call or deferred to be applied with the
4144 //!  next OS modeset. The override is good for only one modeset (regardless whether it's deferred or immediate).
4145 //!
4146 //!
4147 //! SUPPORTED OS:  Windows XP
4148 //!
4149 //!
4150 //! \since Release: 80
4151 //!
4152 //!  \param [in] hNvDisplay    The NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle
4153 //!                           enumerated from NvAPI_EnumNVidiaDisplayHandle().
4154 //!  \param [in] outputsMask  A set of bits that identify all target outputs which are associated with the NVIDIA
4155 //!                           display handle to apply the refresh rate override. When SLI is enabled, the
4156 //!                           outputsMask only applies to the GPU that is driving the display output.
4157 //!  \param [in] refreshRate  The override value. "0.0" means cancel the override.
4158 //!  \param [in] bSetDeferred
4159 //!              - "0": Apply the refresh rate override immediately in this API call.\p
4160 //!              - "1": Apply refresh rate at the next OS modeset.
4161 //!
4162 //!  \retval  NVAPI_INVALID_ARGUMENT hNvDisplay or outputsMask is invalid
4163 //!  \retval  NVAPI_OK               The refresh rate override is correct set
4164 //!  \retval  NVAPI_ERROR            The operation failed
4165 //!  \ingroup dispcontrol
4166 ///////////////////////////////////////////////////////////////////////////////
4167 NVAPI_INTERFACE NvAPI_SetRefreshRateOverride(NvDisplayHandle hNvDisplay, NvU32 outputsMask, float refreshRate, NvU32 bSetDeferred);
4168 
4169 ///////////////////////////////////////////////////////////////////////////////
4170 //
4171 // FUNCTION NAME: NvAPI_GetAssociatedDisplayOutputId
4172 //
4173 //! This function gets the active outputId associated with the display handle.
4174 //!
4175 //! SUPPORTED OS:  Windows XP and higher
4176 //!
4177 //!
4178 //! \since Release: 90
4179 //!
4180 //! \param [in]  hNvDisplay  NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
4181 //! \param [out] outputId    The active display output ID associated with the selected display handle hNvDisplay.
4182 //!                          The outputid will have only one bit set. In the case of Clone or Span mode, this will indicate the
4183 //!                          display outputId of the primary display that the GPU is driving. See \ref handles.
4184 //!
4185 //! \retval  NVAPI_OK                      Call successful.
4186 //! \retval  NVAPI_NVIDIA_DEVICE_NOT_FOUND No NVIDIA GPU driving a display was found.
4187 //! \retval  NVAPI_EXPECTED_DISPLAY_HANDLE hNvDisplay is not a valid display handle.
4188 //! \ingroup dispcontrol
4189 ///////////////////////////////////////////////////////////////////////////////
4190 NVAPI_INTERFACE NvAPI_GetAssociatedDisplayOutputId(NvDisplayHandle hNvDisplay, NvU32 *pOutputId);
4191 
4192 
4193 //! \ingroup dispcontrol
4194 //! Used in NvAPI_GetDisplayPortInfo().
4195 typedef struct
4196 {
4197     NvU32               version;                     //!< Structure version
4198     NvU32               dpcd_ver;                    //!< DPCD version of the monitor
4199     NV_DP_LINK_RATE     maxLinkRate;                 //!< Maximum supported link rate
4200     NV_DP_LANE_COUNT    maxLaneCount;                //!< Maximum supported lane count
4201     NV_DP_LINK_RATE     curLinkRate;                 //!< Current link rate
4202     NV_DP_LANE_COUNT    curLaneCount;                //!< Current lane count
4203     NV_DP_COLOR_FORMAT  colorFormat;                 //!< Current color format
4204     NV_DP_DYNAMIC_RANGE dynamicRange;                //!< Dynamic range
4205     NV_DP_COLORIMETRY   colorimetry;                 //!< Ignored in RGB space
4206     NV_DP_BPC           bpc;                         //!< Current bit-per-component;
4207     NvU32               isDp                   : 1;  //!< If the monitor is driven by a DisplayPort
4208     NvU32               isInternalDp           : 1;  //!< If the monitor is driven by an NV Dp transmitter
4209     NvU32               isColorCtrlSupported   : 1;  //!< If the color format change is supported
4210     NvU32               is6BPCSupported        : 1;  //!< If 6 bpc is supported
4211     NvU32               is8BPCSupported        : 1;  //!< If 8 bpc is supported
4212     NvU32               is10BPCSupported       : 1;  //!< If 10 bpc is supported
4213     NvU32               is12BPCSupported       : 1;  //!< If 12 bpc is supported
4214     NvU32               is16BPCSupported       : 1;  //!< If 16 bpc is supported
4215     NvU32               isYCrCb422Supported    : 1;  //!< If YCrCb422 is supported
4216     NvU32               isYCrCb444Supported    : 1;  //!< If YCrCb444 is supported
4217 
4218  } NV_DISPLAY_PORT_INFO;
4219 
4220 //! Macro for constructing the version field of NV_DISPLAY_PORT_INFO.
4221 #define NV_DISPLAY_PORT_INFO_VER  MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO,1)
4222 
4223 ///////////////////////////////////////////////////////////////////////////////
4224 // FUNCTION NAME:   NvAPI_GetDisplayPortInfo
4225 //
4226 //! \fn NvAPI_GetDisplayPortInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_DISPLAY_PORT_INFO *pInfo)
4227 //! DESCRIPTION:     This function returns the current DisplayPort-related information on the specified device (monitor).
4228 //!
4229 //! SUPPORTED OS:  Windows XP and higher
4230 //!
4231 //!
4232 //! \since Release: 165
4233 //!
4234 //! \param [in]     hvDisplay     NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
4235 //!                               This parameter is ignored when the outputId is a NvAPI displayId.
4236 //! \param [in]     outputId      This can either be the connection bit mask or the NvAPI displayId. When the legacy connection bit mask is passed,
4237 //!                               it should have exactly 1 bit set to indicate a single display. If it's "0" then the default outputId from
4238 //!                               NvAPI_GetAssociatedDisplayOutputId() will be used. See \ref handles.
4239 //! \param [out]    pInfo         The DisplayPort information
4240 //!
4241 //! \retval         NVAPI_OK                Completed request
4242 //! \retval         NVAPI_ERROR             Miscellaneous error occurred
4243 //! \retval         NVAPI_INVALID_ARGUMENT  Invalid input parameter.
4244 //
4245 ///////////////////////////////////////////////////////////////////////////////
4246 //! \ingroup        dispcontrol
4247 NVAPI_INTERFACE NvAPI_GetDisplayPortInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_DISPLAY_PORT_INFO *pInfo);
4248 
4249 ///////////////////////////////////////////////////////////////////////////////
4250 // FUNCTION NAME:   NvAPI_SetDisplayPort
4251 //
4252 //! \fn NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg)
4253 //! DESCRIPTION:     This function sets up DisplayPort-related configurations.
4254 //!
4255 //! SUPPORTED OS:  Windows XP and higher
4256 //!
4257 //!
4258 //! \since Release:   165
4259 //!
4260 //! \param [in]       hNvDisplay  NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from
4261 //!                               NvAPI_EnumNVidiaDisplayHandle().
4262 //! \param [in]       outputId    This display output ID, when it's "0" it means the default outputId generated from the return of
4263 //!                               NvAPI_GetAssociatedDisplayOutputId(). See \ref handles.
4264 //! \param [in]       pCfg        The display port config structure. If pCfg is NULL, it means to use the driver's default value to setup.
4265 //!
4266 //! \retval           NVAPI_OK                Completed request
4267 //! \retval           NVAPI_ERROR             Miscellaneous error occurred
4268 //! \retval           NVAPI_INVALID_ARGUMENT  Invalid input parameter
4269 ///////////////////////////////////////////////////////////////////////////////
4270 
4271 
4272 //! \ingroup dispcontrol
4273 //! DisplayPort configuration settings - used in NvAPI_SetDisplayPort().
4274 typedef struct
4275 {
4276     NvU32               version;                     //!< Structure version - 2 is the latest
4277     NV_DP_LINK_RATE     linkRate;                    //!< Link rate
4278     NV_DP_LANE_COUNT    laneCount;                   //!< Lane count
4279     NV_DP_COLOR_FORMAT  colorFormat;                 //!< Color format to set
4280     NV_DP_DYNAMIC_RANGE dynamicRange;                //!< Dynamic range
4281     NV_DP_COLORIMETRY   colorimetry;                 //!< Ignored in RGB space
4282     NV_DP_BPC           bpc;                         //!< Bit-per-component
4283     NvU32               isHPD               : 1;     //!< If the control panel is making this call due to HPD
4284     NvU32               isSetDeferred       : 1;     //!< Requires an OS modeset to finalize the setup if set
4285     NvU32               isChromaLpfOff      : 1;     //!< Force the chroma low_pass_filter to be off
4286     NvU32               isDitherOff         : 1;     //!< Force to turn off dither
4287     NvU32               testLinkTrain       : 1;     //!< If testing mode, skip validation
4288     NvU32               testColorChange     : 1;     //!< If testing mode, skip validation
4289 
4290 } NV_DISPLAY_PORT_CONFIG;
4291 
4292 //! \addtogroup dispcontrol
4293 //! @{
4294 //! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG
4295 #define NV_DISPLAY_PORT_CONFIG_VER   MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2)
4296 //! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG
4297 #define NV_DISPLAY_PORT_CONFIG_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,1)
4298 //! Macro for constructing the version field of NV_DISPLAY_PORT_CONFIG
4299 #define NV_DISPLAY_PORT_CONFIG_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2)
4300 //! @}
4301 
4302 
4303 //! \ingroup          dispcontrol
4304 NVAPI_INTERFACE NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg);
4305 
4306 
4307 
4308 
4309 
4310 
4311 
4312 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4313 
4314 ///////////////////////////////////////////////////////////////////////////////
4315 // FUNCTION NAME:   NvAPI_GetHDMISupportInfo
4316 //
4317 //! \fn NvAPI_GetHDMISupportInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_HDMI_SUPPORT_INFO *pInfo)
4318 //!   This API returns the current infoframe data on the specified device(monitor).
4319 //!
4320 //! SUPPORTED OS:  Windows Vista and higher
4321 //!
4322 //!
4323 //! \since Release: 95
4324 //!
4325 //! \param [in]  hvDisplay  NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
4326 //!                         This parameter is ignored when the outputId is a NvAPI displayId.
4327 //! \param [in]  outputId   This can either be the connection bit mask or the NvAPI displayId. When the legacy connection bit mask is passed,
4328 //!                         it should have exactly 1 bit set to indicate a single display. If it's "0" then the default outputId from
4329 //!                         NvAPI_GetAssociatedDisplayOutputId() will be used. See \ref handles.
4330 //! \param [out] pInfo      The monitor and GPU's HDMI support info
4331 //!
4332 //! \retval  NVAPI_OK                Completed request
4333 //! \retval  NVAPI_ERROR             Miscellaneous error occurred
4334 //! \retval  NVAPI_INVALID_ARGUMENT  Invalid input parameter.
4335 ///////////////////////////////////////////////////////////////////////////////
4336 
4337 //! \ingroup dispcontrol
4338 //! Used in NvAPI_GetHDMISupportInfo().
4339 typedef struct
4340 {
4341     NvU32      version;                     //!< Structure version
4342     NvU32      isGpuHDMICapable       : 1;  //!< If the GPU can handle HDMI
4343     NvU32      isMonUnderscanCapable  : 1;  //!< If the monitor supports underscan
4344     NvU32      isMonBasicAudioCapable : 1;  //!< If the monitor supports basic audio
4345     NvU32      isMonYCbCr444Capable   : 1;  //!< If YCbCr 4:4:4 is supported
4346     NvU32      isMonYCbCr422Capable   : 1;  //!< If YCbCr 4:2:2 is supported
4347     NvU32      isMonxvYCC601Capable   : 1;  //!< If xvYCC 601 is supported
4348     NvU32      isMonxvYCC709Capable   : 1;  //!< If xvYCC 709 is supported
4349     NvU32      isMonHDMI              : 1;  //!< If the monitor is HDMI (with IEEE's HDMI registry ID)
4350     NvU32      EDID861ExtRev;               //!< Revision number of the EDID 861 extension
4351  } NV_HDMI_SUPPORT_INFO;
4352 
4353 
4354 //! \ingroup dispcontrol
4355 #define NV_HDMI_SUPPORT_INFO_VER  MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO,1)
4356 
4357 
4358 
4359 //! \ingroup dispcontrol
4360 NVAPI_INTERFACE NvAPI_GetHDMISupportInfo(__in_opt NvDisplayHandle hNvDisplay, __in NvU32 outputId, __inout NV_HDMI_SUPPORT_INFO *pInfo);
4361 
4362 
4363 //! \ingroup dispcontrol
4364 
4365 typedef enum
4366 {
4367     NV_INFOFRAME_CMD_GET_DEFAULT = 0,     //!< Returns the fields in the infoframe with values set by the manufacturer - NVIDIA/OEM.
4368     NV_INFOFRAME_CMD_RESET,               //!< Sets the fields in the infoframe to auto, and infoframe to the default infoframe for use in a set.
4369     NV_INFOFRAME_CMD_GET,                 //!< Get the current infoframe state.
4370     NV_INFOFRAME_CMD_SET,                 //!< Set the current infoframe state (flushed to the monitor), the values are one time and do not persist.
4371     NV_INFOFRAME_CMD_GET_OVERRIDE,        //!< Get the override infoframe state, non-override fields will be set to value = AUTO, overridden fields will have the current override values.
4372     NV_INFOFRAME_CMD_SET_OVERRIDE,        //!< Set the override infoframe state, non-override fields will be set to value = AUTO, other values indicate override; persist across modeset/reboot
4373     NV_INFOFRAME_CMD_GET_PROPERTY,        //!< get properties associated with infoframe (each of the infoframe type will have properties)
4374     NV_INFOFRAME_CMD_SET_PROPERTY,        //!< set properties associated with infoframe
4375 } NV_INFOFRAME_CMD;
4376 
4377 
4378 typedef enum
4379 {
4380     NV_INFOFRAME_PROPERTY_MODE_AUTO           = 0, //!< Driver determines whether to send infoframes.
4381     NV_INFOFRAME_PROPERTY_MODE_ENABLE,             //!< Driver always sends infoframe.
4382     NV_INFOFRAME_PROPERTY_MODE_DISABLE,            //!< Driver never sends infoframe.
4383     NV_INFOFRAME_PROPERTY_MODE_ALLOW_OVERRIDE,     //!< Driver only sends infoframe when client requests it via infoframe escape call.
4384 } NV_INFOFRAME_PROPERTY_MODE;
4385 
4386 
4387 //! Returns whether the current monitor is in blacklist or force this monitor to be in blacklist.
4388 typedef enum
4389 {
4390     NV_INFOFRAME_PROPERTY_BLACKLIST_FALSE = 0,
4391     NV_INFOFRAME_PROPERTY_BLACKLIST_TRUE,
4392 } NV_INFOFRAME_PROPERTY_BLACKLIST;
4393 
4394 typedef struct
4395 {
4396     NvU32 mode      :  4;
4397     NvU32 blackList :  2;
4398     NvU32 reserved  : 10;
4399     NvU32 version   :  8;
4400     NvU32 length    :  8;
4401 } NV_INFOFRAME_PROPERTY;
4402 
4403 //! Byte1 related
4404 typedef enum
4405 {
4406     NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NODATA    = 0,
4407     NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_OVERSCAN,
4408     NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_UNDERSCAN,
4409     NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_FUTURE,
4410     NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_AUTO      = 7
4411 } NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO;
4412 
4413 
4414 typedef enum
4415 {
4416     NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NOT_PRESENT         = 0,
4417     NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_VERTICAL_PRESENT,
4418     NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_HORIZONTAL_PRESENT,
4419     NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_BOTH_PRESENT,
4420     NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_AUTO                = 7
4421 } NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA;
4422 
4423 typedef enum
4424 {
4425     NV_INFOFRAME_FIELD_VALUE_AVI_AFI_ABSENT   = 0,
4426     NV_INFOFRAME_FIELD_VALUE_AVI_AFI_PRESENT,
4427     NV_INFOFRAME_FIELD_VALUE_AVI_AFI_AUTO     = 3
4428 } NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO;
4429 
4430 
4431 typedef enum
4432 {
4433     NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_RGB      = 0,
4434     NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr422,
4435     NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr444,
4436     NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_FUTURE,
4437     NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_AUTO     = 7
4438 } NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT;
4439 
4440 typedef enum
4441 {
4442     NV_INFOFRAME_FIELD_VALUE_AVI_F17_FALSE = 0,
4443     NV_INFOFRAME_FIELD_VALUE_AVI_F17_TRUE,
4444     NV_INFOFRAME_FIELD_VALUE_AVI_F17_AUTO = 3
4445 } NV_INFOFRAME_FIELD_VALUE_AVI_F17;
4446 
4447 //! Byte2 related
4448 typedef enum
4449 {
4450     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NO_AFD           = 0,
4451     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE01,
4452     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE02,
4453     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE03,
4454     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_LETTERBOX_GT16x9,
4455     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE05,
4456     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE06,
4457     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE07,
4458     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_EQUAL_CODEDFRAME = 8,
4459     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_4x3,
4460     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_16x9,
4461     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_14x9,
4462     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE12,
4463     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_4x3_ON_14x9,
4464     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_14x9,
4465     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_4x3,
4466     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_AUTO             = 31,
4467 } NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION;
4468 
4469 
4470 typedef enum
4471 {
4472     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NO_DATA = 0,
4473     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_4x3,
4474     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_16x9,
4475     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_FUTURE,
4476     NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_AUTO    = 7
4477 } NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME;
4478 
4479 typedef enum
4480 {
4481     NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NO_DATA                   = 0,
4482     NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_SMPTE_170M,
4483     NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_ITUR_BT709,
4484     NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_USE_EXTENDED_COLORIMETRY,
4485     NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_AUTO                      = 7
4486 } NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY;
4487 
4488 //! Byte 3 related
4489 typedef enum
4490 {
4491     NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NO_DATA    = 0,
4492     NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_HORIZONTAL,
4493     NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_VERTICAL,
4494     NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_BOTH,
4495     NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_AUTO       = 7
4496 } NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING;
4497 
4498 typedef enum
4499 {
4500     NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_DEFAULT       = 0,
4501     NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_LIMITED_RANGE,
4502     NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_FULL_RANGE,
4503     NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_RESERVED,
4504     NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_AUTO          = 7
4505 } NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION;
4506 
4507 typedef enum
4508 {
4509     NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC601     = 0,
4510     NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC709,
4511     NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_SYCC601,
4512     NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBEYCC601,
4513     NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBERGB,
4514     NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED05,
4515     NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED06,
4516     NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED07,
4517     NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_AUTO         = 15
4518 } NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY;
4519 
4520 typedef enum
4521 {
4522     NV_INFOFRAME_FIELD_VALUE_AVI_ITC_VIDEO_CONTENT = 0,
4523     NV_INFOFRAME_FIELD_VALUE_AVI_ITC_ITCONTENT,
4524     NV_INFOFRAME_FIELD_VALUE_AVI_ITC_AUTO          = 3
4525 } NV_INFOFRAME_FIELD_VALUE_AVI_ITC;
4526 
4527 //! Byte 4 related
4528 typedef enum
4529 {
4530     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NONE = 0,
4531     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X02,
4532     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X03,
4533     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X04,
4534     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X05,
4535     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X06,
4536     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X07,
4537     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X08,
4538     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X09,
4539     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X10,
4540     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED10,
4541     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED11,
4542     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED12,
4543     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED13,
4544     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED14,
4545     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED15,
4546     NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_AUTO         = 31
4547 } NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION;
4548 
4549 
4550 typedef enum
4551 {
4552     NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GRAPHICS = 0,
4553     NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_PHOTO,
4554     NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_CINEMA,
4555     NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GAME,
4556     NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_AUTO     = 7
4557 } NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE;
4558 
4559 typedef enum
4560 {
4561     NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_LIMITED_RANGE = 0,
4562     NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_FULL_RANGE,
4563     NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED02,
4564     NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED03,
4565     NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_AUTO          = 7
4566 } NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION;
4567 
4568 //! Adding an Auto bit to each field
4569 typedef struct
4570 {
4571     NvU32 vic                     : 8;
4572     NvU32 pixelRepeat             : 5;
4573     NvU32 colorSpace              : 3;
4574     NvU32 colorimetry             : 3;
4575     NvU32 extendedColorimetry     : 4;
4576     NvU32 rgbQuantizationRange    : 3;
4577     NvU32 yccQuantizationRange    : 3;
4578     NvU32 itContent               : 2;
4579     NvU32 contentTypes            : 3;
4580     NvU32 scanInfo                : 3;
4581     NvU32 activeFormatInfoPresent : 2;
4582     NvU32 activeFormatAspectRatio : 5;
4583     NvU32 picAspectRatio          : 3;
4584     NvU32 nonuniformScaling       : 3;
4585     NvU32 barInfo                 : 3;
4586     NvU32 top_bar                 : 17;
4587     NvU32 bottom_bar              : 17;
4588     NvU32 left_bar                : 17;
4589     NvU32 right_bar               : 17;
4590     NvU32 Future17                : 2;
4591     NvU32 Future47                : 2;
4592 } NV_INFOFRAME_VIDEO;
4593 
4594 //! Byte 1 related
4595 typedef enum
4596 {
4597     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_IN_HEADER = 0,
4598     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_2,
4599     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_3,
4600     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_4,
4601     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_5,
4602     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_6,
4603     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_7,
4604     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_8,
4605     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_AUTO      = 15
4606 } NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT;
4607 
4608 typedef enum
4609 {
4610     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_IN_HEADER                  = 0,
4611     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_PCM,
4612     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AC3,
4613     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG1,
4614     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MP3,
4615     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG2,
4616     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AACLC,
4617     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTS,
4618     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_ATRAC,
4619     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DSD,
4620     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_EAC3,
4621     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTSHD,
4622     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MLP,
4623     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DST,
4624     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_WMAPRO,
4625     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_USE_CODING_EXTENSION_TYPE,
4626     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AUTO                      = 31
4627 } NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE;
4628 
4629 //! Byte 2 related
4630 typedef enum
4631 {
4632     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_IN_HEADER = 0,
4633     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_16BITS,
4634     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_20BITS,
4635     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_24BITS,
4636     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_AUTO      = 7
4637 } NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE;
4638 
4639 typedef enum
4640 {
4641     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_IN_HEADER = 0,
4642     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_32000HZ,
4643     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_44100HZ,
4644     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_48000HZ,
4645     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_88200KHZ,
4646     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_96000KHZ,
4647     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_176400KHZ,
4648     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_192000KHZ,
4649     NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_AUTO      = 15
4650 } NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY;
4651 
4652 
4653 
4654 //! Byte 3 related
4655 typedef enum
4656 {
4657     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_USE_CODING_TYPE = 0,
4658     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAAC,
4659     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAACV2,
4660     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_MPEGSURROUND,
4661     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE04,
4662     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE05,
4663     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE06,
4664     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE07,
4665     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE08,
4666     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE09,
4667     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE10,
4668     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE11,
4669     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE12,
4670     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE13,
4671     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE14,
4672     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE15,
4673     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE16,
4674     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE17,
4675     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE18,
4676     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE19,
4677     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE20,
4678     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE21,
4679     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE22,
4680     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE23,
4681     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE24,
4682     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE25,
4683     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE26,
4684     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE27,
4685     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE28,
4686     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE29,
4687     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE30,
4688     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE31,
4689     NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_AUTO           = 63
4690 } NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE;
4691 
4692 
4693 //! Byte 4 related
4694 typedef enum
4695 {
4696     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_X_FR_FL           =0,
4697     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_LFE_FR_FL,
4698     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_X_FR_FL,
4699     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_LFE_FR_FL,
4700     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_X_FR_FL,
4701     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_LFE_FR_FL,
4702     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_X_FR_FL,
4703     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_LFE_FR_FL,
4704     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_X_FR_FL,
4705     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_LFE_FR_FL,
4706     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_X_FR_FL,
4707     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_LFE_FR_FL,
4708     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_X_FR_FL,
4709     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_LFE_FR_FL,
4710     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_X_FR_FL,
4711     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_LFE_FR_FL,
4712     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_X_FR_FL,
4713     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_LFE_FR_FL,
4714     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_X_FR_FL,
4715     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_LFE_FR_FL,
4716     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_X_FR_FL,
4717     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_LFE_FR_FL,
4718     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_X_FR_FL,
4719     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_LFE_FR_FL,
4720     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_X_FR_FL,
4721     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_LFE_FR_FL,
4722     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_X_FR_FL,
4723     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_LFE_FR_FL,
4724     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_X_FR_FL,
4725     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_LFE_FR_FL,
4726     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_X_FR_FL,
4727     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_LFE_FR_FL,
4728     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_X_FR_FL,
4729     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_LFE_FR_FL,
4730     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_X_FR_FL,
4731     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_LFE_FR_FL,
4732     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_X_FR_FL,
4733     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_LFE_FR_FL,
4734     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_X_FR_FL,
4735     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_LFE_FR_FL,
4736     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_X_FR_FL,
4737     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_LFE_FR_FL,
4738     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_X_FR_FL,
4739     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_LFE_FR_FL,
4740     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_X_FR_FL,
4741     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_LFE_FR_FL,
4742     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_X_FR_FL,
4743     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_LFE_FR_FL,
4744     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_X_FR_FL,
4745     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_LFE_FR_FL  = 0X31,
4746     // all other values should default to auto
4747     NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_AUTO                        = 0x1FF
4748 } NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION;
4749 
4750 //! Byte 5 related
4751 typedef enum
4752 {
4753     NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NO_DATA    = 0,
4754     NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_0DB,
4755     NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_PLUS10DB,
4756     NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_RESERVED03,
4757     NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_AUTO       = 7
4758 } NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL;
4759 
4760 typedef enum
4761 {
4762     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_0DB  = 0,
4763     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_1DB,
4764     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_2DB,
4765     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_3DB,
4766     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_4DB,
4767     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_5DB,
4768     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_6DB,
4769     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_7DB,
4770     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_8DB,
4771     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_9DB,
4772     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_10DB,
4773     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_11DB,
4774     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_12DB,
4775     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_13DB,
4776     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_14DB,
4777     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_15DB,
4778     NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_AUTO = 31
4779 } NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES;
4780 
4781 
4782 typedef enum
4783 {
4784     NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PERMITTED  = 0,
4785     NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PROHIBITED,
4786     NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_AUTO       = 3
4787 } NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX;
4788 
4789 typedef struct
4790 {
4791     NvU32 codingType          : 5;
4792     NvU32 codingExtensionType : 6;
4793     NvU32 sampleSize          : 3;
4794     NvU32 sampleRate          : 4;
4795     NvU32 channelCount        : 4;
4796     NvU32 speakerPlacement    : 9;
4797     NvU32 downmixInhibit      : 2;
4798     NvU32 lfePlaybackLevel    : 3;
4799     NvU32 levelShift          : 5;
4800     NvU32 Future12            : 2;
4801     NvU32 Future2x            : 4;
4802     NvU32 Future3x            : 4;
4803     NvU32 Future52            : 2;
4804     NvU32 Future6             : 9;
4805     NvU32 Future7             : 9;
4806     NvU32 Future8             : 9;
4807     NvU32 Future9             : 9;
4808     NvU32 Future10            : 9;
4809 } NV_INFOFRAME_AUDIO;
4810 
4811 typedef struct
4812 {
4813     NvU32 version; //!< version of this structure
4814     NvU16 size;    //!< size of this structure
4815     NvU8  cmd;     //!< The actions to perform from NV_INFOFRAME_CMD
4816     NvU8  type;    //!< type of infoframe
4817 
4818     union
4819     {
4820         NV_INFOFRAME_PROPERTY     property;  //!< This is NVIDIA-specific and corresponds to the property cmds and associated infoframe.
4821         NV_INFOFRAME_AUDIO        audio;
4822         NV_INFOFRAME_VIDEO        video;
4823     } infoframe;
4824 } NV_INFOFRAME_DATA;
4825 
4826 //! Macro for constructing the version field of ::NV_INFOFRAME_DATA
4827 #define NV_INFOFRAME_DATA_VER   MAKE_NVAPI_VERSION(NV_INFOFRAME_DATA,1)
4828 
4829 ///////////////////////////////////////////////////////////////////////////////
4830 // FUNCTION NAME:   NvAPI_Disp_InfoFrameControl
4831 //
4832 //! DESCRIPTION:     This API controls the InfoFrame values.
4833 //!
4834 //! SUPPORTED OS:  Windows Vista and higher
4835 //!
4836 //!
4837 //! \param [in]     displayId         Monitor Identifier
4838 //! \param [in,out] pInfoframeData    Contains data corresponding to InfoFrame
4839 //!
4840 //! \return    This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
4841 //!            specific meaning for this API, they are listed below.
4842 //!
4843 //! \ingroup dispcontrol
4844 ///////////////////////////////////////////////////////////////////////////////
4845 NVAPI_INTERFACE NvAPI_Disp_InfoFrameControl(__in NvU32 displayId, __inout NV_INFOFRAME_DATA *pInfoframeData);
4846 
4847 
4848 
4849 
4850 
4851 
4852 //! \ingroup dispcontrol
4853 //! @{
4854 ///////////////////////////////////////////////////////////////////////////////
4855 // FUNCTION NAME:   NvAPI_Disp_ColorControl
4856 //
4857 //! \fn NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData)
4858 //! DESCRIPTION:    This API controls the Color values.
4859 //!
4860 //! SUPPORTED OS:  Windows Vista and higher
4861 //!
4862 //!
4863 //! \param [in]     displayId         Monitor Identifier
4864 //! \param [in,out] pColorData        Contains data corresponding to color information
4865 //!
4866 //! \return  RETURN STATUS:
4867 //! ::NVAPI_OK,
4868 //! ::NVAPI_ERROR,
4869 //! ::NVAPI_INVALID_ARGUMENT
4870 //
4871 ///////////////////////////////////////////////////////////////////////////////
4872 
4873 typedef enum
4874 {
4875     NV_COLOR_CMD_GET                 = 1,
4876     NV_COLOR_CMD_SET,
4877     NV_COLOR_CMD_IS_SUPPORTED_COLOR,
4878     NV_COLOR_CMD_GET_DEFAULT
4879 } NV_COLOR_CMD;
4880 
4881 //!  See Table 14 of CEA-861E.  Not all of this is supported by the GPU.
4882 typedef enum
4883 {
4884     NV_COLOR_FORMAT_RGB             = 0,
4885     NV_COLOR_FORMAT_YUV422,
4886     NV_COLOR_FORMAT_YUV444,
4887     NV_COLOR_FORMAT_DEFAULT         = 0xFE,
4888     NV_COLOR_FORMAT_AUTO            = 0xFF
4889 } NV_COLOR_FORMAT;
4890 
4891 
4892 
4893 typedef enum
4894 {
4895     NV_COLOR_COLORIMETRY_RGB             = 0,
4896     NV_COLOR_COLORIMETRY_YCC601,
4897     NV_COLOR_COLORIMETRY_YCC709,
4898     NV_COLOR_COLORIMETRY_XVYCC601,
4899     NV_COLOR_COLORIMETRY_XVYCC709,
4900     NV_COLOR_COLORIMETRY_SYCC601,
4901     NV_COLOR_COLORIMETRY_ADOBEYCC601,
4902     NV_COLOR_COLORIMETRY_ADOBERGB,
4903     NV_COLOR_COLORIMETRY_DEFAULT         = 0xFE,
4904     NV_COLOR_COLORIMETRY_AUTO            = 0xFF
4905 } NV_COLOR_COLORIMETRY;
4906 
4907 typedef struct
4908 {
4909     NvU32 version; //!< Version of this structure
4910     NvU16 size;    //!< Size of this structure
4911     NvU8  cmd;
4912     struct
4913     {
4914         NvU8  colorFormat;
4915         NvU8  colorimetry;
4916     } data;
4917 } NV_COLOR_DATA;
4918 
4919 NVAPI_INTERFACE NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData);
4920 
4921 //! Macro for constructing the version field of ::NV_COLOR_DATA
4922 #define NV_COLOR_DATA_VER   MAKE_NVAPI_VERSION(NV_COLOR_DATA,1)
4923 
4924 //! @}
4925 
4926 //! \ingroup dispcontrol
4927 //! Used in NvAPI_DISP_GetTiming().
4928 typedef struct
4929 {
4930     NvU32                   isInterlaced   : 4;  //!< To retrieve interlaced/progressive timing
4931     NvU32                   reserved0      : 12;
4932     union
4933     {
4934         NvU32               tvFormat       : 8;  //!< The actual analog HD/SDTV format. Used when the timing type is
4935                                                  //!  NV_TIMING_OVERRIDE_ANALOG_TV and width==height==rr==0.
4936         NvU32               ceaId          : 8;  //!< The EIA/CEA 861B/D predefined short timing descriptor ID.
4937                                                  //!  Used when the timing type is NV_TIMING_OVERRIDE_EIA861
4938                                                  //!  and width==height==rr==0.
4939         NvU32               nvPsfId        : 8;  //!< The NV predefined PsF format Id.
4940                                                  //!  Used when the timing type is NV_TIMING_OVERRIDE_NV_PREDEFINED.
4941     };
4942     NvU32                   scaling        : 8;  //!< Define preferred scaling
4943 }NV_TIMING_FLAG;
4944 
4945 //! \ingroup dispcontrol
4946 //! Used in NvAPI_DISP_GetTiming().
4947 typedef struct _NV_TIMING_INPUT
4948 {
4949 	NvU32 version;                       //!< (IN)     structure version
4950 
4951 	NvU32 width;						//!< Visible horizontal size
4952 	NvU32 height;						//!< Visible vertical size
4953 	float rr;							//!< Timing refresh rate
4954 
4955 	NV_TIMING_FLAG flag;				//!< Flag containing additional info for timing calculation.
4956 
4957 	NV_TIMING_OVERRIDE type;			//!< Timing type(formula) to use for calculating the timing
4958 }NV_TIMING_INPUT;
4959 
4960 #define NV_TIMING_INPUT_VER   MAKE_NVAPI_VERSION(NV_TIMING_INPUT,1)
4961 
4962 ///////////////////////////////////////////////////////////////////////////////
4963 // FUNCTION NAME:   NvAPI_DISP_GetTiming
4964 //
4965 //! DESCRIPTION:  This function calculates the timing from the visible width/height/refresh-rate and timing type info.
4966 //!
4967 //! SUPPORTED OS:  Windows XP and higher
4968 //!
4969 //!
4970 //! \since Release: 313
4971 //!
4972 //!
4973 //! \param [in]   displayId		Display ID of the display.
4974 //! \param [in]   timingInput   Inputs used for calculating the timing.
4975 //! \param [out]  pTiming       Pointer to the NV_TIMING structure.
4976 //!
4977 //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
4978 //!                specific meaning for this API, they are listed below.
4979 //!
4980 //! \ingroup dispcontrol
4981 ///////////////////////////////////////////////////////////////////////////////
4982 NVAPI_INTERFACE NvAPI_DISP_GetTiming( __in NvU32 displayId,__in NV_TIMING_INPUT *timingInput, __out NV_TIMING *pTiming);
4983 
4984 
4985 
4986 ///////////////////////////////////////////////////////////////////////////////
4987 // FUNCTION NAME:   NvAPI_DISP_GetMonitorCapabilities
4988 //
4989 //! \fn NvAPI_DISP_GetMonitorCapabilities(NvU32 displayId, NV_MONITOR_CAPABILITIES *pMonitorCapabilities)
4990 //! DESCRIPTION:     This API returns the Monitor capabilities
4991 //!
4992 //! SUPPORTED OS:  Windows Vista and higher
4993 //!
4994 //!
4995 //! \param [in]      displayId                Monitor Identifier
4996 //! \param [out]     pMonitorCapabilities     The monitor support info
4997 //!
4998 //! \return ::NVAPI_OK,
4999 //!         ::NVAPI_ERROR,
5000 //!         ::NVAPI_INVALID_ARGUMENT
5001 //
5002 ///////////////////////////////////////////////////////////////////////////////
5003 
5004 //! \ingroup dispcontrol
5005 //! @{
5006 
5007 
5008 //! HDMI-related and extended CAPs
5009 typedef enum
5010 {
5011     // hdmi related caps
5012     NV_MONITOR_CAPS_TYPE_HDMI_VSDB = 0x1000,
5013     NV_MONITOR_CAPS_TYPE_HDMI_VCDB = 0x1001,
5014 } NV_MONITOR_CAPS_TYPE;
5015 
5016 
5017 
5018 typedef struct _NV_MONITOR_CAPS_VCDB
5019 {
5020     NvU8    quantizationRangeYcc         : 1;
5021     NvU8    quantizationRangeRgb         : 1;
5022     NvU8    scanInfoPreferredVideoFormat : 2;
5023     NvU8    scanInfoITVideoFormats       : 2;
5024     NvU8    scanInfoCEVideoFormats       : 2;
5025 } NV_MONITOR_CAPS_VCDB;
5026 
5027 
5028 //! See NvAPI_DISP_GetMonitorCapabilities().
5029 typedef struct _NV_MONITOR_CAPS_VSDB
5030 {
5031     // byte 1
5032     NvU8    sourcePhysicalAddressB         : 4; //!< Byte 1
5033     NvU8    sourcePhysicalAddressA         : 4; //!< Byte 1
5034     // byte 2
5035     NvU8    sourcePhysicalAddressD         : 4; //!< Byte 2
5036     NvU8    sourcePhysicalAddressC         : 4; //!< Byte 2
5037     // byte 3
5038     NvU8    supportDualDviOperation        : 1; //!< Byte 3
5039     NvU8    reserved6                      : 2; //!< Byte 3
5040     NvU8    supportDeepColorYCbCr444       : 1; //!< Byte 3
5041     NvU8    supportDeepColor30bits         : 1; //!< Byte 3
5042     NvU8    supportDeepColor36bits         : 1; //!< Byte 3
5043     NvU8    supportDeepColor48bits         : 1; //!< Byte 3
5044     NvU8    supportAI                      : 1; //!< Byte 3
5045     // byte 4
5046     NvU8    maxTmdsClock;  //!< Bye 4
5047     // byte 5
5048     NvU8    cnc0SupportGraphicsTextContent : 1; //!< Byte 5
5049     NvU8    cnc1SupportPhotoContent        : 1; //!< Byte 5
5050     NvU8    cnc2SupportCinemaContent       : 1; //!< Byte 5
5051     NvU8    cnc3SupportGameContent         : 1; //!< Byte 5
5052     NvU8    reserved8                      : 1; //!< Byte 5
5053     NvU8    hasVicEntries                  : 1; //!< Byte 5
5054     NvU8    hasInterlacedLatencyField      : 1; //!< Byte 5
5055     NvU8    hasLatencyField                : 1; //!< Byte 5
5056     // byte 6
5057     NvU8    videoLatency; //!< Byte 6
5058     // byte 7
5059     NvU8    audioLatency; //!< Byte 7
5060     // byte 8
5061     NvU8    interlacedVideoLatency; //!< Byte 8
5062     // byte 9
5063     NvU8    interlacedAudioLatency; //!< Byte 9
5064     // byte 10
5065     NvU8    reserved13                     : 7; //!< Byte 10
5066     NvU8    has3dEntries                   : 1; //!< Byte 10
5067     // byte 11
5068     NvU8    hdmi3dLength                   : 5; //!< Byte 11
5069     NvU8    hdmiVicLength                  : 3; //!< Byte 11
5070     // Remaining bytes
5071     NvU8    hdmi_vic[7];  //!< Keeping maximum length for 3 bits
5072     NvU8    hdmi_3d[31];  //!< Keeping maximum length for 5 bits
5073 } NV_MONITOR_CAPS_VSDB;
5074 
5075 
5076 //! See NvAPI_DISP_GetMonitorCapabilities().
5077 typedef struct _NV_MONITOR_CAPABILITIES
5078 {
5079     NvU32    version;
5080     NvU16    size;
5081     NvU32    infoType;
5082     NvU32    connectorType;        //!< Out: VGA, TV, DVI, HDMI, DP
5083     NvU8     bIsValidInfo : 1;     //!< Boolean : Returns invalid if requested info is not present such as VCDB not present
5084     union {
5085         NV_MONITOR_CAPS_VSDB  vsdb;
5086         NV_MONITOR_CAPS_VCDB  vcdb;
5087     } data;
5088 } NV_MONITOR_CAPABILITIES;
5089 
5090 //! Macro for constructing the version field of ::NV_MONITOR_CAPABILITIES
5091 #define NV_MONITOR_CAPABILITIES_VER   MAKE_NVAPI_VERSION(NV_MONITOR_CAPABILITIES,1)
5092 
5093 //! @}
5094 
5095 //! SUPPORTED OS:  Windows Vista and higher
5096 //!
5097 //! \ingroup dispcontrol
5098 NVAPI_INTERFACE NvAPI_DISP_GetMonitorCapabilities(__in NvU32 displayId, __inout NV_MONITOR_CAPABILITIES *pMonitorCapabilities);
5099 
5100 //! \ingroup dispcontrol
5101 typedef struct _NV_MONITOR_COLOR_DATA
5102 {
5103     NvU32                   version;
5104 // We are only supporting DP monitors for now. We need to extend this to HDMI panels as well
5105     NV_DP_COLOR_FORMAT      colorFormat;        //!< One of the supported color formats
5106     NV_DP_BPC               backendBitDepths;   //!< One of the supported bit depths
5107 } NV_MONITOR_COLOR_CAPS_V1;
5108 
5109 typedef NV_MONITOR_COLOR_CAPS_V1 NV_MONITOR_COLOR_CAPS;
5110 
5111 //! \ingroup dispcontrol
5112 #define NV_MONITOR_COLOR_CAPS_VER1   MAKE_NVAPI_VERSION(NV_MONITOR_COLOR_CAPS_V1,1)
5113 #define NV_MONITOR_COLOR_CAPS_VER    NV_MONITOR_COLOR_CAPS_VER1
5114 
5115 ///////////////////////////////////////////////////////////////////////////////
5116 // FUNCTION NAME:   NvAPI_DISP_GetMonitorColorCapabilities
5117 //
5118 //! DESCRIPTION:    This API returns all the color formats and bit depth values supported by a given DP monitor.
5119 //!
5120 //! USAGE:         Sequence of calls which caller should make to get the information.
5121 //!                1. First call NvAPI_DISP_GetMonitorColorCapabilities() with pMonitorColorCapabilities as NULL to get the count.
5122 //!                2. Allocate memory for color caps(NV_MONITOR_COLOR_CAPS) array.
5123 //!                3. Call NvAPI_DISP_GetMonitorColorCapabilities() again with the pointer to the memory allocated to get all the
5124 //!                   color capabilities.
5125 //!
5126 //!                Note :
5127 //!                1. pColorCapsCount should never be NULL, else the API will fail with NVAPI_INVALID_ARGUMENT.
5128 //!                2. *pColorCapsCount returned from the API will always be the actual count in any/every call.
5129 //!                3. Memory size to be allocated should be (*pColorCapsCount * sizeof(NV_MONITOR_COLOR_CAPS)).
5130 //!                4. If the memory allocated is less than what is required to return all the timings, this API will return the
5131 //!                   amount of information which can fit in user provided buffer and API will return NVAPI_INSUFFICIENT_BUFFER.
5132 //!                5. If the caller specifies a greater value for *pColorCapsCount in second call to NvAPI_DISP_GetMonitorColorCapabilities()
5133 //!                   than what was returned from first call, the API will return only the actual number of elements in the color
5134 //!                   capabilities array and the extra buffer will remain unused.
5135 //!
5136 //! SUPPORTED OS:  Windows Vista and higher
5137 //!
5138 //!
5139 //! \param [in]      displayId                  Monitor Identifier
5140 //! \param [in, out] pMonitorColorCapabilities  The monitor color capabilities information
5141 //! \param [in, out] pColorCapsCount            - During input, the number of elements allocated for the pMonitorColorCapabilities pointer
5142 //!                                             - During output, the actual number of color data elements the monitor supports
5143 //!
5144 //! \return    This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
5145 //!            specific meaning for this API, they are listed below.
5146 //!
5147 //! \retval         NVAPI_INSUFFICIENT_BUFFER   The input buffer size is not sufficient to hold the total contents. In this case
5148 //!                                             *pColorCapsCount will hold the required amount of elements.
5149 //! \retval         NVAPI_INVALID_DISPLAY_ID    The input monitor is either not connected or is not a DP panel.
5150 //!
5151 //! \ingroup dispcontrol
5152 //!
5153 ///////////////////////////////////////////////////////////////////////////////
5154 NVAPI_INTERFACE NvAPI_DISP_GetMonitorColorCapabilities(__in NvU32 displayId, __inout_ecount_part_opt(*pColorCapsCount, *pColorCapsCount) NV_MONITOR_COLOR_CAPS *pMonitorColorCapabilities, __inout NvU32 *pColorCapsCount);
5155 
5156 //! \ingroup dispcontrol
5157 //! Used in NvAPI_DISP_EnumCustomDisplay() and NvAPI_DISP_TryCustomDisplay().
5158 typedef struct
5159 {
5160     NvU32                   version;
5161 
5162     // the source mode information
5163     NvU32                   width;             //!< Source surface(source mode) width
5164     NvU32                   height;            //!< Source surface(source mode) height
5165     NvU32                   depth;             //!< Source surface color depth."0" means all 8/16/32bpp
5166     NV_FORMAT               colorFormat;       //!< Color format (optional)
5167 
5168     NV_VIEWPORTF            srcPartition;      //!< For multimon support, should be set to (0,0,1.0,1.0) for now.
5169 
5170     float                   xRatio;            //!< Horizontal scaling ratio
5171     float                   yRatio;            //!< Vertical scaling ratio
5172 
5173     NV_TIMING               timing;            //!< Timing used to program TMDS/DAC/LVDS/HDMI/TVEncoder, etc.
5174     NvU32                   hwModeSetOnly : 1; //!< If set, it means a hardware modeset without OS update
5175 
5176 }NV_CUSTOM_DISPLAY;
5177 
5178 //! \ingroup dispcontrol
5179 //! Used in NV_CUSTOM_DISPLAY.
5180 #define NV_CUSTOM_DISPLAY_VER  MAKE_NVAPI_VERSION(NV_CUSTOM_DISPLAY,1)
5181 
5182 ///////////////////////////////////////////////////////////////////////////////
5183 // FUNCTION NAME:   NvAPI_DISP_EnumCustomDisplay
5184 //
5185 //! DESCRIPTION:   This API enumerates the custom timing specified by the enum index.
5186 //!				   The client should keep enumerating until it returns NVAPI_END_ENUMERATION.
5187 //!
5188 //! SUPPORTED OS:  Windows XP and higher
5189 //!
5190 //!
5191 //! \since Release: 313
5192 //!
5193 //! \param [in]     displayId   Dispaly ID of the display.
5194 //! \param [in]     index       Enum index
5195 //! \param [inout]  pCustDisp   Pointer to the NV_CUSTOM_DISPLAY structure
5196 //!
5197 //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
5198 //!                specific meaning for this API, they are listed below.
5199 //! \retval        NVAPI_INVALID_DISPLAY_ID:   Custom Timing is not supported on the Display, whose display id is passed
5200 //!
5201 //! \ingroup dispcontrol
5202 ///////////////////////////////////////////////////////////////////////////////
5203 NVAPI_INTERFACE NvAPI_DISP_EnumCustomDisplay( __in NvU32 displayId, __in NvU32 index, __inout NV_CUSTOM_DISPLAY *pCustDisp);
5204 
5205 ///////////////////////////////////////////////////////////////////////////////
5206 // FUNCTION NAME:   NvAPI_DISP_TryCustomDisplay
5207 //
5208 //! DESCRIPTION:    This API is used to set up a custom display without saving the configuration on multiple displays.
5209 //!
5210 //! \note
5211 //!  All the members of srcPartition, present in NV_CUSTOM_DISPLAY structure, should have their range in (0.0,1.0).
5212 //!  In clone mode the timings can applied to both the target monitors but only one target at a time. \n
5213 //!  For the secondary target the applied timings works under the following conditions:
5214 //!  - If the secondary monitor EDID supports the selected timing, OR
5215 //!  - If the selected custom timings can be scaled by the secondary monitor for the selected source resolution on the primary, OR
5216 //!  - If the selected custom timings matches the existing source resolution on the primary.
5217 //!  Setting up a custom display on non-active but connected monitors is supported only for Win7 and above.
5218 //!
5219 //! SUPPORTED OS:  Windows XP,  Windows 7 and higher
5220 //!
5221 //!
5222 //! \since Release: 313
5223 //!
5224 //!
5225 //! \param [in]    pDisplayIds    Array of the target display Dispaly IDs - See \ref handles.
5226 //! \param [in]    count          Total number of the incoming Display IDs and corresponding NV_CUSTOM_DISPLAY structure. This is for the multi-head support.
5227 //! \param [in]    pCustDisp      Pointer to the NV_CUSTOM_DISPLAY structure array.
5228 //!
5229 //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
5230 //!                specific meaning for this API, they are listed below.
5231 //! \retval        NVAPI_INVALID_DISPLAY_ID:   Custom Timing is not supported on the Display, whose display id is passed
5232 //!
5233 //! \ingroup dispcontrol
5234 ///////////////////////////////////////////////////////////////////////////////
5235 NVAPI_INTERFACE NvAPI_DISP_TryCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in_ecount(count) NV_CUSTOM_DISPLAY *pCustDisp);
5236 
5237 ///////////////////////////////////////////////////////////////////////////////
5238 // FUNCTION NAME:   NvAPI_DISP_DeleteCustomDisplay
5239 //
5240 //! DESCRIPTION:    This function deletes the custom display configuration, specified from the registry for  all the displays whose display IDs are passed.
5241 //!
5242 //! SUPPORTED OS:  Windows XP and higher
5243 //!
5244 //!
5245 //! \since Release: 313
5246 //!
5247 //!
5248 //! \param [in]     pDisplayIds    Array of Dispaly IDs on which custom display configuration is to be saved.
5249 //! \param [in]     count          Total number of the incoming Dispaly IDs. This is for the multi-head support.
5250 //!	\param [in]     pCustDisp	   Pointer to the NV_CUSTOM_DISPLAY structure
5251 //!
5252 //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
5253 //!                specific meaning for this API, they are listed below.
5254 //! \retval        NVAPI_INVALID_DISPLAY_ID:   Custom Timing is not supported on the Display, whose display id is passed
5255 //!
5256 //! \ingroup dispcontrol
5257 ///////////////////////////////////////////////////////////////////////////////
5258 NVAPI_INTERFACE NvAPI_DISP_DeleteCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in NV_CUSTOM_DISPLAY *pCustDisp);
5259 
5260 ///////////////////////////////////////////////////////////////////////////////
5261 // FUNCTION NAME:   NvAPI_DISP_SaveCustomDisplay
5262 //
5263 //! DESCRIPTION:    This function saves the current hardware display configuration on the specified Display IDs as a custom display configuration.
5264 //!                 This function should be called right after NvAPI_DISP_TryCustomDisplay() to save the custom display from the current
5265 //!                 hardware context. This function will not do anything if the custom display configuration is not tested on the hardware.
5266 //!
5267 //! SUPPORTED OS:  Windows XP and higher
5268 //!
5269 //!
5270 //! \since Release: 313
5271 //!
5272 //!
5273 //! \param [in]     pDisplayIds         Array of Dispaly IDs on which custom display configuration is to be saved.
5274 //! \param [in]     count               Total number of the incoming Dispaly IDs. This is for the multi-head support.
5275 //! \param [in]     isThisOutputIdOnly  If set, the saved custom display will only be applied on the monitor with the same outputId (see \ref handles).
5276 //! \param [in]     isThisMonitorIdOnly If set, the saved custom display will only be applied on the monitor with the same EDID ID or
5277 //!                                     the same TV connector in case of analog TV.
5278 //!
5279 //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
5280 //!                specific meaning for this API, they are listed below.
5281 //! \retval 	   NVAPI_INVALID_DISPLAY_ID:   Custom Timing is not supported on the Display, whose display id is passed
5282 //!
5283 //! \ingroup dispcontrol
5284 ///////////////////////////////////////////////////////////////////////////////
5285 NVAPI_INTERFACE NvAPI_DISP_SaveCustomDisplay( __in_ecount(count) NvU32 *pDisplayIds, __in NvU32 count, __in NvU32 isThisOutputIdOnly, __in NvU32 isThisMonitorIdOnly);
5286 
5287 ///////////////////////////////////////////////////////////////////////////////
5288 // FUNCTION NAME:   NvAPI_DISP_RevertCustomDisplayTrial
5289 //
5290 //! DESCRIPTION:    This API is used to restore the display configuration, that was changed by calling NvAPI_DISP_TryCustomDisplay(). This function
5291 //!                 must be called only after a custom display configuration is tested on the hardware, using NvAPI_DISP_TryCustomDisplay(),
5292 //!                 otherwise no action is taken. On Vista, NvAPI_DISP_RevertCustomDisplayTrial should be called with an active display that
5293 //!                 was affected during the NvAPI_DISP_TryCustomDisplay() call, per GPU.
5294 //!
5295 //! SUPPORTED OS:  Windows Vista and higher
5296 //!
5297 //!
5298 //! \since Release: 313
5299 //!
5300 //!
5301 //! \param [in]    pDisplayIds   Pointer to display Id, of an active display.
5302 //! \param [in]    count         Total number of incoming Display IDs. For future use only. Currently it is expected to be passed as 1.
5303 //!
5304 //! \return        This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
5305 //!                specific meaning for this API, they are listed below.
5306 //!
5307 //! \ingroup dispcontrol
5308 ///////////////////////////////////////////////////////////////////////////////
5309 NVAPI_INTERFACE NvAPI_DISP_RevertCustomDisplayTrial( __in_ecount(count) NvU32* pDisplayIds, __in NvU32 count);
5310 
5311 ///////////////////////////////////////////////////////////////////////////////
5312 // FUNCTION NAME:   NvAPI_GetView
5313 //
5314 //! This API lets caller retrieve the target display arrangement for selected source display handle.
5315 //! \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW.
5316 //!       Use NvAPI_SYS_GetDisplayTopologies() to query views across GPUs.
5317 //!
5318 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.
5319 //! SUPPORTED OS:  Windows Vista and higher
5320 //!
5321 //!
5322 //! \since Release: 85
5323 //!
5324 //!  \param [in]     hNvDisplay             NVIDIA Display selection. It can be #NVAPI_DEFAULT_HANDLE or a handle enumerated from
5325 //!                                         NvAPI_EnumNVidiaDisplayHandle().
5326 //!  \param [out]    pTargets               User allocated storage to retrieve an array of  NV_VIEW_TARGET_INFO. Can be NULL to retrieve
5327 //!                                         the targetCount.
5328 //!  \param [in,out] targetMaskCount        Count of target device mask specified in pTargetMask.
5329 //!  \param [out]    targetView             Target view selected from NV_TARGET_VIEW_MODE.
5330 //!
5331 //!  \retval         NVAPI_OK               Completed request
5332 //!  \retval         NVAPI_ERROR            Miscellaneous error occurred
5333 //!  \retval         NVAPI_INVALID_ARGUMENT Invalid input parameter.
5334 //! \ingroup dispcontrol
5335 ///////////////////////////////////////////////////////////////////////////////
5336 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.")
5337 NVAPI_INTERFACE NvAPI_GetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargets, NvU32 *pTargetMaskCount, NV_TARGET_VIEW_MODE *pTargetView);
5338 
5339 
5340 
5341 
5342 
5343 
5344 
5345 ///////////////////////////////////////////////////////////////////////////////
5346 // FUNCTION NAME:   NvAPI_GetViewEx
5347 //
5348 //! DESCRIPTION:    This API lets caller retrieve the target display arrangement for selected source display handle.
5349 //!                 \note Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW.
5350 //!                       Use NvAPI_SYS_GetDisplayTopologies() to query views across GPUs.
5351 //!
5352 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.
5353 //! SUPPORTED OS:  Windows Vista and higher
5354 //!
5355 //!
5356 //! \since Release: 165
5357 //!
5358 //! \param [in]     hNvDisplay       NVIDIA Display selection. #NVAPI_DEFAULT_HANDLE is not allowed, it has to be a handle enumerated with
5359 //!                                  NvAPI_EnumNVidiaDisplayHandle().
5360 //! \param [in,out] pPathInfo        Count field should be set to NVAPI_MAX_DISPLAY_PATH. Can be NULL to retrieve just the pathCount.
5361 //! \param [in,out] pPathCount       Number of elements in array pPathInfo->path.
5362 //! \param [out]    pTargetViewMode  Display view selected from NV_TARGET_VIEW_MODE.
5363 //!
5364 //! \retval         NVAPI_OK                      Completed request
5365 //! \retval         NVAPI_API_NOT_INTIALIZED      NVAPI not initialized
5366 //! \retval         NVAPI_ERROR                   Miscellaneous error occurred
5367 //! \retval         NVAPI_INVALID_ARGUMENT        Invalid input parameter.
5368 //! \retval         NVAPI_EXPECTED_DISPLAY_HANDLE hNvDisplay is not a valid display handle.
5369 //!
5370 //! \ingroup dispcontrol
5371 ///////////////////////////////////////////////////////////////////////////////
5372 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_DISP_GetDisplayConfig.")
5373 NVAPI_INTERFACE NvAPI_GetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NvU32 *pPathCount, NV_TARGET_VIEW_MODE *pTargetViewMode);
5374 
5375 ///////////////////////////////////////////////////////////////////////////////
5376 // FUNCTION NAME:   NvAPI_GetSupportedViews
5377 //
5378 //!  This API lets caller enumerate all the supported NVIDIA display views - nView and Dualview modes.
5379 //!
5380 //! SUPPORTED OS:  Windows XP and higher
5381 //!
5382 //!
5383 //! \since Release: 85
5384 //!
5385 //!  \param [in]     hNvDisplay             NVIDIA Display selection. It can be #NVAPI_DEFAULT_HANDLE or a handle enumerated from
5386 //!                                         NvAPI_EnumNVidiaDisplayHandle().
5387 //!  \param [out]    pTargetViews           Array of supported views. Can be NULL to retrieve the pViewCount first.
5388 //!  \param [in,out] pViewCount             Count of supported views.
5389 //!
5390 //!  \retval         NVAPI_OK               Completed request
5391 //!  \retval         NVAPI_ERROR            Miscellaneous error occurred
5392 //!  \retval         NVAPI_INVALID_ARGUMENT Invalid input parameter.
5393 //! \ingroup dispcontrol
5394 ///////////////////////////////////////////////////////////////////////////////
5395 NVAPI_INTERFACE NvAPI_GetSupportedViews(NvDisplayHandle hNvDisplay, NV_TARGET_VIEW_MODE *pTargetViews, NvU32 *pViewCount);
5396 
5397 
5398 //! SUPPORTED OS:  Windows XP and higher
5399 //!
5400 ///////////////////////////////////////////////////////////////////////////////
5401 //
5402 // FUNCTION NAME:   NvAPI_DISP_GetDisplayIdByDisplayName
5403 //
5404 //! DESCRIPTION:     This API retrieves the Display Id of a given display by
5405 //!                  display name. The display must be active to retrieve the
5406 //!                  displayId. In the case of clone mode or Surround gaming,
5407 //!                  the primary or top-left display will be returned.
5408 //!
5409 //! \param [in]     displayName  Name of display (Eg: "\\DISPLAY1" to
5410 //!                              retrieve the displayId for.
5411 //! \param [out]    displayId    Display ID of the requested display.
5412 //!
5413 //! retval ::NVAPI_OK:                          Capabilties have been returned.
5414 //! retval ::NVAPI_INVALID_ARGUMENT:            One or more args passed in are invalid.
5415 //! retval ::NVAPI_API_NOT_INTIALIZED:          The NvAPI API needs to be initialized first
5416 //! retval ::NVAPI_NO_IMPLEMENTATION:           This entrypoint not available
5417 //! retval ::NVAPI_ERROR:                       Miscellaneous error occurred
5418 //!
5419 //! \ingroup dispcontrol
5420 ///////////////////////////////////////////////////////////////////////////////
5421 NVAPI_INTERFACE NvAPI_DISP_GetDisplayIdByDisplayName(const char *displayName, NvU32* displayId);
5422 
5423 
5424 
5425 
5426 ///////////////////////////////////////////////////////////////////////////////
5427 // FUNCTION NAME:   NvAPI_DISP_GetDisplayConfig
5428 //
5429 //! DESCRIPTION:     This API lets caller retrieve the current global display
5430 //!                  configuration.
5431 //!       USAGE:     The caller might have to call this three times to fetch all the required configuration details as follows:
5432 //!                  First  Pass: Caller should Call NvAPI_DISP_GetDisplayConfig() with pathInfo set to NULL to fetch pathInfoCount.
5433 //!                  Second Pass: Allocate memory for pathInfo with respect to the number of pathInfoCount(from First Pass) to fetch
5434 //!                               targetInfoCount. If sourceModeInfo is needed allocate memory or it can be initialized to NULL.
5435 //!             Third  Pass(Optional, only required if target information is required): Allocate memory for targetInfo with respect
5436 //!                               to number of targetInfoCount(from Second Pass).
5437 //! SUPPORTED OS:  Windows Vista and higher
5438 //!
5439 //!
5440 //! \param [in,out]  pathInfoCount    Number of elements in pathInfo array, returns number of valid topologies, this cannot be null.
5441 //! \param [in,out]  pathInfo         Array of path information
5442 //!
5443 //! \return    This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
5444 //!            specific meaning for this API, they are listed below.
5445 //!
5446 //! \retval    NVAPI_INVALID_ARGUMENT  -   Invalid input parameter. Following can be the reason for this return value:
5447 //!                                        -# pathInfoCount is NULL.
5448 //!                                        -# *pathInfoCount is 0 and pathInfo is not NULL.
5449 //!                                        -# *pathInfoCount is not 0 and pathInfo is NULL.
5450 //! \retval    NVAPI_DEVICE_BUSY       -   ModeSet has not yet completed. Please wait and call it again.
5451 //!
5452 //! \ingroup dispcontrol
5453 ///////////////////////////////////////////////////////////////////////////////
5454 NVAPI_INTERFACE NvAPI_DISP_GetDisplayConfig(__inout NvU32 *pathInfoCount, __out_ecount_full_opt(*pathInfoCount) NV_DISPLAYCONFIG_PATH_INFO *pathInfo);
5455 
5456 
5457 
5458 
5459 ///////////////////////////////////////////////////////////////////////////////
5460 // FUNCTION NAME:   NvAPI_DISP_SetDisplayConfig
5461 //
5462 //
5463 //! DESCRIPTION:     This API lets caller apply a global display configuration
5464 //!                  across multiple GPUs.
5465 //!
5466 //!                  If all sourceIds are zero, then NvAPI will pick up sourceId's based on the following criteria :
5467 //!                  - If user provides sourceModeInfo then we are trying to assign 0th sourceId always to GDIPrimary.
5468 //!                     This is needed since active windows always moves along with 0th sourceId.
5469 //!                  - For rest of the paths, we are incrementally assigning the sourceId per adapter basis.
5470 //!                  - If user doesn't provide sourceModeInfo then NVAPI just picks up some default sourceId's in incremental order.
5471 //!                  Note : NVAPI will not intelligently choose the sourceIDs for any configs that does not need a modeset.
5472 //!
5473 //! SUPPORTED OS:  Windows Vista and higher
5474 //!
5475 //!
5476 //! \param [in]      pathInfoCount   Number of supplied elements in pathInfo
5477 //! \param [in]      pathInfo        Array of path information
5478 //! \param [in]      flags           Flags for applying settings
5479 //!
5480 //! \retval ::NVAPI_OK - completed request
5481 //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
5482 //! \retval ::NVAPI_ERROR - miscellaneous error occurred
5483 //! \retval ::NVAPI_INVALID_ARGUMENT - Invalid input parameter.
5484 //!
5485 //! \ingroup dispcontrol
5486 ///////////////////////////////////////////////////////////////////////////////
5487 NVAPI_INTERFACE NvAPI_DISP_SetDisplayConfig(__in NvU32 pathInfoCount, __in_ecount(pathInfoCount) NV_DISPLAYCONFIG_PATH_INFO* pathInfo, __in NvU32 flags);
5488 
5489 
5490 
5491 
5492 
5493 ////////////////////////////////////////////////////////////////////////////////////////
5494 //
5495 // MOSAIC allows a multi display target output scanout on a single source.
5496 //
5497 // SAMPLE of MOSAIC 1x4 topo with 8 pixel horizontal overlap
5498 //
5499 //+-------------------------++-------------------------++-------------------------++-------------------------+
5500 //|                         ||                         ||                         ||                         |
5501 //|                         ||                         ||                         ||                         |
5502 //|                         ||                         ||                         ||                         |
5503 //|        DVI1             ||           DVI2          ||         DVI3            ||          DVI4           |
5504 //|                         ||                         ||                         ||                         |
5505 //|                         ||                         ||                         ||                         |
5506 //|                         ||                         ||                         ||                         |
5507 //|                         ||                         ||                         ||                         |
5508 //+-------------------------++-------------------------++-------------------------++-------------------------+
5509 
5510 
5511 //! \addtogroup mosaicapi
5512 //! @{
5513 
5514 #define NVAPI_MAX_MOSAIC_DISPLAY_ROWS       8
5515 #define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS    8
5516 //
5517 // These bits are used to describe the validity of a topo.
5518 //
5519 #define NV_MOSAIC_TOPO_VALIDITY_VALID               0x00000000  //!< The topology is valid
5520 #define NV_MOSAIC_TOPO_VALIDITY_MISSING_GPU         0x00000001  //!< Not enough SLI GPUs were found to fill the entire
5521                                                                 //! topology. hPhysicalGPU will be 0 for these.
5522 #define NV_MOSAIC_TOPO_VALIDITY_MISSING_DISPLAY     0x00000002  //!< Not enough displays were found to fill the entire
5523                                                                 //! topology. displayOutputId will be 0 for these.
5524 #define NV_MOSAIC_TOPO_VALIDITY_MIXED_DISPLAY_TYPES 0x00000004  //!< The topoogy is only possible with displays of the same
5525                                                                 //! NV_GPU_OUTPUT_TYPE. Check displayOutputIds to make
5526                                                                 //! sure they are all CRTs, or all DFPs.
5527 
5528 
5529 //
5530 //! This structure defines the topology details.
5531 typedef struct
5532 {
5533     NvU32                version;              //!< Version of this structure
5534     NvLogicalGpuHandle   hLogicalGPU;          //!< Logical GPU for this topology
5535     NvU32                validityMask;         //!< 0 means topology is valid with the current hardware.
5536                                                //! If not 0, inspect bits against NV_MOSAIC_TOPO_VALIDITY_*.
5537     NvU32                rowCount;             //!< Number of displays in a row
5538     NvU32                colCount;             //!< Number of displays in a column
5539 
5540     struct
5541     {
5542         NvPhysicalGpuHandle hPhysicalGPU;      //!< Physical GPU to be used in the topology (0 if GPU missing)
5543         NvU32               displayOutputId;   //!< Connected display target (0 if no display connected)
5544         NvS32               overlapX;          //!< Pixels of overlap on left of target: (+overlap, -gap)
5545         NvS32               overlapY;          //!< Pixels of overlap on top of target: (+overlap, -gap)
5546 
5547     } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS];
5548 
5549 } NV_MOSAIC_TOPO_DETAILS;
5550 
5551 //! Macro for constructing te vesion field of NV_MOSAIC_TOPO_DETAILS
5552 #define NVAPI_MOSAIC_TOPO_DETAILS_VER         MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_DETAILS,1)
5553 
5554 
5555 //
5556 //! These values refer to the different types of Mosaic topologies that are possible.  When
5557 //! getting the supported Mosaic topologies, you can specify one of these types to narrow down
5558 //! the returned list to only those that match the given type.
5559 typedef enum
5560 {
5561     NV_MOSAIC_TOPO_TYPE_ALL,                          //!< All mosaic topologies
5562     NV_MOSAIC_TOPO_TYPE_BASIC,                        //!< Basic Mosaic topologies
5563     NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO,               //!< Passive Stereo topologies
5564     NV_MOSAIC_TOPO_TYPE_SCALED_CLONE,                 //!< Not supported at this time
5565     NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO_SCALED_CLONE,  //!< Not supported at this time
5566     NV_MOSAIC_TOPO_TYPE_MAX,                          //!< Always leave this at end of the enum
5567 } NV_MOSAIC_TOPO_TYPE;
5568 
5569 
5570 //
5571 //! This is a complete list of supported Mosaic topologies.
5572 //!
5573 //! Using a "Basic" topology combines multiple monitors to create a single desktop.
5574 //!
5575 //! Using a "Passive" topology combines multiples monitors to create a passive stereo desktop.
5576 //! In passive stereo, two identical topologies combine - one topology is used for the right eye and the other identical //! topology (targeting different displays) is used for the left eye.  \n
5577 //! NOTE: common\inc\nvEscDef.h shadows a couple PASSIVE_STEREO enums.  If this
5578 //!       enum list changes and effects the value of NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO
5579 //!       please update the corresponding value in nvEscDef.h
5580 typedef enum
5581 {
5582     NV_MOSAIC_TOPO_NONE,
5583 
5584     // 'BASIC' topos start here
5585     //
5586     // The result of using one of these Mosaic topos is that multiple monitors
5587     // will combine to create a single desktop.
5588     //
5589     NV_MOSAIC_TOPO_BEGIN_BASIC,
5590     NV_MOSAIC_TOPO_1x2_BASIC = NV_MOSAIC_TOPO_BEGIN_BASIC,
5591     NV_MOSAIC_TOPO_2x1_BASIC,
5592     NV_MOSAIC_TOPO_1x3_BASIC,
5593     NV_MOSAIC_TOPO_3x1_BASIC,
5594     NV_MOSAIC_TOPO_1x4_BASIC,
5595     NV_MOSAIC_TOPO_4x1_BASIC,
5596     NV_MOSAIC_TOPO_2x2_BASIC,
5597     NV_MOSAIC_TOPO_2x3_BASIC,
5598     NV_MOSAIC_TOPO_2x4_BASIC,
5599     NV_MOSAIC_TOPO_3x2_BASIC,
5600     NV_MOSAIC_TOPO_4x2_BASIC,
5601     NV_MOSAIC_TOPO_1x5_BASIC,
5602     NV_MOSAIC_TOPO_1x6_BASIC,
5603     NV_MOSAIC_TOPO_7x1_BASIC,
5604 
5605     // Add padding for 10 more entries. 6 will be enough room to specify every
5606     // possible topology with 8 or fewer displays, so this gives us a little
5607     // extra should we need it.
5608     NV_MOSAIC_TOPO_END_BASIC = NV_MOSAIC_TOPO_7x1_BASIC + 9,
5609 
5610     // 'PASSIVE_STEREO' topos start here
5611     //
5612     // The result of using one of these Mosaic topos is that multiple monitors
5613     // will combine to create a single PASSIVE STEREO desktop.  What this means is
5614     // that there will be two topos that combine to create the overall desktop.
5615     // One topo will be used for the left eye, and the other topo (of the
5616     // same rows x cols), will be used for the right eye.  The difference between
5617     // the two topos is that different GPUs and displays will be used.
5618     //
5619     NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO,    // value shadowed in nvEscDef.h
5620     NV_MOSAIC_TOPO_1x2_PASSIVE_STEREO = NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO,
5621     NV_MOSAIC_TOPO_2x1_PASSIVE_STEREO,
5622     NV_MOSAIC_TOPO_1x3_PASSIVE_STEREO,
5623     NV_MOSAIC_TOPO_3x1_PASSIVE_STEREO,
5624     NV_MOSAIC_TOPO_1x4_PASSIVE_STEREO,
5625     NV_MOSAIC_TOPO_4x1_PASSIVE_STEREO,
5626     NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO,
5627     NV_MOSAIC_TOPO_END_PASSIVE_STEREO = NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO + 4,
5628 
5629 
5630     //
5631     // Total number of topos.  Always leave this at the end of the enumeration.
5632     //
5633     NV_MOSAIC_TOPO_MAX  //! Total number of topologies.
5634 
5635 } NV_MOSAIC_TOPO;
5636 
5637 
5638 //
5639 //! This is a "topology brief" structure.  It tells you what you need to know about
5640 //! a topology at a high level. A list of these is returned when you query for the
5641 //! supported Mosaic information.
5642 //!
5643 //! If you need more detailed information about the topology, call
5644 //! NvAPI_Mosaic_GetTopoGroup() with the topology value from this structure.
5645 typedef struct
5646 {
5647     NvU32                        version;            //!< Version of this structure
5648     NV_MOSAIC_TOPO               topo;               //!< The topology
5649     NvU32                        enabled;            //!< 1 if topo is enabled, else 0
5650     NvU32                        isPossible;         //!< 1 if topo *can* be enabled, else 0
5651 
5652 } NV_MOSAIC_TOPO_BRIEF;
5653 
5654 //! Macro for constructing the version field of NV_MOSAIC_TOPO_BRIEF
5655 #define NVAPI_MOSAIC_TOPO_BRIEF_VER         MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_BRIEF,1)
5656 
5657 
5658 //
5659 //! Basic per-display settings that are used in setting/getting the Mosaic mode
5660 typedef struct
5661 {
5662     NvU32                        version;            //!< Version of this structure
5663     NvU32                        width;              //!< Per-display width
5664     NvU32                        height;             //!< Per-display height
5665     NvU32                        bpp;                //!< Bits per pixel
5666     NvU32                        freq;               //!< Display frequency
5667 } NV_MOSAIC_DISPLAY_SETTING;
5668 
5669 //! Macro for constructing the version field of NV_MOSAIC_DISPLAY_SETTING
5670 #define NVAPI_MOSAIC_DISPLAY_SETTING_VER         MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_SETTING,1)
5671 
5672 
5673 //
5674 // Set a reasonable max number of display settings to support
5675 // so arrays are bound.
5676 //
5677 #define NV_MOSAIC_DISPLAY_SETTINGS_MAX 40  //!< Set a reasonable maximum number of display settings to support
5678                                            //! so arrays are bound.
5679 
5680 
5681 //
5682 //! This structure is used to contain a list of supported Mosaic topologies
5683 //! along with the display settings that can be used.
5684 typedef struct
5685 {
5686     NvU32                       version;                                         //!< Version of this structure
5687     NvU32                       topoBriefsCount;                                 //!< Number of topologies in below array
5688     NV_MOSAIC_TOPO_BRIEF        topoBriefs[NV_MOSAIC_TOPO_MAX];                  //!< List of supported topologies with only brief details
5689     NvU32                       displaySettingsCount;                            //!< Number of display settings in below array
5690     NV_MOSAIC_DISPLAY_SETTING   displaySettings[NV_MOSAIC_DISPLAY_SETTINGS_MAX]; //!< List of per display settings possible
5691 
5692 } NV_MOSAIC_SUPPORTED_TOPO_INFO;
5693 
5694 //! Macro forconstructing  the version field of NV_MOSAIC_SUPPORTED_TOPO_INFO
5695 #define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER         MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPO_INFO,1)
5696 
5697 
5698 //
5699 // Indices to use to access the topos array within the mosaic topology
5700 #define NV_MOSAIC_TOPO_IDX_DEFAULT       0
5701 
5702 #define NV_MOSAIC_TOPO_IDX_LEFT_EYE      0
5703 #define NV_MOSAIC_TOPO_IDX_RIGHT_EYE     1
5704 #define NV_MOSAIC_TOPO_NUM_EYES          2
5705 
5706 
5707 //
5708 //! This defines the maximum number of topos that can be in a topo group.
5709 //! At this time, it is set to 2 because our largest topo group (passive
5710 //! stereo) only needs 2 topos (left eye and right eye).
5711 //!
5712 //! If a new topo group with more than 2 topos is added above, then this
5713 //! number will also have to be incremented.
5714 #define NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP 2
5715 
5716 
5717 //
5718 //! This structure defines a group of topologies that work together to create one
5719 //! overall layout.  All of the supported topologies are represented with this
5720 //! structure.
5721 //!
5722 //! For example, a 'Passive Stereo' topology would be represented with this
5723 //! structure, and would have separate topology details for the left and right eyes.
5724 //! The count would be 2.  A 'Basic' topology is also represented by this structure,
5725 //! with a count of 1.
5726 //!
5727 //! The structure is primarily used internally, but is exposed to applications in a
5728 //! read-only fashion because there are some details in it that might be useful
5729 //! (like the number of rows/cols, or connected display information).  A user can
5730 //! get the filled-in structure by calling NvAPI_Mosaic_GetTopoGroup().
5731 //!
5732 //! You can then look at the detailed values within the structure.  There are no
5733 //! entrypoints which take this structure as input (effectively making it read-only).
5734 typedef struct
5735 {
5736     NvU32                      version;              //!< Version of this structure
5737     NV_MOSAIC_TOPO_BRIEF       brief;                //!< The brief details of this topo
5738     NvU32                      count;                //!< Number of topos in array below
5739     NV_MOSAIC_TOPO_DETAILS     topos[NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP];
5740 
5741 } NV_MOSAIC_TOPO_GROUP;
5742 
5743 //! Macro for constructing the version field of NV_MOSAIC_TOPO_GROUP
5744 #define NVAPI_MOSAIC_TOPO_GROUP_VER         MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_GROUP,1)
5745 
5746 //! @}
5747 
5748 
5749 ///////////////////////////////////////////////////////////////////////////////
5750 //
5751 // FUNCTION NAME:   NvAPI_Mosaic_GetSupportedTopoInfo
5752 //
5753 //! DESCRIPTION:     This API returns information on the topologies and display resolutions
5754 //!                  supported by Mosaic mode.
5755 //!
5756 //!                  NOTE: Not all topologies returned can be set immediately.
5757 //!                        See 'OUT' Notes below.
5758 //!
5759 //!                  Once you get the list of supported topologies, you can call
5760 //!                  NvAPI_Mosaic_GetTopoGroup() with one of the Mosaic topologies if you need
5761 //!                  more information about it.
5762 //!
5763 //!     <b>'IN' Notes:</b>  pSupportedTopoInfo->version must be set before calling this function.
5764 //!                  If the specified version is not supported by this implementation,
5765 //!                  an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION).
5766 //!
5767 //!     <b>'OUT' Notes:</b> Some of the topologies returned might not be valid for one reason or
5768 //!                  another.  It could be due to mismatched or missing displays.  It
5769 //!                  could also be because the required number of GPUs is not found.
5770 //!                  At a high level, you can see if the topology is valid and can be enabled
5771 //!                  by looking at the pSupportedTopoInfo->topoBriefs[xxx].isPossible flag.
5772 //!                  If this is true, the topology can be enabled. If it
5773 //!                  is false, you can find out why it cannot be enabled by getting the
5774 //!                  details of the topology via NvAPI_Mosaic_GetTopoGroup().  From there,
5775 //!                  look at the validityMask of the individual topologies.  The bits can
5776 //!                  be tested against the NV_MOSAIC_TOPO_VALIDITY_* bits.
5777 //!
5778 //!                  It is possible for this function to return NVAPI_OK with no topologies
5779 //!                  listed in the return structure.  If this is the case, it means that
5780 //!                  the current hardware DOES support Mosaic, but with the given configuration
5781 //!                  no valid topologies were found.  This most likely means that SLI was not
5782 //!                  enabled for the hardware. Once enabled, you should see valid topologies
5783 //!                  returned from this function.
5784 //!
5785 //! SUPPORTED OS:  Windows XP and higher
5786 //!
5787 //!
5788 //! \since Release: 185
5789 //!
5790 //!
5791 //! \param [in,out]  pSupportedTopoInfo  Information about what topologies and display resolutions
5792 //!                                      are supported for Mosaic.
5793 //! \param [in]      type                The type of topologies the caller is interested in
5794 //!                                      getting. See NV_MOSAIC_TOPO_TYPE for possible values.
5795 //!
5796 //! \retval ::NVAPI_OK                          No errors in returning supported topologies.
5797 //! \retval ::NVAPI_NOT_SUPPORTED               Mosaic is not supported with the existing hardware.
5798 //! \retval ::NVAPI_INVALID_ARGUMENT            One or more arguments passed in are invalid.
5799 //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first.
5800 //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available.
5801 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
5802 //                                              compatible with this entry point.
5803 //! \retval ::NVAPI_ERROR:                      Miscellaneous error occurred.
5804 //!
5805 //! \ingroup mosaicapi
5806 ///////////////////////////////////////////////////////////////////////////////
5807 NVAPI_INTERFACE NvAPI_Mosaic_GetSupportedTopoInfo(NV_MOSAIC_SUPPORTED_TOPO_INFO *pSupportedTopoInfo, NV_MOSAIC_TOPO_TYPE type);
5808 
5809 
5810 ///////////////////////////////////////////////////////////////////////////////
5811 //
5812 // FUNCTION NAME:   NvAPI_Mosaic_GetTopoGroup
5813 //
5814 //! DESCRIPTION:     This API returns a structure filled with the details
5815 //!                  of the specified Mosaic topology.
5816 //!
5817 //!                  If the pTopoBrief passed in matches the current topology,
5818 //!                  then information in the brief and group structures
5819 //!                  will reflect what is current. Thus the brief would have
5820 //!                  the current 'enable' status, and the group would have the
5821 //!                  current overlap values. If there is no match, then the
5822 //!                  returned brief has an 'enable' status of FALSE (since it
5823 //!                  is obviously not enabled), and the overlap values will be 0.
5824 //!
5825 //!     <b>'IN' Notes:</b>  pTopoGroup->version must be set before calling this function.
5826 //!                  If the specified version is not supported by this implementation,
5827 //!                  an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION).
5828 //!
5829 //!
5830 //! SUPPORTED OS:  Windows XP and higher
5831 //!
5832 //!
5833 //! \since Release: 185
5834 //!
5835 //! \param [in]     pTopoBrief        The topology for getting the details
5836 //!                                   This must be one of the topology briefs
5837 //!                                   returned from NvAPI_Mosaic_GetSupportedTopoInfo().
5838 //! \param [in,out] pTopoGroup        The topology details matching the brief
5839 //!
5840 //! \retval ::NVAPI_OK                          Details were retrieved successfully.
5841 //! \retval ::NVAPI_NOT_SUPPORTED               Mosaic is not supported with the existing hardware.
5842 //! \retval ::NVAPI_INVALID_ARGUMENT            One or more argumentss passed in are invalid.
5843 //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first.
5844 //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available.
5845 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
5846 //                                              compatible with this entry point.
5847 //! \retval ::NVAPI_ERROR:                      Miscellaneous error occurred.
5848 //!
5849 //! \ingroup mosaicapi
5850 ///////////////////////////////////////////////////////////////////////////////
5851 NVAPI_INTERFACE NvAPI_Mosaic_GetTopoGroup(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_TOPO_GROUP *pTopoGroup);
5852 
5853 
5854 ///////////////////////////////////////////////////////////////////////////////
5855 //
5856 // FUNCTION NAME:   NvAPI_Mosaic_GetOverlapLimits
5857 //
5858 //! DESCRIPTION:     This API returns the X and Y overlap limits required if
5859 //!                  the given Mosaic topology and display settings are to be used.
5860 //!
5861 //! SUPPORTED OS:  Windows XP and higher
5862 //!
5863 //!
5864 //! \since Release: 185
5865 //!
5866 //! \param [in]   pTopoBrief          The topology for getting limits
5867 //!                                   This must be one of the topo briefs
5868 //!                                   returned from NvAPI_Mosaic_GetSupportedTopoInfo().
5869 //! \param [in]   pDisplaySetting     The display settings for getting the limits.
5870 //!                                   This must be one of the settings
5871 //!                                   returned from NvAPI_Mosaic_GetSupportedTopoInfo().
5872 //! \param [out]  pMinOverlapX        X overlap minimum
5873 //! \param [out]  pMaxOverlapX        X overlap maximum
5874 //! \param [out]  pMinOverlapY        Y overlap minimum
5875 //! \param [out]  pMaxOverlapY        Y overlap maximum
5876 //!
5877 //! \retval ::NVAPI_OK                          Details were retrieved successfully.
5878 //! \retval ::NVAPI_NOT_SUPPORTED               Mosaic is not supported with the existing hardware.
5879 //! \retval ::NVAPI_INVALID_ARGUMENT            One or more argumentss passed in are invalid.
5880 //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first.
5881 //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available.
5882 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
5883 //!                                             compatible with this entry point.
5884 //! \retval ::NVAPI_ERROR                       Miscellaneous error occurred.
5885 //!
5886 //! \ingroup mosaicapi
5887 ///////////////////////////////////////////////////////////////////////////////
5888 NVAPI_INTERFACE NvAPI_Mosaic_GetOverlapLimits(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pMinOverlapX, NvS32 *pMaxOverlapX, NvS32 *pMinOverlapY, NvS32 *pMaxOverlapY);
5889 
5890 
5891 ///////////////////////////////////////////////////////////////////////////////
5892 //
5893 // FUNCTION NAME:   NvAPI_Mosaic_SetCurrentTopo
5894 //
5895 //! DESCRIPTION:     This API sets the Mosaic topology and performs a mode switch
5896 //!                  using the given display settings.
5897 //!
5898 //!                  If NVAPI_OK is returned, the current Mosaic topology was set
5899 //!                  correctly.  Any other status returned means the
5900 //!                  topology was not set, and remains what it was before this
5901 //!                  function was called.
5902 //!
5903 //! SUPPORTED OS:  Windows XP and higher
5904 //!
5905 //!
5906 //! \since Release: 185
5907 //!
5908 //! \param [in]     pTopoBrief        The topology to set. This must be one of the topologies returned from
5909 //!                                   NvAPI_Mosaic_GetSupportedTopoInfo(), and it must have an isPossible value of 1.
5910 //! \param [in]     pDisplaySetting   The per display settings to be used in the Mosaic mode. This must be one of the
5911 //!                                   settings returned from NvAPI_Mosaic_GetSupportedTopoInfo().
5912 //! \param [in]     overlapX          The pixel overlap to use between horizontal displays (use positive a number for
5913 //!                                   overlap, or a negative number to create a gap.) If the overlap is out of bounds
5914 //!                                   for what is possible given the topo and display setting, the overlap will be clamped.
5915 //! \param [in]     overlapY          The pixel overlap to use between vertical displays (use positive a number for
5916 //!                                   overlap, or a negative number to create a gap.) If the overlap is out of bounds for
5917 //!                                   what is possible given the topo and display setting, the overlap will be clamped.
5918 //! \param [in]     enable            If 1, the topology being set will also be enabled, meaning that the mode set will
5919 //!                                   occur.  \n
5920 //!                                   If 0, you don't want to be in Mosaic mode right now, but want to set the current
5921 //!                                   Mosaic topology so you can enable it later with NvAPI_Mosaic_EnableCurrentTopo().
5922 //!
5923 //! \retval  ::NVAPI_OK                          The Mosaic topology was set.
5924 //! \retval  ::NVAPI_NOT_SUPPORTED               Mosaic is not supported with the existing hardware.
5925 //! \retval  ::NVAPI_INVALID_ARGUMENT            One or more argumentss passed in are invalid.
5926 //! \retval  ::NVAPI_TOPO_NOT_POSSIBLE           The topology passed in is not currently possible.
5927 //! \retval  ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first.
5928 //! \retval  ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available.
5929 //! \retval  ::NVAPI_INCOMPATIBLE_STRUCT_VERSION The version of the structure passed in is not
5930 //!                                              compatible with this entrypoint.
5931 //! \retval  ::NVAPI_MODE_CHANGE_FAILED          There was an error changing the display mode.
5932 //! \retval  ::NVAPI_ERROR                       Miscellaneous error occurred.
5933 //!
5934 //! \ingroup mosaicapi
5935 ///////////////////////////////////////////////////////////////////////////////
5936 NVAPI_INTERFACE NvAPI_Mosaic_SetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 overlapX, NvS32 overlapY, NvU32 enable);
5937 
5938 
5939 ///////////////////////////////////////////////////////////////////////////////
5940 //
5941 // FUNCTION NAME:   NvAPI_Mosaic_GetCurrentTopo
5942 //
5943 //! DESCRIPTION:     This API returns information for the current Mosaic topology.
5944 //!                  This includes topology, display settings, and overlap values.
5945 //!
5946 //!                  You can call NvAPI_Mosaic_GetTopoGroup() with the topology
5947 //!                  if you require more information.
5948 //!
5949 //!                  If there isn't a current topology, then pTopoBrief->topo will
5950 //!                  be NV_MOSAIC_TOPO_NONE.
5951 //!
5952 //! SUPPORTED OS:  Windows XP and higher
5953 //!
5954 //!
5955 //! \since Release: 185
5956 //!
5957 //! \param [out]     pTopoBrief       The current Mosaic topology
5958 //! \param [out]     pDisplaySetting  The current per-display settings
5959 //! \param [out]     pOverlapX        The pixel overlap between horizontal displays
5960 //! \param [out]     pOverlapY        The pixel overlap between vertical displays
5961 //!
5962 //! \retval ::NVAPI_OK                          Success getting current info.
5963 //! \retval ::NVAPI_NOT_SUPPORTED               Mosaic is not supported with the existing hardware.
5964 //! \retval ::NVAPI_INVALID_ARGUMENT            One or more argumentss passed in are invalid.
5965 //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first.
5966 //! \retval ::NVAPI_NO_IMPLEMENTATION           This entry point not available.
5967 //! \retval ::NVAPI_ERROR                       Miscellaneous error occurred.
5968 //!
5969 //! \ingroup mosaicapi
5970 ///////////////////////////////////////////////////////////////////////////////
5971 NVAPI_INTERFACE NvAPI_Mosaic_GetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pOverlapX, NvS32 *pOverlapY);
5972 
5973 
5974 ///////////////////////////////////////////////////////////////////////////////
5975 //
5976 // FUNCTION NAME:   NvAPI_Mosaic_EnableCurrentTopo
5977 //
5978 //! DESCRIPTION:     This API enables or disables the current Mosaic topology
5979 //!                  based on the setting of the incoming 'enable' parameter.
5980 //!
5981 //!                  An "enable" setting enables the current (previously set) Mosaic topology.
5982 //!                  Note that when the current Mosaic topology is retrieved, it must have an isPossible value of 1 or
5983 //!                  an error will occur.
5984 //!
5985 //!                  A "disable" setting disables the current Mosaic topology.
5986 //!                  The topology information will persist, even across reboots.
5987 //!                  To re-enable the Mosaic topology, call this function
5988 //!                  again with the enable parameter set to 1.
5989 //!
5990 //! SUPPORTED OS:  Windows XP and higher
5991 //!
5992 //!
5993 //! \since Release: 185
5994 //!
5995 //! \param [in]   enable               1 to enable the current Mosaic topo, 0 to disable it.
5996 //!
5997 //! \retval ::NVAPI_OK                 The Mosaic topo was enabled/disabled.
5998 //! \retval ::NVAPI_NOT_SUPPORTED      Mosaic is not supported with the existing hardware.
5999 //! \retval ::NVAPI_INVALID_ARGUMENT   One or more arguments passed in are invalid.
6000 //! \retval ::NVAPI_TOPO_NOT_POSSIBLE  The current topology is not currently possible.
6001 //! \retval ::NVAPI_MODE_CHANGE_FAILED There was an error changing the display mode.
6002 //! \retval ::NVAPI_ERROR:             Miscellaneous error occurred.
6003 //!
6004 //! \ingroup mosaicapi
6005 ///////////////////////////////////////////////////////////////////////////////
6006 NVAPI_INTERFACE NvAPI_Mosaic_EnableCurrentTopo(NvU32 enable);
6007 
6008 //! \ingroup mosaicapi
6009 //! @{
6010 typedef struct
6011 {
6012     NvU32                       displayId;              //!< DisplayID of the display
6013     NvS32                       overlapX;               //!< (+overlap, -gap)
6014     NvS32                       overlapY;               //!< (+overlap, -gap)
6015     NV_ROTATE                   rotation;               //!< Rotation of display
6016     NvU32                       cloneGroup;             //!< Reserved, must be 0
6017 } NV_MOSAIC_GRID_TOPO_DISPLAY;
6018 
6019 typedef struct
6020 {
6021     NvU32                       version;                            //!< Version of this structure
6022     NvU32                       rows;                               //!< Number of rows
6023     NvU32                       columns;                            //!< Number of columns
6024     NvU32                       displayCount;                       //!< Number of display details
6025     NvU32                       applyWithBezelCorrect : 1;          //!< When enabling and doing the modeset, do we switch to the bezel-corrected resolution
6026     NvU32                       immersiveGaming : 1;                //!< Enable as immersive gaming instead of Mosaic SLI (for Quadro-boards only)
6027     NvU32                       baseMosaic : 1;                     //!< Enable as Base Mosaic (Panoramic) instead of Mosaic SLI (for NVS and Quadro-boards only)
6028     NvU32                       driverReloadAllowed : 1;            //!< If necessary, reloading the driver is permitted (for Vista and above only). Will not be persisted. Value undefined on get.
6029     NvU32                       acceleratePrimaryDisplay : 1;       //!< Enable SLI acceleration on the primary display while in single-wide mode (For Immersive Gaming only). Will not be persisted. Value undefined on get.
6030     NvU32                       reserved : 27;                      //!< Reserved, must be 0
6031     NV_MOSAIC_GRID_TOPO_DISPLAY displays[NV_MOSAIC_MAX_DISPLAYS];   //!< Displays are done as [(row * columns) + column]
6032     NV_MOSAIC_DISPLAY_SETTING   displaySettings;                    //!< Display settings
6033 } NV_MOSAIC_GRID_TOPO_V1;
6034 
6035 //! Macro for constructing the version field of ::NV_MOSAIC_GRID_TOPO_V1
6036 #define NV_MOSAIC_GRID_TOPO_VER1         MAKE_NVAPI_VERSION(NV_MOSAIC_GRID_TOPO_V1,1)
6037 
6038 #ifndef NV_MOSAIC_GRID_TOPO_VER
6039 
6040 typedef NV_MOSAIC_GRID_TOPO_V1           NV_MOSAIC_GRID_TOPO;
6041 
6042 //! Macro for constructing the version field of ::NV_MOSAIC_GRID_TOPO
6043 #define NV_MOSAIC_GRID_TOPO_VER          NV_MOSAIC_GRID_TOPO_VER1
6044 
6045 #endif
6046 
6047 //! @}
6048 
6049 //! since Release R290
6050 
6051 
6052 ///////////////////////////////////////////////////////////////////////////////
6053 //
6054 // FUNCTION NAME:   NvAPI_Mosaic_SetDisplayGrids
6055 //
6056 //! DESCRIPTION:     Sets a new display topology, replacing any existing topologies
6057 //!                  that use the same displays.
6058 //!
6059 //!                  This function will look for an SLI configuration that will
6060 //!                  allow the display topology to work.
6061 //!
6062 //!                  To revert to a single display, specify that display as a 1x1
6063 //!                  grid.
6064 //!
6065 //! SUPPORTED OS:  Windows 7 and higher
6066 //!
6067 //!
6068 //! \param [in]      pGridTopologies    The topology details to set.
6069 //! \param [in]      gridCount          The number of elements in the pGridTopologies array.
6070 //! \param [in]      setTopoFlags       Zero or more of the NVAPI_MOSAIC_SETDISPLAYTOPO_FLAG_*
6071 //!                                     flags.
6072 //!
6073 //!
6074 //! \retval ::NVAPI_OK                          Capabilities have been returned.
6075 //! \retval ::NVAPI_INVALID_ARGUMENT            One or more args passed in are invalid.
6076 //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first
6077 //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available
6078 //! \retval ::NVAPI_NO_ACTIVE_SLI_TOPOLOGY      No matching GPU topologies could be found.
6079 //! \retval ::NVAPI_TOPO_NOT_POSSIBLE           One or more of the display grids are not valid.
6080 //! \retval ::NVAPI_ERROR                       Miscellaneous error occurred
6081 //! \ingroup mosaicapi
6082 ///////////////////////////////////////////////////////////////////////////////
6083 
6084 
6085 //! Do not change the current GPU topology. If the NO_DRIVER_RELOAD bit is not
6086 //! specified, then it may still require a driver reload.
6087 #define NV_MOSAIC_SETDISPLAYTOPO_FLAG_CURRENT_GPU_TOPOLOGY NV_BIT(0)
6088 
6089 //! Do not allow a driver reload. That is, stick with the same master GPU as well as the
6090 //! same SLI configuration.
6091 #define NV_MOSAIC_SETDISPLAYTOPO_FLAG_NO_DRIVER_RELOAD     NV_BIT(1)
6092 
6093 //! When choosing a GPU topology, choose the topology with the best performance.
6094 //! Without this flag, it will choose the topology that uses the smallest number
6095 //! of GPU's.
6096 #define NV_MOSAIC_SETDISPLAYTOPO_FLAG_MAXIMIZE_PERFORMANCE NV_BIT(2)
6097 
6098 //! Do not return an error if no configuration will work with all of the grids.
6099 #define NV_MOSAIC_SETDISPLAYTOPO_FLAG_ALLOW_INVALID        NV_BIT(3)
6100 
6101 NVAPI_INTERFACE NvAPI_Mosaic_SetDisplayGrids(__in_ecount(gridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies, __in NvU32 gridCount, __in NvU32 setTopoFlags);
6102 
6103 
6104 //! \ingroup mosaicapi
6105 typedef struct
6106 {
6107     NvU32 version;
6108     NvU32 errorFlags;            //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_ERROR_* flags.
6109     NvU32 warningFlags;          //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags.
6110 
6111     NvU32 displayCount;          //!< (OUT) The number of valid entries in the displays array.
6112     struct
6113     {
6114         NvU32 displayId;             //!< (OUT) The DisplayID of this display.
6115         NvU32 errorFlags;            //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_ERROR_* flags.
6116         NvU32 warningFlags;          //!< (OUT) Any of the NV_MOSAIC_DISPLAYTOPO_WARNING_* flags.
6117 
6118         NvU32  supportsRotation : 1; //!< (OUT) This display can be rotated
6119         NvU32  reserved : 31;        //!< (OUT) reserved
6120     } displays[NVAPI_MAX_DISPLAYS];
6121 } NV_MOSAIC_DISPLAY_TOPO_STATUS;
6122 
6123 //! \ingroup mosaicapi
6124 #define NV_MOSAIC_DISPLAY_TOPO_STATUS_VER         MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_TOPO_STATUS,1)
6125 
6126 
6127 ///////////////////////////////////////////////////////////////////////////////
6128 //
6129 // FUNCTION NAME:   NvAPI_Mosaic_ValidateDisplayGrids
6130 //
6131 //! DESCRIPTION:     Determines if a list of grid topologies is valid. It will choose an SLI
6132 //!                  configuration in the same way that NvAPI_Mosaic_SetDisplayGrids() does.
6133 //!
6134 //!                  On return, each element in the pTopoStatus array will contain any errors or
6135 //!                  warnings about each grid topology. If any error flags are set, then the topology
6136 //!                  is not valid. If any warning flags are set, then the topology is valid, but
6137 //!                  sub-optimal.
6138 //!
6139 //!                  If the ALLOW_INVALID flag is set, then it will continue to validate the grids
6140 //!                  even if no SLI configuration will allow all of the grids. In this case, a grid
6141 //!                  grid with no matching GPU topology will have the error
6142 //!                  flags NO_GPU_TOPOLOGY or NOT_SUPPORTED set.
6143 //!
6144 //!                  If the ALLOW_INVALID flag is not set and no matching SLI configuration is
6145 //!                  found, then it will skip the rest of the validation and return
6146 //!                  NVAPI_NO_ACTIVE_SLI_TOPOLOGY.
6147 //!
6148 //! SUPPORTED OS:  Windows 7 and higher
6149 //!
6150 //!
6151 //! \param [in]      setTopoFlags       Zero or more of the NVAPI_MOSAIC_SETDISPLAYTOPO_FLAG_*
6152 //!                                     flags.
6153 //! \param [in]      pGridTopologies    The array of grid topologies to verify.
6154 //! \param [in,out]  pTopoStatus        The array of problems and warnings with each grid topology.
6155 //! \param [in]      gridCount          The number of elements in the pGridTopologies and
6156 //!                                     pTopoStatus arrays.
6157 //!
6158 //!
6159 //! \retval ::NVAPI_OK:                          Capabilities have been returned.
6160 //! \retval ::NVAPI_INVALID_ARGUMENT:            One or more args passed in are invalid.
6161 //! \retval ::NVAPI_API_NOT_INTIALIZED:          The NvAPI API needs to be initialized first
6162 //! \retval ::NVAPI_NO_IMPLEMENTATION:           This entrypoint not available
6163 //! \retval ::NVAPI_NO_ACTIVE_SLI_TOPOLOGY:      No matching GPU topologies could be found.
6164 //! \retval ::NVAPI_ERROR:                       Miscellaneous error occurred
6165 //!
6166 //! \ingroup mosaicapi
6167 ///////////////////////////////////////////////////////////////////////////////
6168 NVAPI_INTERFACE NvAPI_Mosaic_ValidateDisplayGrids(__in NvU32 setTopoFlags,
6169         __in_ecount(gridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies,
6170         __inout_ecount_full(gridCount) NV_MOSAIC_DISPLAY_TOPO_STATUS *pTopoStatus,
6171         __in NvU32 gridCount);
6172 
6173 
6174 
6175 ///////////////////////////////////////////////////////////////////////////////
6176 //
6177 // FUNCTION NAME:   NvAPI_Mosaic_EnumDisplayModes
6178 //
6179 //! DESCRIPTION:     Determines the set of available display modes for a given grid topology.
6180 //!
6181 //! SUPPORTED OS:  Windows 7 and higher
6182 //!
6183 //!
6184 //! \param [in]      pGridTopology         The grid topology to use.
6185 //! \param [in,out]  pDisplaySettings      A pointer to an array of display settings to populate,
6186 //!                                        or NULL to find out the total number of available modes.
6187 //! \param [in,out]  pDisplayCount         If pDisplaySettings is not NULL, then pDisplayCount
6188 //!                                        should point to the number of elements in the
6189 //!                                        pDisplaySettings array. On return, it will contain the
6190 //!                                        number of modes that were actually returned. If
6191 //!                                        pDisplaySettings is NULL, then pDisplayCount will receive
6192 //!                                        the total number of modes that are available.
6193 //!
6194 //!
6195 //! \retval ::NVAPI_OK                          Capabilities have been returned.
6196 //! \retval ::NVAPI_INVALID_ARGUMENT            One or more args passed in are invalid.
6197 //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first
6198 //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available
6199 //! \retval ::NVAPI_ERROR                       Miscellaneous error occurred
6200 //!
6201 //! \ingroup mosaciapi
6202 ///////////////////////////////////////////////////////////////////////////////
6203 NVAPI_INTERFACE NvAPI_Mosaic_EnumDisplayModes(__in NV_MOSAIC_GRID_TOPO *pGridTopology,
6204         __inout_ecount_part_opt(*pDisplayCount, *pDisplayCount) NV_MOSAIC_DISPLAY_SETTING *pDisplaySettings,
6205         __inout NvU32 *pDisplayCount);
6206 
6207 
6208 //! SUPPORTED OS:  Windows 7 and higher
6209 //!
6210 ///////////////////////////////////////////////////////////////////////////////
6211 //
6212 // FUNCTION NAME:   NvAPI_Mosaic_EnumDisplayGrids
6213 //
6214 //! DESCRIPTION:     Enumerates the current active grid topologies. This includes Mosaic, IG, and
6215 //!                  Panoramic topologies, as well as single displays.
6216 //!
6217 //!                  If pGridTopologies is NULL, then pGridCount will be set to the number of active
6218 //!                  grid topologies.
6219 //!
6220 //!                  If pGridTopologies is not NULL, then pGridCount contains the maximum number of
6221 //!                  grid topologies to return. On return, pGridCount will be set to the number of
6222 //!                  grid topologies that were returned.
6223 //!
6224 //! \param [out]     pGridTopologies   The list of active grid topologies.
6225 //! \param [in,out]  pGridCount        A pointer to the number of grid topologies returned.
6226 //!
6227 //! \retval ::NVAPI_OK                          Capabilties have been returned.
6228 //! \retval ::NVAPI_END_ENUMERATION             There are no more topologies to return.
6229 //! \retval ::NVAPI_INVALID_ARGUMENT            One or more args passed in are invalid.
6230 //! \retval ::NVAPI_API_NOT_INTIALIZED          The NvAPI API needs to be initialized first
6231 //! \retval ::NVAPI_NO_IMPLEMENTATION           This entrypoint not available
6232 //! \retval ::NVAPI_ERROR                       Miscellaneous error occurred
6233 //!
6234 //! \ingroup mosaicapi
6235 ///////////////////////////////////////////////////////////////////////////////
6236 NVAPI_INTERFACE NvAPI_Mosaic_EnumDisplayGrids(__inout_ecount_part_opt(*pGridCount, *pGridCount) NV_MOSAIC_GRID_TOPO *pGridTopologies,
6237         __inout NvU32 *pGridCount);
6238 
6239 
6240 ////////////////////////////////////////////////////////////////////////////////////////
6241 //
6242 // ###########################################################################
6243 // DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS
6244 //
6245 //   Below is the Phase 1 Mosaic stuff, the Phase 2 stuff above is what will remain
6246 //   once Phase 2 is complete.  For a small amount of time, the two will co-exist.  As
6247 //   soon as apps (nvapichk, NvAPITestMosaic, and CPL) are updated to use the Phase 2
6248 //   entrypoints, the code below will be deleted.
6249 //
6250 // DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS
6251 // ###########################################################################
6252 //
6253 // Supported topos 1x4, 4x1 and 2x2 to start with.
6254 //
6255 // Selected scan out targets can be one per GPU or more than one on the same GPU.
6256 //
6257 // SAMPLE of MOSAIC 1x4 SCAN OUT TOPO with 8 pixel horizontal overlap
6258 //
6259 //+-------------------------++-------------------------++-------------------------++-------------------------+
6260 //|                         ||                         ||                         ||                         |
6261 //|                         ||                         ||                         ||                         |
6262 //|                         ||                         ||                         ||                         |
6263 //|        DVI1             ||           DVI2          ||         DVI3            ||          DVI4           |
6264 //|                         ||                         ||                         ||                         |
6265 //|                         ||                         ||                         ||                         |
6266 //|                         ||                         ||                         ||                         |
6267 //|                         ||                         ||                         ||                         |
6268 //+-------------------------++-------------------------++-------------------------++-------------------------+
6269 
6270 
6271 //! \addtogroup mosaicapi
6272 //! @{
6273 
6274 //! Used in NV_MOSAIC_TOPOLOGY.
6275 #define NVAPI_MAX_MOSAIC_DISPLAY_ROWS       8
6276 
6277 //! Used in NV_MOSAIC_TOPOLOGY.
6278 #define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS    8
6279 
6280 //! Used in NV_MOSAIC_TOPOLOGY.
6281 #define NVAPI_MAX_MOSAIC_TOPOS              16
6282 
6283 //! Used in NvAPI_GetCurrentMosaicTopology() and NvAPI_SetCurrentMosaicTopology().
6284 typedef struct
6285 {
6286     NvU32 version;                             //!< Version number of the mosaic topology
6287     NvU32 rowCount;                            //!< Horizontal display count
6288     NvU32 colCount;                            //!< Vertical display count
6289 
6290     struct
6291     {
6292         NvPhysicalGpuHandle hPhysicalGPU;      //!< Physical GPU to be used in the topology
6293         NvU32               displayOutputId;   //!< Connected display target
6294         NvS32               overlapX;          //!< Pixels of overlap on the left of target: (+overlap, -gap)
6295         NvS32               overlapY;          //!< Pixels of overlap on the top of target: (+overlap, -gap)
6296 
6297     } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS];
6298 
6299 } NV_MOSAIC_TOPOLOGY;
6300 
6301 //! Used in NV_MOSAIC_TOPOLOGY.
6302 #define NVAPI_MOSAIC_TOPOLOGY_VER         MAKE_NVAPI_VERSION(NV_MOSAIC_TOPOLOGY,1)
6303 
6304 //! Used in NvAPI_GetSupportedMosaicTopologies().
6305 typedef struct
6306 {
6307     NvU32                   version;
6308     NvU32                   totalCount;                     //!< Count of valid topologies
6309     NV_MOSAIC_TOPOLOGY      topos[NVAPI_MAX_MOSAIC_TOPOS];  //!< Maximum number of topologies
6310 
6311 } NV_MOSAIC_SUPPORTED_TOPOLOGIES;
6312 
6313 //! Used in NV_MOSAIC_SUPPORTED_TOPOLOGIES.
6314 #define NVAPI_MOSAIC_SUPPORTED_TOPOLOGIES_VER         MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPOLOGIES,1)
6315 
6316 //!@}
6317 
6318 
6319 ///////////////////////////////////////////////////////////////////////////////
6320 //
6321 // FUNCTION NAME:   NvAPI_GetSupportedMosaicTopologies
6322 //
6323 //! DESCRIPTION:     This API returns all valid Mosaic topologies.
6324 //!
6325 //! SUPPORTED OS:  Windows XP
6326 //!
6327 //!
6328 //! \since Release: 177
6329 //!
6330 //! \param [out] pMosaicTopos                   An array of valid Mosaic topologies.
6331 //!
6332 //! \retval      NVAPI_OK                       Call succeeded; 1 or more topologies were returned
6333 //! \retval      NVAPI_INVALID_ARGUMENT         One or more arguments are invalid
6334 //! \retval      NVAPI_MIXED_TARGET_TYPES       Mosaic topology is only possible with all targets of the same NV_GPU_OUTPUT_TYPE.
6335 //! \retval      NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
6336 //! \retval      NVAPI_NOT_SUPPORTED            Mosaic is not supported with GPUs on this system.
6337 //! \retval      NVAPI_NO_ACTIVE_SLI_TOPOLOGY   SLI is not enabled, yet needs to be, in order for this function to succeed.
6338 //!
6339 //! \ingroup     mosaicapi
6340 ///////////////////////////////////////////////////////////////////////////////
6341 NVAPI_INTERFACE NvAPI_GetSupportedMosaicTopologies(NV_MOSAIC_SUPPORTED_TOPOLOGIES *pMosaicTopos);
6342 
6343 ///////////////////////////////////////////////////////////////////////////////
6344 //
6345 // FUNCTION NAME:   NvAPI_GetCurrentMosaicTopology
6346 //
6347 //! DESCRIPTION:     This API gets the current Mosaic topology.
6348 //!
6349 //! SUPPORTED OS:  Windows XP
6350 //!
6351 //!
6352 //! \since Release: 177
6353 //!
6354 //! \param [out] pMosaicTopo                    The current Mosaic topology
6355 //! \param [out] pEnabled                       TRUE if returned topology is currently enabled, else FALSE
6356 //!
6357 //! \retval      NVAPI_OK                       Call succeeded
6358 //! \retval      NVAPI_INVALID_ARGUMENT         One or more arguments are invalid
6359 //! \retval      NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
6360 //! \retval      NVAPI_NOT_SUPPORTED            Mosaic is not supported with GPUs on this system.
6361 //! \retval      NVAPI_NO_ACTIVE_SLI_TOPOLOGY   SLI is not enabled, yet needs to be, in order for this function to succeed.
6362 //!
6363 //! \ingroup     mosaicapi
6364 ///////////////////////////////////////////////////////////////////////////////
6365 NVAPI_INTERFACE NvAPI_GetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo, NvU32 *pEnabled);
6366 
6367 
6368 ///////////////////////////////////////////////////////////////////////////////
6369 //
6370 // FUNCTION NAME:   NvAPI_SetCurrentMosaicTopology
6371 //
6372 //! DESCRIPTION:     This API sets the Mosaic topology, and enables it so that the
6373 //!                  Mosaic display settings are enumerated upon request.
6374 //!
6375 //! SUPPORTED OS:  Windows XP
6376 //!
6377 //!
6378 //! \since Release: 177
6379 //!
6380 //! \param [in]  pMosaicTopo                    A valid Mosaic topology
6381 //!
6382 //! \retval      NVAPI_OK                       Call succeeded
6383 //! \retval      NVAPI_INVALID_ARGUMENT         One or more arguments are invalid
6384 //! \retval      NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
6385 //! \retval      NVAPI_NOT_SUPPORTED            Mosaic is not supported with GPUs on this system.
6386 //! \retval      NVAPI_NO_ACTIVE_SLI_TOPOLOGY   SLI is not enabled, yet needs to be, in order for this function to succeed.
6387 //!
6388 //! \ingroup     mosaicapi
6389 ///////////////////////////////////////////////////////////////////////////////
6390 NVAPI_INTERFACE NvAPI_SetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo);
6391 
6392 ///////////////////////////////////////////////////////////////////////////////
6393 //
6394 // FUNCTION NAME:   NvAPI_EnableCurrentMosaicTopology
6395 //
6396 //! DESCRIPTION:    This API enables or disables the current Mosaic topology.
6397 //!                 When enabling, the last Mosaic topology will be set.
6398 //!
6399 //!                  - If enabled, enumeration of display settings will include valid Mosaic resolutions.
6400 //!                  - If disabled, enumeration of display settings will not include Mosaic resolutions.
6401 //!
6402 //! SUPPORTED OS:  Windows XP
6403 //!
6404 //!
6405 //! \since Release: 177
6406 //!
6407 //! \param [in]  enable                         TRUE to enable the Mosaic Topology, FALSE to disable it.
6408 //!
6409 //! \retval      NVAPI_OK                       Call succeeded
6410 //! \retval      NVAPI_INVALID_ARGUMENT         One or more arguments are invalid
6411 //! \retval      NVAPI_NVIDIA_DEVICE_NOT_FOUND  No NVIDIA GPU driving a display was found
6412 //! \retval      NVAPI_NOT_SUPPORTED            Mosaic is not supported with GPUs on this system.
6413 //! \retval      NVAPI_NO_ACTIVE_SLI_TOPOLOGY   SLI is not enabled, yet needs to be, in order for this function to succeed.
6414 //!
6415 //! \ingroup     mosaicapi
6416 ///////////////////////////////////////////////////////////////////////////////
6417 NVAPI_INTERFACE NvAPI_EnableCurrentMosaicTopology(NvU32 enable);
6418 
6419 
6420 #define NVAPI_MAX_GSYNC_DEVICES                       4
6421 
6422 
6423 // Sync Display APIs
6424 
6425 ///////////////////////////////////////////////////////////////////////////////
6426 //
6427 // FUNCTION NAME: NvAPI_GSync_EnumSyncDevices
6428 //
6429 //!   DESCRIPTION: This API returns an array of Sync device handles. A Sync device handle represents a
6430 //!                single Sync device on the system.
6431 //!
6432 //! SUPPORTED OS:  Windows 7 and higher
6433 //!
6434 //!
6435 //! \since Release: 313
6436 //!
6437 //! \param [out] nvGSyncHandles-  The caller provides an array of handles, which must contain at least
6438 //!                               NVAPI_MAX_GSYNC_DEVICES elements. The API will zero out the entire array and then fill in one
6439 //!                               or more handles. If an error occurs, the array is invalid.
6440 //! \param [out] *gsyncCount-     The caller provides the storage space. NvAPI_GSync_EnumSyncDevices
6441 //!                               sets *gsyncCount to indicate how many of the elements in the nvGSyncHandles[] array are valid.
6442 //!                               If an error occurs, *gsyncCount will be set to zero.
6443 //!
6444 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
6445 //!          If there are return error codes with specific meaning for this API, they are listed below.
6446 //! \retval ::NVAPI_INVALID_ARGUMENT         nvGSyncHandles or gsyncCount is NULL.
6447 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND  The queried Graphics system does not have any Sync Device.
6448 //!
6449 //! \ingroup gsyncapi
6450 ///////////////////////////////////////////////////////////////////////////////
6451 NVAPI_INTERFACE NvAPI_GSync_EnumSyncDevices(__out NvGSyncDeviceHandle nvGSyncHandles[NVAPI_MAX_GSYNC_DEVICES], __out NvU32 *gsyncCount);
6452 
6453 
6454 
6455 // GSync boardId values
6456 #define NVAPI_GSYNC_BOARD_ID_P358 856		//!< GSync board ID 0x358, see NV_GSYNC_CAPABILITIES
6457 #define NVAPI_GSYNC_BOARD_ID_P2060 8288		//!< GSync board ID 0x2060, see NV_GSYNC_CAPABILITIES
6458 
6459 
6460 //! Used in NvAPI_GSync_QueryCapabilities().
6461 typedef struct _NV_GSYNC_CAPABILITIES
6462 {
6463     NvU32   version;						//!< Version of the structure
6464     NvU32   boardId;						//!< Board ID
6465     NvU32   revision;						//!< FPGA Revision
6466     NvU32   capFlags;						//!< Capabilities of the Sync board. Reserved for future use
6467 } NV_GSYNC_CAPABILITIES;
6468 
6469 
6470 
6471 //! \ingroup gsyncapi
6472 //! Macro for constructing the version field of NV_GSYNC_CAPABILITIES.
6473 #define NV_GSYNC_CAPABILITIES_VER  MAKE_NVAPI_VERSION(NV_GSYNC_CAPABILITIES,1)
6474 
6475 ///////////////////////////////////////////////////////////////////////////////
6476 //
6477 // FUNCTION NAME: NvAPI_GSync_QueryCapabilities
6478 //
6479 //!   DESCRIPTION: This API returns the capabilities of the Sync device.
6480 //!
6481 //!
6482 //! SUPPORTED OS:  Windows 7 and higher
6483 //!
6484 //!
6485 //! \since Release: 313
6486 //!
6487 //! \param [in]    hNvGSyncDevice-        The handle for a Sync device for which the capabilities will be queried.
6488 //! \param [inout] *pNvGSyncCapabilities- The caller provides the storage space. NvAPI_GSync_QueryCapabilities() sets
6489 //!                                       *pNvGSyncCapabilities to the version and capabilities details of the Sync device
6490 //!                                       If an error occurs, *pNvGSyncCapabilities will be set to NULL.
6491 //!
6492 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
6493 //!          If there are return error codes with specific meaning for this API, they are listed below.
6494 //! \retval ::NVAPI_INVALID_ARGUMENT         hNvGSyncDevice is NULL.
6495 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND  The queried Graphics system does not have any Sync Device.
6496 //!
6497 //! \ingroup gsyncapi
6498 ///////////////////////////////////////////////////////////////////////////////
6499 NVAPI_INTERFACE NvAPI_GSync_QueryCapabilities(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CAPABILITIES *pNvGSyncCapabilities);
6500 
6501 
6502 
6503 //! Connector values for a GPU. Used in NV_GSYNC_GPU.
6504 typedef enum _NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR
6505 {
6506     NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_NONE         = 0,
6507     NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_PRIMARY      = 1,
6508     NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_SECONDARY    = 2,
6509     NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_TERTIARY     = 3,
6510     NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR_QUARTERNARY  = 4,
6511 } NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR;
6512 
6513 //! Display sync states. Used in NV_GSYNC_DISPLAY.
6514 typedef enum _NVAPI_GSYNC_DISPLAY_SYNC_STATE
6515 {
6516     NVAPI_GSYNC_DISPLAY_SYNC_STATE_UNSYNCED         = 0,
6517     NVAPI_GSYNC_DISPLAY_SYNC_STATE_SLAVE            = 1,
6518     NVAPI_GSYNC_DISPLAY_SYNC_STATE_MASTER           = 2,
6519 } NVAPI_GSYNC_DISPLAY_SYNC_STATE;
6520 
6521 typedef struct _NV_GSYNC_GPU
6522 {
6523     NvU32                               version;            //!< Version of the structure
6524     NvPhysicalGpuHandle                 hPhysicalGpu;       //!< GPU handle
6525     NVAPI_GSYNC_GPU_TOPOLOGY_CONNECTOR  connector;          //!< Indicates which connector on the device the GPU is connected to.
6526     NvPhysicalGpuHandle                 hProxyPhysicalGpu;  //!< GPU through which hPhysicalGpu is connected to the Sync device (if not directly connected)
6527                                                             //!<  - this is NULL otherwise
6528     NvU32                               isSynced : 1;       //!< Whether this GPU is sync'd or not.
6529     NvU32                               reserved : 31;      //!< Should be set to ZERO
6530 } NV_GSYNC_GPU;
6531 
6532 typedef struct _NV_GSYNC_DISPLAY
6533 {
6534     NvU32                               version;            //!< Version of the structure
6535     NvU32                               displayId;          //!< display identifier for displays.The GPU to which it is connected, can be retireved from NvAPI_SYS_GetPhysicalGpuFromDisplayId
6536     NvU32                               isMasterable : 1;   //!< Can this display be the master? (Read only)
6537     NvU32                               reserved : 31;      //!< Should be set to ZERO
6538     NVAPI_GSYNC_DISPLAY_SYNC_STATE      syncState;          //!< Is this display slave/master
6539                                                             //!< (Retrieved with topology or set by caller for enable/disable sync)
6540 } NV_GSYNC_DISPLAY;
6541 
6542 #define NV_GSYNC_DISPLAY_VER  MAKE_NVAPI_VERSION(NV_GSYNC_DISPLAY,1)
6543 #define NV_GSYNC_GPU_VER      MAKE_NVAPI_VERSION(NV_GSYNC_GPU,1)
6544 
6545 
6546 ///////////////////////////////////////////////////////////////////////////////
6547 //
6548 // FUNCTION NAME: NvAPI_GSync_GetTopology
6549 //
6550 //!   DESCRIPTION: This API returns the topology for the specified Sync device.
6551 //!
6552 //!
6553 //! SUPPORTED OS:  Windows 7 and higher
6554 //!
6555 //!
6556 //! \since Release: 313
6557 //!
6558 //! \param [in]       hNvGSyncDevice-     The caller provides the handle for a Sync device for which the topology will be queried.
6559 //! \param [in, out]  gsyncGpuCount-      It returns number of GPUs connected to Sync device
6560 //! \param [in, out]  gsyncGPUs-          It returns info about GPUs connected to Sync device
6561 //! \param [in, out]  gsyncDisplayCount-  It returns number of active displays that belongs to Sync device
6562 //! \param [in, out]  gsyncDisplays-      It returns info about all active displays that belongs to Sync device
6563 //!
6564 //! HOW TO USE: 1) make a call to get the number of GPUs connected OR displays synced through Sync device
6565 //!                by passing the gsyncGPUs OR gsyncDisplays as NULL respectively. Both gsyncGpuCount and gsyncDisplayCount can be retrieved in same call by passing
6566 //!                both gsyncGPUs and gsyncDisplays as NULL
6567 //!                On call success:
6568 //!             2) Allocate memory based on gsyncGpuCount(for gsyncGPUs) and/or gsyncDisplayCount(for gsyncDisplays) then make a call to populate gsyncGPUs and/or gsyncDisplays respectively.
6569 //!
6570 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
6571 //!          If there are return error codes with specific meaning for this API, they are listed below.
6572 //! \retval ::NVAPI_INVALID_ARGUMENT               hNvGSyncDevice is NULL.
6573 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND        The queried Graphics system does not have any Sync Device.
6574 //! \retval ::NVAPI_INSUFFICIENT_BUFFER            When the actual number of GPUs/displays in the topology exceed the number of elements allocated for SyncGPUs/SyncDisplays respectively.
6575 //!
6576 //! \ingroup gsyncapi
6577 ///////////////////////////////////////////////////////////////////////////////
6578 NVAPI_INTERFACE NvAPI_GSync_GetTopology(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout_opt NvU32 *gsyncGpuCount,  __inout_ecount_part_opt(*gsyncGpuCount, *gsyncGpuCount) NV_GSYNC_GPU *gsyncGPUs,
6579                                         __inout_opt NvU32 *gsyncDisplayCount, __inout_ecount_part_opt(*gsyncDisplayCount, *gsyncDisplayCount) NV_GSYNC_DISPLAY *gsyncDisplays);
6580 
6581 
6582 ///////////////////////////////////////////////////////////////////////////////
6583 //
6584 // FUNCTION NAME: NvAPI_GSync_SetSyncStateSettings
6585 //
6586 //!   DESCRIPTION: Sets a new sync state for the displays in system.
6587 //!
6588 //!
6589 //! SUPPORTED OS:  Windows 7 and higher
6590 //!
6591 //!
6592 //! \since Release: 313
6593 //!
6594 //! \param [in]  gsyncDisplayCount-			The number of displays in gsyncDisplays.
6595 //! \param [in]  pGsyncDisplays-			The caller provides the structure containing all displays that need to be synchronized in the system.
6596 //!											The displays that are not part of pGsyncDisplays, will be un-synchronized.
6597 //! \param [in]  flags-						Reserved for future use.
6598 //!
6599 //!
6600 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
6601 //!          If there are return error codes with specific meaning for this API, they are listed below.
6602 //!
6603 //! \retval ::NVAPI_INVALID_ARGUMENT			If the display topology or count not valid.
6604 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND		The queried Graphics system does not have any Sync Device.
6605 //! \retval ::NVAPI_INVALID_SYNC_TOPOLOGY       1.If any mosaic grid is partial.
6606 //!                                             2.If timing(HVisible/VVisible/refreshRate) applied of any display is different.
6607 //!                                             3.If There is a across GPU mosaic grid in system and that is not a part of pGsyncDisplays.
6608 //!
6609 //! \ingroup gsyncapi
6610 ///////////////////////////////////////////////////////////////////////////////
6611 NVAPI_INTERFACE NvAPI_GSync_SetSyncStateSettings(__in NvU32 gsyncDisplayCount, __in_ecount(gsyncDisplayCount) NV_GSYNC_DISPLAY *pGsyncDisplays, __in NvU32 flags);
6612 
6613 
6614 //! \ingroup gsyncapi
6615 
6616 //! Source signal edge to be used for output pulse. See NV_GSYNC_CONTROL_PARAMS.
6617 typedef enum _NVAPI_GSYNC_POLARITY
6618 {
6619     NVAPI_GSYNC_POLARITY_RISING_EDGE     = 0,
6620     NVAPI_GSYNC_POLARITY_FALLING_EDGE    = 1,
6621     NVAPI_GSYNC_POLARITY_BOTH_EDGES      = 2,
6622 } NVAPI_GSYNC_POLARITY;
6623 
6624 //! Used in NV_GSYNC_CONTROL_PARAMS.
6625 typedef enum _NVAPI_GSYNC_VIDEO_MODE
6626 {
6627     NVAPI_GSYNC_VIDEO_MODE_NONE          = 0,
6628     NVAPI_GSYNC_VIDEO_MODE_TTL           = 1,
6629     NVAPI_GSYNC_VIDEO_MODE_NTSCPALSECAM  = 2,
6630     NVAPI_GSYNC_VIDEO_MODE_HDTV          = 3,
6631     NVAPI_GSYNC_VIDEO_MODE_COMPOSITE     = 4,
6632 } NVAPI_GSYNC_VIDEO_MODE;
6633 
6634 //! Used in NV_GSYNC_CONTROL_PARAMS.
6635 typedef enum _NVAPI_GSYNC_SYNC_SOURCE
6636 {
6637     NVAPI_GSYNC_SYNC_SOURCE_VSYNC        = 0,
6638     NVAPI_GSYNC_SYNC_SOURCE_HOUSESYNC    = 1,
6639 } NVAPI_GSYNC_SYNC_SOURCE;
6640 
6641 //! Used in NV_GSYNC_CONTROL_PARAMS.
6642 typedef struct _NV_GSYNC_DELAY
6643 {
6644     NvU32        version;          //!< Version of the structure
6645     NvU32        numLines;         //!< delay to be induced in number of horizontal lines.
6646     NvU32        numPixels;        //!< delay to be induced in number of pixels.
6647     NvU32        maxLines;         //!< maximum number of lines supported at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only.
6648 	NvU32        minPixels;        //!< minimum number of pixels required at current display mode to induce delay. Updated by NvAPI_GSync_GetControlParameters(). Read only.
6649 } NV_GSYNC_DELAY;
6650 
6651 #define NV_GSYNC_DELAY_VER  MAKE_NVAPI_VERSION(NV_GSYNC_DELAY,1)
6652 
6653 //! Used in NvAPI_GSync_GetControlParameters() and NvAPI_GSync_SetControlParameters().
6654 typedef struct _NV_GSYNC_CONTROL_PARAMS
6655 {
6656     NvU32                       version;            //!< Version of the structure
6657     NVAPI_GSYNC_POLARITY        polarity;           //!< Leading edge / Falling edge / both
6658     NVAPI_GSYNC_VIDEO_MODE      vmode;              //!< None, TTL, NTSCPALSECAM, HDTV
6659     NvU32                       interval;           //!< Number of pulses to wait between framelock signal generation
6660     NVAPI_GSYNC_SYNC_SOURCE     source;             //!< VSync/House sync
6661     NvU32                       interlaceMode:1;    //!< interlace mode for a Sync device
6662     NvU32                       reserved:31;        //!< should be set zero
6663 	NV_GSYNC_DELAY              syncSkew;           //!< The time delay between the frame sync signal and the GPUs signal.
6664     NV_GSYNC_DELAY              startupDelay;       //!< Sync start delay for master.
6665 } NV_GSYNC_CONTROL_PARAMS;
6666 
6667 #define NV_GSYNC_CONTROL_PARAMS_VER  MAKE_NVAPI_VERSION(NV_GSYNC_CONTROL_PARAMS,1)
6668 
6669 
6670 ///////////////////////////////////////////////////////////////////////////////
6671 //
6672 // FUNCTION NAME: NvAPI_GSync_GetControlParameters
6673 //
6674 //!   DESCRIPTION: This API queries for sync control parameters as defined in NV_GSYNC_CONTROL_PARAMS.
6675 //!
6676 //! SUPPORTED OS:  Windows 7 and higher
6677 //!
6678 //!
6679 //! \since Release: 313
6680 //!
6681 //! \param [in]    hNvGSyncDevice-   The caller provides the handle of the Sync device for which to get parameters
6682 //! \param [inout] *pGsyncControls-  The caller provides the storage space. NvAPI_GSync_GetControlParameters() populates *pGsyncControls with values.
6683 //!
6684 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
6685 //!          If there are return error codes with specific meaning for this API, they are listed below.
6686 //! \retval ::NVAPI_INVALID_ARGUMENT          hNvGSyncDevice is NULL.
6687 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND   The queried Graphics system does not have any Sync Device.
6688 //!
6689 //! \ingroup gsyncapi
6690 ///////////////////////////////////////////////////////////////////////////////
6691 NVAPI_INTERFACE NvAPI_GSync_GetControlParameters(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CONTROL_PARAMS *pGsyncControls);
6692 
6693 
6694 
6695 //////////////////////////////////////////////////////////////////////////////
6696 //
6697 // FUNCTION NAME: NvAPI_GSync_SetControlParameters
6698 //
6699 //!   DESCRIPTION: This API sets control parameters as defined in NV_SYNC_CONTROL_PARAMS.
6700 //!
6701 //! SUPPORTED OS:  Windows 7 and higher
6702 //!
6703 //!
6704 //! \since Release: 313
6705 //!
6706 //! \param [in]  hNvGSyncDevice-   The caller provides the handle of the Sync device for which to get parameters
6707 //! \param [inout]  *pGsyncControls-  The caller provides NV_GSYNC_CONTROL_PARAMS. skew and startDelay will be updated to the applied values.
6708 //!
6709 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
6710 //!          If there are return error codes with specific meaning for this API, they are listed below.
6711 //! \retval ::NVAPI_INVALID_ARGUMENT          hNvGSyncDevice is NULL.
6712 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND   The queried Graphics system does not have any Sync Device.
6713 //! \retval ::NVAPI_SYNC_MASTER_NOT_FOUND     Control Parameters can only be set if there is a Sync Master enabled on the Gsync card.
6714 //!
6715 //! \ingroup gsyncapi
6716 ///////////////////////////////////////////////////////////////////////////////
6717 NVAPI_INTERFACE NvAPI_GSync_SetControlParameters(__in NvGSyncDeviceHandle hNvGSyncDevice, __inout NV_GSYNC_CONTROL_PARAMS *pGsyncControls);
6718 
6719 
6720 
6721 
6722 //! Used in NvAPI_GSync_AdjustSyncDelay()
6723 typedef enum _NVAPI_GSYNC_DELAY_TYPE
6724 {
6725 	NVAPI_GSYNC_DELAY_TYPE_UNKNOWN			= 0,
6726     NVAPI_GSYNC_DELAY_TYPE_SYNC_SKEW     	= 1,
6727     NVAPI_GSYNC_DELAY_TYPE_STARTUP     		= 2
6728 } NVAPI_GSYNC_DELAY_TYPE;
6729 
6730 //////////////////////////////////////////////////////////////////////////////
6731 //
6732 // FUNCTION NAME: NvAPI_GSync_AdjustSyncDelay
6733 //
6734 //!   DESCRIPTION: This API adjusts the skew and startDelay to the closest possible values. Use this API before calling NvAPI_GSync_SetControlParameters for skew or startDelay.
6735 //!
6736 //! SUPPORTED OS:  Windows 7 and higher
6737 //!
6738 //!
6739 //! \since Release: 319
6740 //!
6741 //! \param [in]  hNvGSyncDevice-   	The caller provides the handle of the Sync device for which to get parameters
6742 //! \param [in]  delayType-   		Specifies whether the delay is syncSkew or startupDelay.
6743 //! \param [inout]  *pGsyncDelay-  	The caller provides NV_GSYNC_DELAY. skew and startDelay will be adjusted and updated to the closest values.
6744 //! \param [out]  *syncSteps-  		This parameter is optional. It returns the sync delay in unit steps. If 0, it means either the NV_GSYNC_DELAY::numPixels is less than NV_GSYNC_DELAY::minPixels or NV_GSYNC_DELAY::numOfLines exceeds the NV_GSYNC_DELAY::maxLines.
6745 //!
6746 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
6747 //!          If there are return error codes with specific meaning for this API, they are listed below.
6748 //!
6749 //! \ingroup gsyncapi
6750 ///////////////////////////////////////////////////////////////////////////////
6751 NVAPI_INTERFACE NvAPI_GSync_AdjustSyncDelay(__in NvGSyncDeviceHandle hNvGSyncDevice, __in NVAPI_GSYNC_DELAY_TYPE delayType, __inout NV_GSYNC_DELAY *pGsyncDelay, __out_opt NvU32* syncSteps);
6752 
6753 
6754 
6755 //! Used in NvAPI_GSync_GetSyncStatus().
6756 typedef struct _NV_GSYNC_STATUS
6757 {
6758     NvU32 version;                          //!< Version of the structure
6759     NvU32 bIsSynced;                        //!< Is timing in sync?
6760     NvU32 bIsStereoSynced;                  //!< Does the phase of the timing signal from the GPU = the phase of the master sync signal?
6761     NvU32 bIsSyncSignalAvailable;           //!< Is the sync signal available?
6762 } NV_GSYNC_STATUS;
6763 
6764 //! Macro for constructing the version field for NV_GSYNC_STATUS.
6765 #define NV_GSYNC_STATUS_VER  MAKE_NVAPI_VERSION(NV_GSYNC_STATUS,1)
6766 
6767 ///////////////////////////////////////////////////////////////////////////////
6768 //
6769 // FUNCTION NAME: NvAPI_GSync_GetSyncStatus
6770 //
6771 //!   DESCRIPTION: This API queries the sync status of a GPU - timing, stereosync and sync signal availability.
6772 //!
6773 //! SUPPORTED OS:  Windows 7 and higher
6774 //!
6775 //!
6776 //! \since Release: 313
6777 //!
6778 //! \param [in]  hNvGSyncDevice-     Handle of the Sync device
6779 //! \param [in]  hPhysicalGpu-       GPU to be queried for sync status.
6780 //! \param [out] *status-            The caller provides the storage space. NvAPI_GSync_GetSyncStatus() populates *status with
6781 //!                                  values - timing, stereosync and signal availability. On error, *status is set to NULL.
6782 //!
6783 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
6784 //!          If there are return error codes with specific meaning for this API, they are listed below.
6785 //! \retval ::NVAPI_INVALID_ARGUMENT          hNvGSyncDevice is NULL / SyncTarget is NULL.
6786 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND   The queried Graphics system does not have any G-Sync Device.
6787 //!
6788 //! \ingroup gsyncapi
6789 ///////////////////////////////////////////////////////////////////////////////
6790 NVAPI_INTERFACE NvAPI_GSync_GetSyncStatus(__in NvGSyncDeviceHandle hNvGSyncDevice, __in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GSYNC_STATUS *status);
6791 
6792 
6793 //! \ingroup gsyncapi
6794 
6795 #define NVAPI_MAX_RJ45_PER_GSYNC    2
6796 
6797 //! Used in NV_GSYNC_STATUS_PARAMS.
6798 typedef enum _NVAPI_GSYNC_RJ45_IO
6799 {
6800     NVAPI_GSYNC_RJ45_OUTPUT     = 0,
6801     NVAPI_GSYNC_RJ45_INPUT      = 1,
6802     NVAPI_GSYNC_RJ45_UNUSED     = 2 //!< This field is used to notify that the framelock is not actually present.
6803 
6804 } NVAPI_GSYNC_RJ45_IO;
6805 
6806 //! \ingroup gsyncapi
6807 //! Used in NvAPI_GSync_GetStatusParameters().
6808 typedef struct _NV_GSYNC_STATUS_PARAMS
6809 {
6810     NvU32                       version;
6811     NvU32                       refreshRate;                                //!< The refresh rate
6812     NVAPI_GSYNC_RJ45_IO         RJ45_IO[NVAPI_MAX_RJ45_PER_GSYNC];          //!< Configured as input / output
6813     NvU32                       RJ45_Ethernet[NVAPI_MAX_RJ45_PER_GSYNC];    //!< Connected to ethernet hub? [ERRONEOUSLY CONNECTED!]
6814     NvU32                       houseSyncIncoming;                          //!< Incoming house sync frequency in Hz
6815     NvU32                       bHouseSync;                                 //!< Is house sync connected?
6816 } NV_GSYNC_STATUS_PARAMS;
6817 
6818 
6819 //! \ingroup gsyncapi
6820 //! Macro for constructing the version field of NV_GSYNC_STATUS_PARAMS
6821 #define NV_GSYNC_STATUS_PARAMS_VER  MAKE_NVAPI_VERSION(NV_GSYNC_STATUS_PARAMS,1)
6822 
6823 ///////////////////////////////////////////////////////////////////////////////
6824 //
6825 // FUNCTION NAME: NvAPI_GSync_GetStatusParameters
6826 //
6827 //!   DESCRIPTION: This API queries for sync status parameters as defined in NV_GSYNC_STATUS_PARAMS.
6828 //!
6829 //! SUPPORTED OS:  Windows XP and higher
6830 //!
6831 //!
6832 //! \since Release: 313
6833 //!
6834 //! \param [in]  hNvGSyncDevice   The caller provides the handle of the GSync device for which to get parameters
6835 //! \param [out] *pStatusParams   The caller provides the storage space. NvAPI_GSync_GetStatusParameters populates *pStatusParams with
6836 //!                               values.
6837 //!
6838 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
6839 //!          If there are return error codes with specific meaning for this API, they are listed below.
6840 //! \retval ::NVAPI_INVALID_ARGUMENT            hNvGSyncDevice is NULL / pStatusParams is NULL.
6841 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND     The queried Graphics system does not have any GSync Device.
6842 //!
6843 //! \ingroup gsyncapi
6844 ///////////////////////////////////////////////////////////////////////////////
6845 NVAPI_INTERFACE NvAPI_GSync_GetStatusParameters(NvGSyncDeviceHandle hNvGSyncDevice, NV_GSYNC_STATUS_PARAMS *pStatusParams);
6846 
6847 //! @}
6848 
6849 
6850 
6851 
6852 
6853 
6854 #if defined(_D3D9_H_)
6855 ///////////////////////////////////////////////////////////////////////////////
6856 //
6857 // FUNCTION NAME:   NvAPI_D3D9_RegisterResource
6858 //
6859 //! DESCRIPTION:    This API binds a resource (surface/texture) so that it can be retrieved
6860 //!                 internally by NVAPI.
6861 //!
6862 //! SUPPORTED OS:  Windows XP and higher
6863 //!
6864 //! \param [in]     pResource      surface/texture
6865 //!
6866 //! \return ::NVAPI_OK, ::NVAPI_ERROR
6867 //!
6868 //! \ingroup dx
6869 ///////////////////////////////////////////////////////////////////////////////
6870 NVAPI_INTERFACE NvAPI_D3D9_RegisterResource(IDirect3DResource9* pResource);
6871 #endif //defined(_D3D9_H_)
6872 #if defined(_D3D9_H_)
6873 ///////////////////////////////////////////////////////////////////////////////
6874 //
6875 // FUNCTION NAME:   NvAPI_D3D9_UnregisterResource
6876 //
6877 //! DESCRIPTION:     This API unbinds a resource (surface/texture) after use.
6878 //!
6879 //! SUPPORTED OS:  Windows XP and higher
6880 //!
6881 //!
6882 //! \param [in]     pResource    surface/texture
6883 //!
6884 //! \return ::NVAPI_OK, ::NVAPI_ERROR
6885 //!
6886 //! \ingroup dx
6887 ///////////////////////////////////////////////////////////////////////////////
6888 NVAPI_INTERFACE NvAPI_D3D9_UnregisterResource(IDirect3DResource9* pResource);
6889 
6890 #endif //defined(_D3D9_H_)
6891 
6892 
6893 
6894 #if defined(_D3D9_H_)
6895 ///////////////////////////////////////////////////////////////////////////////
6896 //
6897 // FUNCTION NAME: NvAPI_D3D9_AliasSurfaceAsTexture
6898 //
6899 //! \fn NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9* pDev,
6900 //!                                              IDirect3DSurface9* pSurface,
6901 //!                                              IDirect3DTexture9 **ppTexture,
6902 //!                                              DWORD dwFlag);
6903 //!   DESCRIPTION: Create a texture that is an alias of a surface registered with NvAPI.  The
6904 //!                new texture can be bound with IDirect3DDevice9::SetTexture().  Note that the texture must
6905 //!                be unbound before drawing to the surface again.
6906 //!                Unless the USE_SUPER flag is passed, MSAA surfaces will be resolved before
6907 //!                being used as a texture.  MSAA depth buffers are resolved with a point filter,
6908 //!                and non-depth MSAA surfaces are resolved with a linear filter.
6909 //!
6910 //! SUPPORTED OS:  Windows XP and higher
6911 //!
6912 //!
6913 //! \param [in]    pDev         The D3D device that owns the objects
6914 //! \param [in]    pSurface     Pointer to a surface that has been registered with NvAPI
6915 //!                             to which a texture alias is to be provided
6916 //! \param [out]   ppTexture    Fill with the texture created
6917 //! \param [in]    dwFlag       NVAPI_ALIAS_SURFACE_FLAG to describe how to handle the texture
6918 //!
6919 //! \retval ::NVAPI_OK                  completed request
6920 //! \retval ::NVAPI_INVALID_POINTER     A null pointer was passed as an argument
6921 //! \retval ::NVAPI_INVALID_ARGUMENT    One of the arguments was invalid, probably dwFlag.
6922 //! \retval ::NVAPI_UNREGISTERED_RESOURCE pSurface has not been registered with NvAPI
6923 //! \retval ::NVAPI_ERROR               error occurred
6924 //
6925 ///////////////////////////////////////////////////////////////////////////////
6926 
6927 
6928 //! \ingroup dx
6929 //! See NvAPI_D3D9_AliasSurfaceAsTexture().
6930 typedef enum {
6931     NVAPI_ALIAS_SURFACE_FLAG_NONE                     = 0x00000000,
6932     NVAPI_ALIAS_SURFACE_FLAG_USE_SUPER                = 0x00000001,  //!< Use the surface's msaa buffer directly as a texture, rather than resolving. (This is much slower, but potentially has higher quality.)
6933     NVAPI_ALIAS_SURFACE_FLAG_MASK                     = 0x00000001
6934 } NVAPI_ALIAS_SURFACE_FLAG;
6935 
6936 
6937 //! \ingroup dx
6938 NVAPI_INTERFACE NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9* pDev,
6939                                                  IDirect3DSurface9* pSurface,
6940                                                  IDirect3DTexture9 **ppTexture,
6941                                                  DWORD dwFlag);
6942 #endif //defined(_D3D9_H_)
6943 #if defined(_D3D9_H_)
6944 ///////////////////////////////////////////////////////////////////////////////
6945 //
6946 // FUNCTION NAME:   NvAPI_D3D9_StretchRectEx
6947 //
6948 //! DESCRIPTION:     This API copies the contents of the source resource to the destination
6949 //!                  resource.  This function can convert
6950 //!                  between a wider range of surfaces than
6951 //!                  IDirect3DDevice9::StretchRect.  For example, it can copy
6952 //!                  from a depth/stencil surface to a texture.
6953 //!
6954 //!                  The source and destination resources *must* be registered
6955 //!                  with NvAPI before being used with NvAPI_D3D9_StretchRectEx().
6956 //!
6957 //! SUPPORTED OS:  Windows XP and higher
6958 //!
6959 //!
6960 //! \param [in]     pDevice             The D3D device that owns the objects.
6961 //! \param [in]     pSourceResource     Pointer to the source resource.
6962 //! \param [in]     pSrcRect            Defines the rectangle on the source to copy from.  If NULL, copy from the entire resource.
6963 //! \param [in]     pDestResource       Pointer to the destination resource.
6964 //! \param [in]     pDstRect            Defines the rectangle on the destination to copy to.  If NULL, copy to the entire resource.
6965 //! \param [in]     Filter              Choose a filtering method: D3DTEXF_NONE, D3DTEXF_POINT, D3DTEXF_LINEAR.
6966 //!
6967 //! \retval ::NVAPI_OK                       completed request
6968 //! \retval ::NVAPI_INVALID_POINTER          An invalid pointer was passed as an argument (probably NULL)
6969 //! \retval ::NVAPI_INVALID_ARGUMENT         One of the arguments was invalid
6970 //! \retval ::NVAPI_UNREGISTERED_RESOURCE    a resource was passed in without being registered
6971 //! \retval ::NVAPI_ERROR                    error occurred
6972 //!
6973 //! \ingroup dx
6974 ///////////////////////////////////////////////////////////////////////////////
6975 NVAPI_INTERFACE NvAPI_D3D9_StretchRectEx(IDirect3DDevice9 * pDevice,
6976                                          IDirect3DResource9 * pSourceResource,
6977                                          CONST RECT * pSourceRect,
6978                                          IDirect3DResource9 * pDestResource,
6979                                          CONST RECT * pDestRect,
6980                                          D3DTEXTUREFILTERTYPE Filter);
6981 
6982 #endif //defined(_D3D9_H_)
6983 #if defined(_D3D9_H_)
6984 ///////////////////////////////////////////////////////////////////////////////
6985 //
6986 // FUNCTION NAME:   NvAPI_D3D9_ClearRT
6987 //
6988 //! DESCRIPTION:     This API Clears the currently bound render target(s) with the
6989 //!                  given color
6990 //!
6991 //!
6992 //! SUPPORTED OS:  Windows XP and higher
6993 //!
6994 //!
6995 //! \param [in]     pDevice             The D3D device that owns the objects.
6996 //! \param [in]     dwNumRects          The no of rectangles to clear. If 0, clear the entire surface (clipped to viewport)
6997 //! \param [in]     pRects              Defines the rectangles to clear.  Should be NULL if dwNumRects == 0
6998 //! \param [in]     r                   red component of the clear color
6999 //! \param [in]     g                   green component of the clear color
7000 //! \param [in]     b                   blue component of the clear color
7001 //! \param [in]     a                   alpha component of the clear color
7002 //!
7003 //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
7004 //!
7005 //! \ingroup dx
7006 ///////////////////////////////////////////////////////////////////////////////
7007 NVAPI_INTERFACE NvAPI_D3D9_ClearRT(IDirect3DDevice9 * pDevice,
7008                                    NvU32 dwNumRects,
7009                                    CONST RECT * pRects,
7010                                    float r, float g, float b, float a);
7011 #endif //if defined(_D3D9_H_)
7012 
7013 
7014 
7015 
7016 
7017 
7018 
7019 
7020 
7021 
7022 #if defined(_D3D9_H_) && defined(__cplusplus)
7023 //! SUPPORTED OS:  Windows XP and higher
7024 //!
7025 
7026 ///////////////////////////////////////////////////////////////////////////////
7027 //
7028 // FUNCTION NAME: NvAPI_D3D9_GetSurfaceHandle
7029 //
7030 //!  This function gets the handle of a given surface. This handle uniquely
7031 //!  identifies the surface through all NvAPI entries.
7032 //!
7033 //!
7034 //! \since Release: 313
7035 //!
7036 //! \param [in]     pSurface  Surface to be identified
7037 //! \param [out]    pHandle    Will be filled by the return handle
7038 //!
7039 //! \return An int which could be an NvAPI status or DX HRESULT code
7040 //! \ingroup dx
7041 ///////////////////////////////////////////////////////////////////////////////
7042 NVAPI_INTERFACE NvAPI_D3D9_GetSurfaceHandle(IDirect3DSurface9 *pSurface,
7043                                         NVDX_ObjectHandle *pHandle);
7044 
7045 #endif //defined(_D3D9_H_) && defined(__cplusplus)
7046 
7047 #if defined(_D3D9_H_) && defined(__cplusplus)
7048 //! SUPPORTED OS:  Windows Vista and higher
7049 //!
7050 //! \addtogroup dxvidcontrol
7051 //! @{
7052 
7053 ///////////////////////////////////////////////////////////////////////////////
7054 //
7055 // FUNCTION_NAME: NvAPI_D3D9_VideoSetStereoInfo
7056 //
7057 //! \fn NvAPI_D3D9_VideoSetStereoInfo(IDirect3DDevice9 *pDev,
7058 //!                                            NV_DX_VIDEO_STEREO_INFO *pStereoInfo);
7059 //! \code
7060 //!   DESCRIPTION: This api specifies the stereo format of a surface, so that the
7061 //!                surface could be used for stereo video processing or compositing.
7062 //!                In particular, this api could be used to link the left and right
7063 //!                views of a decoded picture.
7064 //!
7065 //! \since Release: 313
7066 //!
7067 //!         INPUT: pDev        - The device on which the stereo surface will be used
7068 //!                pStereoInfo - The stereo format of the surface
7069 //!
7070 //! RETURN STATUS: an int which could be an NvAPI status or DX HRESULT code
7071 //! \endcode
7072 ///////////////////////////////////////////////////////////////////////////////
7073 
7074 #ifndef NV_STEREO_VIDEO_FORMAT_DEFINE
7075 #define NV_STEREO_VIDEO_FORMAT_DEFINE
7076 
7077 
7078 typedef enum _NV_STEREO_VIDEO_FORMAT
7079 {
7080     NV_STEREO_VIDEO_FORMAT_NOT_STEREO         = 0,
7081 
7082     NV_STEREO_VIDEO_FORMAT_SIDE_BY_SIDE_LR    = 1,
7083     NV_STEREO_VIDEO_FORMAT_SIDE_BY_SIDE_RL    = 2,
7084     NV_STEREO_VIDEO_FORMAT_TOP_BOTTOM_LR      = 3,
7085     NV_STEREO_VIDEO_FORMAT_TOP_BOTTOM_RL      = 4,
7086     NV_STEREO_VIDEO_FORMAT_ROW_INTERLEAVE_LR  = 5,
7087     NV_STEREO_VIDEO_FORMAT_ROW_INTERLEAVE_RL  = 6,
7088     NV_STEREO_VIDEO_FORMAT_TWO_FRAMES_LR      = 7,
7089     NV_STEREO_VIDEO_FORMAT_MONO_PLUS_OFFSET   = 8,
7090 
7091     NV_STEREO_VIDEO_FORMAT_LAST               = 9,
7092 } NV_STEREO_VIDEO_FORMAT;
7093 
7094 #endif // NV_STEREO_VIDEO_FORMAT_DEFINE
7095 
7096 
7097 typedef struct _NV_DX_VIDEO_STEREO_INFO {
7098     NvU32                     dwVersion;         //!< Must be NV_DX_VIDEO_STEREO_INFO_VER
7099     NVDX_ObjectHandle         hSurface;          //!< The surface whose stereo format is to be set
7100     NVDX_ObjectHandle         hLinkedSurface;    //!< The linked surface (must be valid when eFormat==NV_STEREO_VIDEO_FORMAT_TWO_FRAMES_LR)
7101     NV_STEREO_VIDEO_FORMAT    eFormat;           //!< Stereo format of the surface
7102     NvS32                     sViewOffset;       //!< Signed offset of each view (positive offset indicating left view is shifted left)
7103     BOOL                      bStereoEnable;     //!< Whether stereo rendering should be enabled (if FALSE, only left view will be used)
7104 } NV_DX_VIDEO_STEREO_INFO;
7105 
7106 //! Macro for constructing the version field of ::NV_DX_VIDEO_STEREO_INFO
7107 #define NV_DX_VIDEO_STEREO_INFO_VER  MAKE_NVAPI_VERSION(NV_DX_VIDEO_STEREO_INFO,1)
7108 
7109 NVAPI_INTERFACE NvAPI_D3D9_VideoSetStereoInfo(IDirect3DDevice9 *pDev,
7110                                               NV_DX_VIDEO_STEREO_INFO *pStereoInfo);
7111 
7112 //! @}
7113 #endif //defined(_D3D9_H_) && defined(__cplusplus)
7114 
7115 
7116 
7117 
7118 
7119 #if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
7120 ///////////////////////////////////////////////////////////////////////////////
7121 //
7122 // FUNCTION NAME: NvAPI_D3D_SetFPSIndicatorState
7123 //
7124 //!   DESCRIPTION: Display an overlay that tracks the number of times the app presents per second, or,
7125 //!      the number of frames-per-second (FPS)
7126 //!
7127 //! SUPPORTED OS:  Windows XP and higher
7128 //!
7129 //!
7130 //! \param [in] bool    Whether or not to enable the fps indicator.
7131 //!
7132 //! \return ::NVAPI_OK,
7133 //!         ::NVAPI_ERROR
7134 //!
7135 //! \ingroup dx
7136 ///////////////////////////////////////////////////////////////////////////////
7137 NVAPI_INTERFACE NvAPI_D3D_SetFPSIndicatorState(IUnknown *pDev, NvU8 doEnable);
7138 
7139 #endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
7140 
7141 
7142 
7143 
7144 //! \ingroup vidio
7145 //! Unique identifier for VIO owner (process identifier or NVVIOOWNERID_NONE)
7146 typedef NvU32   NVVIOOWNERID;
7147 
7148 
7149 //! \addtogroup vidio
7150 //! @{
7151 
7152 
7153 #define NVVIOOWNERID_NONE                   0      //!< Unregistered ownerId
7154 
7155 
7156 //! Owner type for device
7157 typedef enum _NVVIOOWNERTYPE
7158 {
7159     NVVIOOWNERTYPE_NONE                             ,       //!<  No owner for the device
7160     NVVIOOWNERTYPE_APPLICATION                      ,       //!<  Application owns the device
7161     NVVIOOWNERTYPE_DESKTOP                          ,       //!<  Desktop transparent mode owns the device (not applicable for video input)
7162 }NVVIOOWNERTYPE;
7163 
7164 // Access rights for NvAPI_VIO_Open()
7165 
7166 //! Read access             (not applicable for video output)
7167 #define NVVIO_O_READ                        0x00000000
7168 
7169 //! Write exclusive access  (not applicable for video input)
7170 #define NVVIO_O_WRITE_EXCLUSIVE             0x00010001
7171 
7172 //!
7173 #define NVVIO_VALID_ACCESSRIGHTS            (NVVIO_O_READ              | \
7174                                              NVVIO_O_WRITE_EXCLUSIVE   )
7175 
7176 
7177 //! VIO_DATA.ulOwnerID high-bit is set only if device has been initialized by VIOAPI
7178 //! examined at NvAPI_GetCapabilities|NvAPI_VIO_Open to determine if settings need to be applied from registry or POR state read
7179 #define NVVIO_OWNERID_INITIALIZED  0x80000000
7180 
7181 //! VIO_DATA.ulOwnerID next-bit is set only if device is currently in exclusive write access mode from NvAPI_VIO_Open()
7182 #define NVVIO_OWNERID_EXCLUSIVE    0x40000000
7183 
7184 //! VIO_DATA.ulOwnerID lower bits are:
7185 //!  NVGVOOWNERTYPE_xxx enumerations indicating use context
7186 #define NVVIO_OWNERID_TYPEMASK     0x0FFFFFFF //!< mask for NVVIOOWNERTYPE_xxx
7187 
7188 
7189 //! @}
7190 
7191 //---------------------------------------------------------------------
7192 // Enumerations
7193 //---------------------------------------------------------------------
7194 
7195 
7196 //! \addtogroup vidio
7197 //! @{
7198 
7199 //! Video signal format and resolution
7200 typedef enum _NVVIOSIGNALFORMAT
7201 {
7202     NVVIOSIGNALFORMAT_NONE,                //!< Invalid signal format
7203     NVVIOSIGNALFORMAT_487I_59_94_SMPTE259_NTSC,     //!< 01  487i    59.94Hz  (SMPTE259) NTSC
7204     NVVIOSIGNALFORMAT_576I_50_00_SMPTE259_PAL,      //!< 02  576i    50.00Hz  (SMPTE259) PAL
7205     NVVIOSIGNALFORMAT_1035I_60_00_SMPTE260,         //!< 03  1035i   60.00Hz  (SMPTE260)
7206     NVVIOSIGNALFORMAT_1035I_59_94_SMPTE260,         //!< 04  1035i   59.94Hz  (SMPTE260)
7207     NVVIOSIGNALFORMAT_1080I_50_00_SMPTE295,         //!< 05  1080i   50.00Hz  (SMPTE295)
7208     NVVIOSIGNALFORMAT_1080I_60_00_SMPTE274,         //!< 06  1080i   60.00Hz  (SMPTE274)
7209     NVVIOSIGNALFORMAT_1080I_59_94_SMPTE274,         //!< 07  1080i   59.94Hz  (SMPTE274)
7210     NVVIOSIGNALFORMAT_1080I_50_00_SMPTE274,         //!< 08  1080i   50.00Hz  (SMPTE274)
7211     NVVIOSIGNALFORMAT_1080P_30_00_SMPTE274,         //!< 09  1080p   30.00Hz  (SMPTE274)
7212     NVVIOSIGNALFORMAT_1080P_29_97_SMPTE274,         //!< 10  1080p   29.97Hz  (SMPTE274)
7213     NVVIOSIGNALFORMAT_1080P_25_00_SMPTE274,         //!< 11  1080p   25.00Hz  (SMPTE274)
7214     NVVIOSIGNALFORMAT_1080P_24_00_SMPTE274,         //!< 12  1080p   24.00Hz  (SMPTE274)
7215     NVVIOSIGNALFORMAT_1080P_23_976_SMPTE274,        //!< 13  1080p   23.976Hz (SMPTE274)
7216     NVVIOSIGNALFORMAT_720P_60_00_SMPTE296,          //!< 14  720p    60.00Hz  (SMPTE296)
7217     NVVIOSIGNALFORMAT_720P_59_94_SMPTE296,          //!< 15  720p    59.94Hz  (SMPTE296)
7218     NVVIOSIGNALFORMAT_720P_50_00_SMPTE296,          //!< 16  720p    50.00Hz  (SMPTE296)
7219     NVVIOSIGNALFORMAT_1080I_48_00_SMPTE274,         //!< 17  1080I   48.00Hz  (SMPTE274)
7220     NVVIOSIGNALFORMAT_1080I_47_96_SMPTE274,         //!< 18  1080I   47.96Hz  (SMPTE274)
7221     NVVIOSIGNALFORMAT_720P_30_00_SMPTE296,          //!< 19  720p    30.00Hz  (SMPTE296)
7222     NVVIOSIGNALFORMAT_720P_29_97_SMPTE296,          //!< 20  720p    29.97Hz  (SMPTE296)
7223     NVVIOSIGNALFORMAT_720P_25_00_SMPTE296,          //!< 21  720p    25.00Hz  (SMPTE296)
7224     NVVIOSIGNALFORMAT_720P_24_00_SMPTE296,          //!< 22  720p    24.00Hz  (SMPTE296)
7225     NVVIOSIGNALFORMAT_720P_23_98_SMPTE296,          //!< 23  720p    23.98Hz  (SMPTE296)
7226     NVVIOSIGNALFORMAT_2048P_30_00_SMPTE372,         //!< 24  2048p   30.00Hz  (SMPTE372)
7227     NVVIOSIGNALFORMAT_2048P_29_97_SMPTE372,         //!< 25  2048p   29.97Hz  (SMPTE372)
7228     NVVIOSIGNALFORMAT_2048I_60_00_SMPTE372,         //!< 26  2048i   60.00Hz  (SMPTE372)
7229     NVVIOSIGNALFORMAT_2048I_59_94_SMPTE372,         //!< 27  2048i   59.94Hz  (SMPTE372)
7230     NVVIOSIGNALFORMAT_2048P_25_00_SMPTE372,         //!< 28  2048p   25.00Hz  (SMPTE372)
7231     NVVIOSIGNALFORMAT_2048I_50_00_SMPTE372,         //!< 29  2048i   50.00Hz  (SMPTE372)
7232     NVVIOSIGNALFORMAT_2048P_24_00_SMPTE372,         //!< 30  2048p   24.00Hz  (SMPTE372)
7233     NVVIOSIGNALFORMAT_2048P_23_98_SMPTE372,         //!< 31  2048p   23.98Hz  (SMPTE372)
7234     NVVIOSIGNALFORMAT_2048I_48_00_SMPTE372,         //!< 32  2048i   48.00Hz  (SMPTE372)
7235     NVVIOSIGNALFORMAT_2048I_47_96_SMPTE372,         //!< 33  2048i   47.96Hz  (SMPTE372)
7236 
7237     NVVIOSIGNALFORMAT_1080PSF_25_00_SMPTE274,       //!< 34  1080PsF 25.00Hz  (SMPTE274)
7238     NVVIOSIGNALFORMAT_1080PSF_29_97_SMPTE274,       //!< 35  1080PsF 29.97Hz  (SMPTE274)
7239     NVVIOSIGNALFORMAT_1080PSF_30_00_SMPTE274,       //!< 36  1080PsF 30.00Hz  (SMPTE274)
7240     NVVIOSIGNALFORMAT_1080PSF_24_00_SMPTE274,       //!< 37  1080PsF 24.00Hz  (SMPTE274)
7241     NVVIOSIGNALFORMAT_1080PSF_23_98_SMPTE274,       //!< 38  1080PsF 23.98Hz  (SMPTE274)
7242 
7243     NVVIOSIGNALFORMAT_1080P_50_00_SMPTE274_3G_LEVEL_A, //!< 39  1080P   50.00Hz  (SMPTE274) 3G Level A
7244     NVVIOSIGNALFORMAT_1080P_59_94_SMPTE274_3G_LEVEL_A, //!< 40  1080P   59.94Hz  (SMPTE274) 3G Level A
7245     NVVIOSIGNALFORMAT_1080P_60_00_SMPTE274_3G_LEVEL_A, //!< 41  1080P   60.00Hz  (SMPTE274) 3G Level A
7246 
7247     NVVIOSIGNALFORMAT_1080P_60_00_SMPTE274_3G_LEVEL_B, //!< 42  1080p   60.00Hz  (SMPTE274) 3G Level B
7248     NVVIOSIGNALFORMAT_1080I_60_00_SMPTE274_3G_LEVEL_B, //!< 43  1080i   60.00Hz  (SMPTE274) 3G Level B
7249     NVVIOSIGNALFORMAT_2048I_60_00_SMPTE372_3G_LEVEL_B, //!< 44  2048i   60.00Hz  (SMPTE372) 3G Level B
7250     NVVIOSIGNALFORMAT_1080P_50_00_SMPTE274_3G_LEVEL_B, //!< 45  1080p   50.00Hz  (SMPTE274) 3G Level B
7251     NVVIOSIGNALFORMAT_1080I_50_00_SMPTE274_3G_LEVEL_B, //!< 46  1080i   50.00Hz  (SMPTE274) 3G Level B
7252     NVVIOSIGNALFORMAT_2048I_50_00_SMPTE372_3G_LEVEL_B, //!< 47  2048i   50.00Hz  (SMPTE372) 3G Level B
7253     NVVIOSIGNALFORMAT_1080P_30_00_SMPTE274_3G_LEVEL_B, //!< 48  1080p   30.00Hz  (SMPTE274) 3G Level B
7254     NVVIOSIGNALFORMAT_2048P_30_00_SMPTE372_3G_LEVEL_B, //!< 49  2048p   30.00Hz  (SMPTE372) 3G Level B
7255     NVVIOSIGNALFORMAT_1080P_25_00_SMPTE274_3G_LEVEL_B, //!< 50  1080p   25.00Hz  (SMPTE274) 3G Level B
7256     NVVIOSIGNALFORMAT_2048P_25_00_SMPTE372_3G_LEVEL_B, //!< 51  2048p   25.00Hz  (SMPTE372) 3G Level B
7257     NVVIOSIGNALFORMAT_1080P_24_00_SMPTE274_3G_LEVEL_B, //!< 52  1080p   24.00Hz  (SMPTE274) 3G Level B
7258     NVVIOSIGNALFORMAT_2048P_24_00_SMPTE372_3G_LEVEL_B, //!< 53  2048p   24.00Hz  (SMPTE372) 3G Level B
7259     NVVIOSIGNALFORMAT_1080I_48_00_SMPTE274_3G_LEVEL_B, //!< 54  1080i   48.00Hz  (SMPTE274) 3G Level B
7260     NVVIOSIGNALFORMAT_2048I_48_00_SMPTE372_3G_LEVEL_B, //!< 55  2048i   48.00Hz  (SMPTE372) 3G Level B
7261     NVVIOSIGNALFORMAT_1080P_59_94_SMPTE274_3G_LEVEL_B, //!< 56  1080p   59.94Hz  (SMPTE274) 3G Level B
7262     NVVIOSIGNALFORMAT_1080I_59_94_SMPTE274_3G_LEVEL_B, //!< 57  1080i   59.94Hz  (SMPTE274) 3G Level B
7263     NVVIOSIGNALFORMAT_2048I_59_94_SMPTE372_3G_LEVEL_B, //!< 58  2048i   59.94Hz  (SMPTE372) 3G Level B
7264     NVVIOSIGNALFORMAT_1080P_29_97_SMPTE274_3G_LEVEL_B, //!< 59  1080p   29.97Hz  (SMPTE274) 3G Level B
7265     NVVIOSIGNALFORMAT_2048P_29_97_SMPTE372_3G_LEVEL_B, //!< 60  2048p   29.97Hz  (SMPTE372) 3G Level B
7266     NVVIOSIGNALFORMAT_1080P_23_98_SMPTE274_3G_LEVEL_B, //!< 61  1080p   29.98Hz  (SMPTE274) 3G Level B
7267     NVVIOSIGNALFORMAT_2048P_23_98_SMPTE372_3G_LEVEL_B, //!< 62  2048p   29.98Hz  (SMPTE372) 3G Level B
7268     NVVIOSIGNALFORMAT_1080I_47_96_SMPTE274_3G_LEVEL_B, //!< 63  1080i   47.96Hz  (SMPTE274) 3G Level B
7269     NVVIOSIGNALFORMAT_2048I_47_96_SMPTE372_3G_LEVEL_B, //!< 64  2048i   47.96Hz  (SMPTE372) 3G Level B
7270 
7271     NVVIOSIGNALFORMAT_END                              //!< 65  To indicate end of signal format list
7272 
7273 }NVVIOSIGNALFORMAT;
7274 
7275 //! SMPTE standards format
7276 typedef enum _NVVIOVIDEOSTANDARD
7277 {
7278     NVVIOVIDEOSTANDARD_SMPTE259                        ,       //!< SMPTE259
7279     NVVIOVIDEOSTANDARD_SMPTE260                        ,       //!< SMPTE260
7280     NVVIOVIDEOSTANDARD_SMPTE274                        ,       //!< SMPTE274
7281     NVVIOVIDEOSTANDARD_SMPTE295                        ,       //!< SMPTE295
7282     NVVIOVIDEOSTANDARD_SMPTE296                        ,       //!< SMPTE296
7283     NVVIOVIDEOSTANDARD_SMPTE372                        ,       //!< SMPTE372
7284 }NVVIOVIDEOSTANDARD;
7285 
7286 //! HD or SD video type
7287 typedef enum _NVVIOVIDEOTYPE
7288 {
7289     NVVIOVIDEOTYPE_SD                                  ,       //!< Standard-definition (SD)
7290     NVVIOVIDEOTYPE_HD                                  ,       //!< High-definition     (HD)
7291 }NVVIOVIDEOTYPE;
7292 
7293 //! Interlace mode
7294 typedef enum _NVVIOINTERLACEMODE
7295 {
7296     NVVIOINTERLACEMODE_PROGRESSIVE                     ,       //!< Progressive               (p)
7297     NVVIOINTERLACEMODE_INTERLACE                       ,       //!< Interlace                 (i)
7298     NVVIOINTERLACEMODE_PSF                             ,       //!< Progressive Segment Frame (psf)
7299 }NVVIOINTERLACEMODE;
7300 
7301 //! Video data format
7302 typedef enum _NVVIODATAFORMAT
7303 {
7304     NVVIODATAFORMAT_UNKNOWN   = -1                     ,       //!< Invalid DataFormat
7305     NVVIODATAFORMAT_R8G8B8_TO_YCRCB444                 ,       //!< R8:G8:B8                => YCrCb  (4:4:4)
7306     NVVIODATAFORMAT_R8G8B8A8_TO_YCRCBA4444             ,       //!< R8:G8:B8:A8             => YCrCbA (4:4:4:4)
7307     NVVIODATAFORMAT_R8G8B8Z10_TO_YCRCBZ4444            ,       //!< R8:G8:B8:Z10            => YCrCbZ (4:4:4:4)
7308     NVVIODATAFORMAT_R8G8B8_TO_YCRCB422                 ,       //!< R8:G8:B8                => YCrCb  (4:2:2)
7309     NVVIODATAFORMAT_R8G8B8A8_TO_YCRCBA4224             ,       //!< R8:G8:B8:A8             => YCrCbA (4:2:2:4)
7310     NVVIODATAFORMAT_R8G8B8Z10_TO_YCRCBZ4224            ,       //!< R8:G8:B8:Z10            => YCrCbZ (4:2:2:4)
7311     NVVIODATAFORMAT_X8X8X8_444_PASSTHRU                ,       //!< R8:G8:B8                => RGB    (4:4:4)
7312     NVVIODATAFORMAT_X8X8X8A8_4444_PASSTHRU             ,       //!< R8:G8:B8:A8             => RGBA   (4:4:4:4)
7313     NVVIODATAFORMAT_X8X8X8Z10_4444_PASSTHRU            ,       //!< R8:G8:B8:Z10            => RGBZ   (4:4:4:4)
7314     NVVIODATAFORMAT_X10X10X10_444_PASSTHRU             ,       //!< Y10:CR10:CB10           => YCrCb  (4:4:4)
7315     NVVIODATAFORMAT_X10X8X8_444_PASSTHRU               ,       //!< Y10:CR8:CB8             => YCrCb  (4:4:4)
7316     NVVIODATAFORMAT_X10X8X8A10_4444_PASSTHRU           ,       //!< Y10:CR8:CB8:A10         => YCrCbA (4:4:4:4)
7317     NVVIODATAFORMAT_X10X8X8Z10_4444_PASSTHRU           ,       //!< Y10:CR8:CB8:Z10         => YCrCbZ (4:4:4:4)
7318     NVVIODATAFORMAT_DUAL_R8G8B8_TO_DUAL_YCRCB422       ,       //!< R8:G8:B8 + R8:G8:B8     => YCrCb  (4:2:2 + 4:2:2)
7319     NVVIODATAFORMAT_DUAL_X8X8X8_TO_DUAL_422_PASSTHRU   ,       //!< Y8:CR8:CB8 + Y8:CR8:CB8 => YCrCb  (4:2:2 + 4:2:2)
7320     NVVIODATAFORMAT_R10G10B10_TO_YCRCB422              ,       //!< R10:G10:B10             => YCrCb  (4:2:2)
7321     NVVIODATAFORMAT_R10G10B10_TO_YCRCB444              ,       //!< R10:G10:B10             => YCrCb  (4:4:4)
7322     NVVIODATAFORMAT_X12X12X12_444_PASSTHRU             ,       //!< X12:X12:X12             => XXX    (4:4:4)
7323     NVVIODATAFORMAT_X12X12X12_422_PASSTHRU             ,       //!< X12:X12:X12             => XXX    (4:2:2)
7324     NVVIODATAFORMAT_Y10CR10CB10_TO_YCRCB422            ,       //!< Y10:CR10:CB10           => YCrCb  (4:2:2)
7325     NVVIODATAFORMAT_Y8CR8CB8_TO_YCRCB422               ,       //!< Y8:CR8:CB8              => YCrCb  (4:2:2)
7326     NVVIODATAFORMAT_Y10CR8CB8A10_TO_YCRCBA4224         ,       //!< Y10:CR8:CB8:A10         => YCrCbA (4:2:2:4)
7327     NVVIODATAFORMAT_R10G10B10_TO_RGB444                ,       //!< R10:G10:B10             => RGB    (4:4:4)
7328     NVVIODATAFORMAT_R12G12B12_TO_YCRCB444              ,       //!< R12:G12:B12             => YCrCb  (4:4:4)
7329     NVVIODATAFORMAT_R12G12B12_TO_YCRCB422              ,       //!< R12:G12:B12             => YCrCb  (4:2:2)
7330 }NVVIODATAFORMAT;
7331 
7332 //! Video output area
7333 typedef enum _NVVIOOUTPUTAREA
7334 {
7335     NVVIOOUTPUTAREA_FULLSIZE                           ,       //!< Output to entire video resolution (full size)
7336     NVVIOOUTPUTAREA_SAFEACTION                         ,       //!< Output to centered 90% of video resolution (safe action)
7337     NVVIOOUTPUTAREA_SAFETITLE                          ,       //!< Output to centered 80% of video resolution (safe title)
7338 }NVVIOOUTPUTAREA;
7339 
7340 //! Synchronization source
7341 typedef enum _NVVIOSYNCSOURCE
7342 {
7343     NVVIOSYNCSOURCE_SDISYNC                            ,       //!< SDI Sync  (Digital input)
7344     NVVIOSYNCSOURCE_COMPSYNC                           ,       //!< COMP Sync (Composite input)
7345 }NVVIOSYNCSOURCE;
7346 
7347 //! Composite synchronization type
7348 typedef enum _NVVIOCOMPSYNCTYPE
7349 {
7350     NVVIOCOMPSYNCTYPE_AUTO                             ,       //!< Auto-detect
7351     NVVIOCOMPSYNCTYPE_BILEVEL                          ,       //!< Bi-level signal
7352     NVVIOCOMPSYNCTYPE_TRILEVEL                         ,       //!< Tri-level signal
7353 }NVVIOCOMPSYNCTYPE;
7354 
7355 //! Video input output status
7356 typedef enum _NVVIOINPUTOUTPUTSTATUS
7357 {
7358     NVINPUTOUTPUTSTATUS_OFF                            ,       //!< Not in use
7359     NVINPUTOUTPUTSTATUS_ERROR                          ,       //!< Error detected
7360     NVINPUTOUTPUTSTATUS_SDI_SD                         ,       //!< SDI (standard-definition)
7361     NVINPUTOUTPUTSTATUS_SDI_HD                         ,       //!< SDI (high-definition)
7362 }NVVIOINPUTOUTPUTSTATUS;
7363 
7364 //! Synchronization input status
7365 typedef enum _NVVIOSYNCSTATUS
7366 {
7367     NVVIOSYNCSTATUS_OFF                                ,       //!< Sync not detected
7368     NVVIOSYNCSTATUS_ERROR                              ,       //!< Error detected
7369     NVVIOSYNCSTATUS_SYNCLOSS                           ,       //!< Genlock in use, format mismatch with output
7370     NVVIOSYNCSTATUS_COMPOSITE                          ,       //!< Composite sync
7371     NVVIOSYNCSTATUS_SDI_SD                             ,       //!< SDI sync (standard-definition)
7372     NVVIOSYNCSTATUS_SDI_HD                             ,       //!< SDI sync (high-definition)
7373 }NVVIOSYNCSTATUS;
7374 
7375 //! Video Capture Status
7376 typedef enum _NVVIOCAPTURESTATUS
7377 {
7378     NVVIOSTATUS_STOPPED                                ,       //!< Sync not detected
7379     NVVIOSTATUS_RUNNING                                ,       //!< Error detected
7380     NVVIOSTATUS_ERROR                                  ,       //!< Genlock in use, format mismatch with output
7381 }NVVIOCAPTURESTATUS;
7382 
7383 //! Video Capture Status
7384 typedef enum _NVVIOSTATUSTYPE
7385 {
7386     NVVIOSTATUSTYPE_IN                                 ,       //!< Input Status
7387     NVVIOSTATUSTYPE_OUT                                ,       //!< Output Status
7388 }NVVIOSTATUSTYPE;
7389 
7390 
7391 //! Assumption, maximum 4 SDI input and 4 SDI output cards supported on a system
7392 #define NVAPI_MAX_VIO_DEVICES                 8
7393 
7394 //! 4 physical jacks supported on each SDI input card.
7395 #define NVAPI_MAX_VIO_JACKS                   4
7396 
7397 
7398 //! Each physical jack an on SDI input card can have
7399 //! two "channels" in the case of "3G" VideoFormats, as specified
7400 //! by SMPTE 425; for non-3G VideoFormats, only the first channel within
7401 //! a physical jack is valid.
7402 #define NVAPI_MAX_VIO_CHANNELS_PER_JACK       2
7403 
7404 //! 4 Streams, 1 per physical jack
7405 #define NVAPI_MAX_VIO_STREAMS                 4
7406 
7407 #define NVAPI_MIN_VIO_STREAMS                 1
7408 
7409 //! SDI input supports a max of 2 links per stream
7410 #define NVAPI_MAX_VIO_LINKS_PER_STREAM        2
7411 
7412 
7413 #define NVAPI_MAX_FRAMELOCK_MAPPING_MODES     20
7414 
7415 //! Min number of capture images
7416 #define NVAPI_GVI_MIN_RAW_CAPTURE_IMAGES      1
7417 
7418 //! Max number of capture images
7419 #define NVAPI_GVI_MAX_RAW_CAPTURE_IMAGES      32
7420 
7421 //! Default number of capture images
7422 #define NVAPI_GVI_DEFAULT_RAW_CAPTURE_IMAGES  5
7423 
7424 
7425 
7426 // Data Signal notification events. These need a event handler in RM.
7427 // Register/Unregister and PopEvent NVAPI's are already available.
7428 
7429 //! Device configuration
7430 typedef enum _NVVIOCONFIGTYPE
7431 {
7432     NVVIOCONFIGTYPE_IN                                 ,       //!< Input Status
7433     NVVIOCONFIGTYPE_OUT                                ,       //!< Output Status
7434 }NVVIOCONFIGTYPE;
7435 
7436 typedef enum _NVVIOCOLORSPACE
7437 {
7438     NVVIOCOLORSPACE_UNKNOWN,
7439     NVVIOCOLORSPACE_YCBCR,
7440     NVVIOCOLORSPACE_YCBCRA,
7441     NVVIOCOLORSPACE_YCBCRD,
7442     NVVIOCOLORSPACE_GBR,
7443     NVVIOCOLORSPACE_GBRA,
7444     NVVIOCOLORSPACE_GBRD,
7445 } NVVIOCOLORSPACE;
7446 
7447 //! Component sampling
7448 typedef enum _NVVIOCOMPONENTSAMPLING
7449 {
7450     NVVIOCOMPONENTSAMPLING_UNKNOWN,
7451     NVVIOCOMPONENTSAMPLING_4444,
7452     NVVIOCOMPONENTSAMPLING_4224,
7453     NVVIOCOMPONENTSAMPLING_444,
7454     NVVIOCOMPONENTSAMPLING_422
7455 } NVVIOCOMPONENTSAMPLING;
7456 
7457 typedef enum _NVVIOBITSPERCOMPONENT
7458 {
7459     NVVIOBITSPERCOMPONENT_UNKNOWN,
7460     NVVIOBITSPERCOMPONENT_8,
7461     NVVIOBITSPERCOMPONENT_10,
7462     NVVIOBITSPERCOMPONENT_12,
7463 } NVVIOBITSPERCOMPONENT;
7464 
7465 typedef enum _NVVIOLINKID
7466 {
7467     NVVIOLINKID_UNKNOWN,
7468     NVVIOLINKID_A,
7469     NVVIOLINKID_B,
7470     NVVIOLINKID_C,
7471     NVVIOLINKID_D
7472 } NVVIOLINKID;
7473 
7474 
7475 typedef enum _NVVIOANCPARITYCOMPUTATION
7476 {
7477     NVVIOANCPARITYCOMPUTATION_AUTO,
7478     NVVIOANCPARITYCOMPUTATION_ON,
7479     NVVIOANCPARITYCOMPUTATION_OFF
7480 } NVVIOANCPARITYCOMPUTATION;
7481 
7482 
7483 
7484 //! @}
7485 
7486 
7487 //---------------------------------------------------------------------
7488 // Structures
7489 //---------------------------------------------------------------------
7490 
7491 //! \addtogroup vidio
7492 //! @{
7493 
7494 
7495 //! Supports Serial Digital Interface (SDI) output
7496 #define NVVIOCAPS_VIDOUT_SDI                0x00000001
7497 
7498 //! Supports Internal timing source
7499 #define NVVIOCAPS_SYNC_INTERNAL             0x00000100
7500 
7501 //! Supports Genlock timing source
7502 #define NVVIOCAPS_SYNC_GENLOCK              0x00000200
7503 
7504 //! Supports Serial Digital Interface (SDI) synchronization input
7505 #define NVVIOCAPS_SYNCSRC_SDI               0x00001000
7506 
7507 //! Supports Composite synchronization input
7508 #define NVVIOCAPS_SYNCSRC_COMP              0x00002000
7509 
7510 //! Supports Desktop transparent mode
7511 #define NVVIOCAPS_OUTPUTMODE_DESKTOP        0x00010000
7512 
7513 //! Supports OpenGL application mode
7514 #define NVVIOCAPS_OUTPUTMODE_OPENGL         0x00020000
7515 
7516 //! Supports Serial Digital Interface (SDI) input
7517 #define NVVIOCAPS_VIDIN_SDI                 0x00100000
7518 
7519 //! Supports Packed ANC
7520 #define NVVIOCAPS_PACKED_ANC_SUPPORTED      0x00200000
7521 
7522 //! Supports ANC audio blanking
7523 #define NVVIOCAPS_AUDIO_BLANKING_SUPPORTED  0x00400000
7524 
7525 //! SDI-class interface: SDI output with two genlock inputs
7526 #define NVVIOCLASS_SDI                      0x00000001
7527 
7528 //! Device capabilities
7529 typedef struct _NVVIOCAPS
7530 {
7531     NvU32             version;                              //!< Structure version
7532     NvAPI_String      adapterName;                          //!< Graphics adapter name
7533     NvU32             adapterClass;                         //!< Graphics adapter classes (NVVIOCLASS_SDI mask)
7534     NvU32             adapterCaps;                          //!< Graphics adapter capabilities (NVVIOCAPS_* mask)
7535     NvU32             dipSwitch;                            //!< On-board DIP switch settings bits
7536     NvU32             dipSwitchReserved;                    //!< On-board DIP switch settings reserved bits
7537     NvU32             boardID;                              //!< Board ID
7538     //! Driver version
7539     struct                                                  //
7540     {
7541         NvU32          majorVersion;                        //!< Major version. For GVI, majorVersion contains MajorVersion(HIWORD) And MinorVersion(LOWORD)
7542         NvU32          minorVersion;                        //!< Minor version. For GVI, minorVersion contains Revison(HIWORD) And Build(LOWORD)
7543     } driver;                                               //
7544     //! Firmware version
7545     struct
7546     {
7547         NvU32          majorVersion;                        //!< Major version. In version 2, for both GVI and GVO, majorVersion contains MajorVersion(HIWORD) And MinorVersion(LOWORD)
7548         NvU32          minorVersion;                        //!< Minor version. In version 2, for both GVI and GVO, minorVersion contains Revison(HIWORD) And Build(LOWORD)
7549     } firmWare;                                             //
7550     NVVIOOWNERID      ownerId;                              //!< Unique identifier for owner of video output (NVVIOOWNERID_INVALID if free running)
7551     NVVIOOWNERTYPE    ownerType;                            //!< Owner type (OpenGL application or Desktop mode)
7552 } NVVIOCAPS;
7553 
7554 //! Macro for constructing the version field of NVVIOCAPS
7555 #define NVVIOCAPS_VER1  MAKE_NVAPI_VERSION(NVVIOCAPS,1)
7556 #define NVVIOCAPS_VER2  MAKE_NVAPI_VERSION(NVVIOCAPS,2)
7557 #define NVVIOCAPS_VER   NVVIOCAPS_VER2
7558 
7559 //! Input channel status
7560 typedef struct _NVVIOCHANNELSTATUS
7561 {
7562     NvU32                  smpte352;                         //!< 4-byte SMPTE 352 video payload identifier
7563     NVVIOSIGNALFORMAT      signalFormat;                     //!< Signal format
7564     NVVIOBITSPERCOMPONENT  bitsPerComponent;                 //!< Bits per component
7565     NVVIOCOMPONENTSAMPLING samplingFormat;                   //!< Sampling format
7566     NVVIOCOLORSPACE        colorSpace;                       //!< Color space
7567     NVVIOLINKID            linkID;                           //!< Link ID
7568 } NVVIOCHANNELSTATUS;
7569 
7570 //! Input device status
7571 typedef struct _NVVIOINPUTSTATUS
7572 {
7573     NVVIOCHANNELSTATUS     vidIn[NVAPI_MAX_VIO_JACKS][NVAPI_MAX_VIO_CHANNELS_PER_JACK];     //!< Video input status per channel within a jack
7574     NVVIOCAPTURESTATUS     captureStatus;                  //!< status of video capture
7575 } NVVIOINPUTSTATUS;
7576 
7577 //! Output device status
7578 typedef struct _NVVIOOUTPUTSTATUS
7579 {
7580     NVVIOINPUTOUTPUTSTATUS    vid1Out;                        //!< Video 1 output status
7581     NVVIOINPUTOUTPUTSTATUS    vid2Out;                        //!< Video 2 output status
7582     NVVIOSYNCSTATUS        sdiSyncIn;                      //!< SDI sync input status
7583     NVVIOSYNCSTATUS        compSyncIn;                     //!< Composite sync input status
7584     NvU32            syncEnable;                     //!< Sync enable (TRUE if using syncSource)
7585     NVVIOSYNCSOURCE        syncSource;                     //!< Sync source
7586     NVVIOSIGNALFORMAT        syncFormat;                     //!< Sync format
7587     NvU32            frameLockEnable;                //!< Framelock enable flag
7588     NvU32            outputVideoLocked;              //!< Output locked status
7589     NvU32            dataIntegrityCheckErrorCount;   //!< Data integrity check error count
7590     NvU32            dataIntegrityCheckEnabled;      //!< Data integrity check status enabled
7591     NvU32            dataIntegrityCheckFailed;       //!< Data integrity check status failed
7592     NvU32                       uSyncSourceLocked;              //!< genlocked to framelocked to ref signal
7593     NvU32                       uPowerOn;                       //!< TRUE: indicates there is sufficient power
7594 } NVVIOOUTPUTSTATUS;
7595 
7596 //! Video device status.
7597 typedef struct _NVVIOSTATUS
7598 {
7599     NvU32                 version;                        //!< Structure version
7600     NVVIOSTATUSTYPE       nvvioStatusType;                //!< Input or Output status
7601     union
7602     {
7603         NVVIOINPUTSTATUS  inStatus;                       //!<  Input device status
7604         NVVIOOUTPUTSTATUS outStatus;                      //!<  Output device status
7605     }vioStatus;
7606 } NVVIOSTATUS;
7607 
7608 //! Macro for constructingthe version field of NVVIOSTATUS
7609 #define NVVIOSTATUS_VER   MAKE_NVAPI_VERSION(NVVIOSTATUS,1)
7610 
7611 //! Output region
7612 typedef struct _NVVIOOUTPUTREGION
7613 {
7614     NvU32              x;                                    //!< Horizontal origin in pixels
7615     NvU32              y;                                    //!< Vertical origin in pixels
7616     NvU32              width;                                //!< Width of region in pixels
7617     NvU32              height;                               //!< Height of region in pixels
7618 } NVVIOOUTPUTREGION;
7619 
7620 //! Gamma ramp (8-bit index)
7621 typedef struct _NVVIOGAMMARAMP8
7622 {
7623     NvU16              uRed[256];                            //!< Red channel gamma ramp (8-bit index, 16-bit values)
7624     NvU16              uGreen[256];                          //!< Green channel gamma ramp (8-bit index, 16-bit values)
7625     NvU16              uBlue[256];                           //!< Blue channel gamma ramp (8-bit index, 16-bit values)
7626 } NVVIOGAMMARAMP8;
7627 
7628 //! Gamma ramp (10-bit index)
7629 typedef struct _NVVIOGAMMARAMP10
7630 {
7631     NvU16              uRed[1024];                           //!< Red channel gamma ramp (10-bit index, 16-bit values)
7632     NvU16              uGreen[1024];                         //!< Green channel gamma ramp (10-bit index, 16-bit values)
7633     NvU16              uBlue[1024];                          //!< Blue channel gamma ramp (10-bit index, 16-bit values)
7634 } NVVIOGAMMARAMP10;
7635 
7636 
7637 //! Sync delay
7638 typedef struct _NVVIOSYNCDELAY
7639 {
7640     NvU32              version;                              //!< Structure version
7641     NvU32              horizontalDelay;                      //!< Horizontal delay in pixels
7642     NvU32              verticalDelay;                        //!< Vertical delay in lines
7643 } NVVIOSYNCDELAY;
7644 
7645 //! Macro for constructing the version field of NVVIOSYNCDELAY
7646 #define NVVIOSYNCDELAY_VER   MAKE_NVAPI_VERSION(NVVIOSYNCDELAY,1)
7647 
7648 
7649 //! Video mode information
7650 typedef struct _NVVIOVIDEOMODE
7651 {
7652     NvU32                horizontalPixels;                   //!< Horizontal resolution (in pixels)
7653     NvU32                verticalLines;                      //!< Vertical resolution for frame (in lines)
7654     float                fFrameRate;                         //!< Frame rate
7655     NVVIOINTERLACEMODE   interlaceMode;                      //!< Interlace mode
7656     NVVIOVIDEOSTANDARD   videoStandard;                      //!< SMPTE standards format
7657     NVVIOVIDEOTYPE       videoType;                          //!< HD or SD signal classification
7658 } NVVIOVIDEOMODE;
7659 
7660 //! Signal format details
7661 typedef struct _NVVIOSIGNALFORMATDETAIL
7662 {
7663     NVVIOSIGNALFORMAT    signalFormat;                       //!< Signal format enumerated value
7664     NVVIOVIDEOMODE       videoMode;                          //!< Video mode for signal format
7665 }NVVIOSIGNALFORMATDETAIL;
7666 
7667 
7668 //! R8:G8:B8
7669 #define NVVIOBUFFERFORMAT_R8G8B8                  0x00000001
7670 
7671 //! R8:G8:B8:Z24
7672 #define NVVIOBUFFERFORMAT_R8G8B8Z24               0x00000002
7673 
7674 //! R8:G8:B8:A8
7675 #define NVVIOBUFFERFORMAT_R8G8B8A8                0x00000004
7676 
7677 //! R8:G8:B8:A8:Z24
7678 #define NVVIOBUFFERFORMAT_R8G8B8A8Z24             0x00000008
7679 
7680 //! R16FP:G16FP:B16FP
7681 #define NVVIOBUFFERFORMAT_R16FPG16FPB16FP         0x00000010
7682 
7683 //! R16FP:G16FP:B16FP:Z24
7684 #define NVVIOBUFFERFORMAT_R16FPG16FPB16FPZ24      0x00000020
7685 
7686 //! R16FP:G16FP:B16FP:A16FP
7687 #define NVVIOBUFFERFORMAT_R16FPG16FPB16FPA16FP    0x00000040
7688 
7689 //! R16FP:G16FP:B16FP:A16FP:Z24
7690 #define NVVIOBUFFERFORMAT_R16FPG16FPB16FPA16FPZ24 0x00000080
7691 
7692 
7693 
7694 //! Data format details
7695 typedef struct _NVVIODATAFORMATDETAIL
7696 {
7697     NVVIODATAFORMAT   dataFormat;                              //!< Data format enumerated value
7698     NvU32             vioCaps;                                 //!< Data format capabilities (NVVIOCAPS_* mask)
7699 }NVVIODATAFORMATDETAIL;
7700 
7701 //! Colorspace conversion
7702 typedef struct _NVVIOCOLORCONVERSION
7703 {
7704     NvU32       version;                                    //!<  Structure version
7705     float       colorMatrix[3][3];                          //!<  Output[n] =
7706     float       colorOffset[3];                             //!<  Input[0] * colorMatrix[n][0] +
7707     float       colorScale[3];                              //!<  Input[1] * colorMatrix[n][1] +
7708                                                             //!<  Input[2] * colorMatrix[n][2] +
7709                                                             //!<  OutputRange * colorOffset[n]
7710                                                             //!<  where OutputRange is the standard magnitude of
7711                                                             //!<  Output[n][n] and colorMatrix and colorOffset
7712                                                             //!<  values are within the range -1.0 to +1.0
7713     NvU32      compositeSafe;                               //!<  compositeSafe constrains luminance range when using composite output
7714 } NVVIOCOLORCONVERSION;
7715 
7716 //! macro for constructing the version field of _NVVIOCOLORCONVERSION.
7717 #define NVVIOCOLORCONVERSION_VER   MAKE_NVAPI_VERSION(NVVIOCOLORCONVERSION,1)
7718 
7719 //! Gamma correction
7720 typedef struct _NVVIOGAMMACORRECTION
7721 {
7722     NvU32            version;                               //!< Structure version
7723     NvU32            vioGammaCorrectionType;                //!< Gamma correction type (8-bit or 10-bit)
7724     //! Gamma correction:
7725     union
7726     {
7727         NVVIOGAMMARAMP8  gammaRamp8;                        //!< Gamma ramp (8-bit index, 16-bit values)
7728         NVVIOGAMMARAMP10 gammaRamp10;                       //!< Gamma ramp (10-bit index, 16-bit values)
7729     }gammaRamp;
7730     float            fGammaValueR;            //!< Red Gamma value within gamma ranges. 0.5 - 6.0
7731     float            fGammaValueG;            //!< Green Gamma value within gamma ranges. 0.5 - 6.0
7732     float            fGammaValueB;            //!< Blue Gamma value within gamma ranges. 0.5 - 6.0
7733 } NVVIOGAMMACORRECTION;
7734 
7735 //! Macro for constructing thevesion field of _NVVIOGAMMACORRECTION
7736 #define NVVIOGAMMACORRECTION_VER   MAKE_NVAPI_VERSION(NVVIOGAMMACORRECTION,1)
7737 
7738 //! Maximum number of ranges per channel
7739 #define MAX_NUM_COMPOSITE_RANGE      2
7740 
7741 
7742 typedef struct _NVVIOCOMPOSITERANGE
7743 {
7744     NvU32   uRange;
7745     NvU32   uEnabled;
7746     NvU32   uMin;
7747     NvU32   uMax;
7748 } NVVIOCOMPOSITERANGE;
7749 
7750 
7751 
7752 // Device configuration (fields masks indicating NVVIOCONFIG fields to use for NvAPI_VIO_GetConfig/NvAPI_VIO_SetConfig() )
7753 //
7754 #define NVVIOCONFIG_SIGNALFORMAT            0x00000001      //!< fields: signalFormat
7755 #define NVVIOCONFIG_DATAFORMAT              0x00000002      //!< fields: dataFormat
7756 #define NVVIOCONFIG_OUTPUTREGION            0x00000004      //!< fields: outputRegion
7757 #define NVVIOCONFIG_OUTPUTAREA              0x00000008      //!< fields: outputArea
7758 #define NVVIOCONFIG_COLORCONVERSION         0x00000010      //!< fields: colorConversion
7759 #define NVVIOCONFIG_GAMMACORRECTION         0x00000020      //!< fields: gammaCorrection
7760 #define NVVIOCONFIG_SYNCSOURCEENABLE        0x00000040      //!< fields: syncSource and syncEnable
7761 #define NVVIOCONFIG_SYNCDELAY               0x00000080      //!< fields: syncDelay
7762 #define NVVIOCONFIG_COMPOSITESYNCTYPE       0x00000100      //!< fields: compositeSyncType
7763 #define NVVIOCONFIG_FRAMELOCKENABLE         0x00000200      //!< fields: EnableFramelock
7764 #define NVVIOCONFIG_422FILTER               0x00000400      //!< fields: bEnable422Filter
7765 #define NVVIOCONFIG_COMPOSITETERMINATE      0x00000800      //!< fields: bCompositeTerminate (Not supported on Quadro FX 4000 SDI)
7766 #define NVVIOCONFIG_DATAINTEGRITYCHECK      0x00001000      //!< fields: bEnableDataIntegrityCheck (Not supported on Quadro FX 4000 SDI)
7767 #define NVVIOCONFIG_CSCOVERRIDE             0x00002000      //!< fields: colorConversion override
7768 #define NVVIOCONFIG_FLIPQUEUELENGTH         0x00004000      //!< fields: flipqueuelength control
7769 #define NVVIOCONFIG_ANCTIMECODEGENERATION   0x00008000      //!< fields: bEnableANCTimeCodeGeneration
7770 #define NVVIOCONFIG_COMPOSITE               0x00010000      //!< fields: bEnableComposite
7771 #define NVVIOCONFIG_ALPHAKEYCOMPOSITE       0x00020000      //!< fields: bEnableAlphaKeyComposite
7772 #define NVVIOCONFIG_COMPOSITE_Y             0x00040000      //!< fields: compRange
7773 #define NVVIOCONFIG_COMPOSITE_CR            0x00080000      //!< fields: compRange
7774 #define NVVIOCONFIG_COMPOSITE_CB            0x00100000      //!< fields: compRange
7775 #define NVVIOCONFIG_FULL_COLOR_RANGE        0x00200000      //!< fields: bEnableFullColorRange
7776 #define NVVIOCONFIG_RGB_DATA                0x00400000      //!< fields: bEnableRGBData
7777 #define NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE         0x00800000      //!< fields: bEnableSDIOutput
7778 #define NVVIOCONFIG_STREAMS                 0x01000000      //!< fields: streams
7779 #define NVVIOCONFIG_ANC_PARITY_COMPUTATION  0x02000000      //!< fields: ancParityComputation
7780 #define NVVIOCONFIG_ANC_AUDIO_REPEAT		0x04000000      //!< fields: enableAudioBlanking
7781 
7782 
7783 // Don't forget to update NVVIOCONFIG_VALIDFIELDS in nvapi.spec when NVVIOCONFIG_ALLFIELDS changes.
7784 #define NVVIOCONFIG_ALLFIELDS   ( NVVIOCONFIG_SIGNALFORMAT          | \
7785                                   NVVIOCONFIG_DATAFORMAT            | \
7786                                   NVVIOCONFIG_OUTPUTREGION          | \
7787                                   NVVIOCONFIG_OUTPUTAREA            | \
7788                                   NVVIOCONFIG_COLORCONVERSION       | \
7789                                   NVVIOCONFIG_GAMMACORRECTION       | \
7790                                   NVVIOCONFIG_SYNCSOURCEENABLE      | \
7791                                   NVVIOCONFIG_SYNCDELAY             | \
7792                                   NVVIOCONFIG_COMPOSITESYNCTYPE     | \
7793                                   NVVIOCONFIG_FRAMELOCKENABLE       | \
7794                                   NVVIOCONFIG_422FILTER             | \
7795                                   NVVIOCONFIG_COMPOSITETERMINATE    | \
7796                                   NVVIOCONFIG_DATAINTEGRITYCHECK    | \
7797                                   NVVIOCONFIG_CSCOVERRIDE           | \
7798                                   NVVIOCONFIG_FLIPQUEUELENGTH       | \
7799                                   NVVIOCONFIG_ANCTIMECODEGENERATION | \
7800                                   NVVIOCONFIG_COMPOSITE             | \
7801                                   NVVIOCONFIG_ALPHAKEYCOMPOSITE     | \
7802                                   NVVIOCONFIG_COMPOSITE_Y           | \
7803                                   NVVIOCONFIG_COMPOSITE_CR          | \
7804                                   NVVIOCONFIG_COMPOSITE_CB          | \
7805                                   NVVIOCONFIG_FULL_COLOR_RANGE      | \
7806                                   NVVIOCONFIG_RGB_DATA              | \
7807                                   NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \
7808                                   NVVIOCONFIG_STREAMS               | \
7809                                   NVVIOCONFIG_ANC_PARITY_COMPUTATION | \
7810 								  NVVIOCONFIG_ANC_AUDIO_REPEAT )
7811 
7812 #define NVVIOCONFIG_VALIDFIELDS  ( NVVIOCONFIG_SIGNALFORMAT          | \
7813                                    NVVIOCONFIG_DATAFORMAT            | \
7814                                    NVVIOCONFIG_OUTPUTREGION          | \
7815                                    NVVIOCONFIG_OUTPUTAREA            | \
7816                                    NVVIOCONFIG_COLORCONVERSION       | \
7817                                    NVVIOCONFIG_GAMMACORRECTION       | \
7818                                    NVVIOCONFIG_SYNCSOURCEENABLE      | \
7819                                    NVVIOCONFIG_SYNCDELAY             | \
7820                                    NVVIOCONFIG_COMPOSITESYNCTYPE     | \
7821                                    NVVIOCONFIG_FRAMELOCKENABLE       | \
7822                                    NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \
7823                                    NVVIOCONFIG_422FILTER             | \
7824                                    NVVIOCONFIG_COMPOSITETERMINATE    | \
7825                                    NVVIOCONFIG_DATAINTEGRITYCHECK    | \
7826                                    NVVIOCONFIG_CSCOVERRIDE           | \
7827                                    NVVIOCONFIG_FLIPQUEUELENGTH       | \
7828                                    NVVIOCONFIG_ANCTIMECODEGENERATION | \
7829                                    NVVIOCONFIG_COMPOSITE             | \
7830                                    NVVIOCONFIG_ALPHAKEYCOMPOSITE     | \
7831                                    NVVIOCONFIG_COMPOSITE_Y           | \
7832                                    NVVIOCONFIG_COMPOSITE_CR          | \
7833                                    NVVIOCONFIG_COMPOSITE_CB          | \
7834                                    NVVIOCONFIG_FULL_COLOR_RANGE      | \
7835                                    NVVIOCONFIG_RGB_DATA              | \
7836                                    NVVIOCONFIG_RESERVED_SDIOUTPUTENABLE | \
7837                                    NVVIOCONFIG_STREAMS               | \
7838                                    NVVIOCONFIG_ANC_PARITY_COMPUTATION | \
7839 								   NVVIOCONFIG_ANC_AUDIO_REPEAT)
7840 
7841 #define NVVIOCONFIG_DRIVERFIELDS ( NVVIOCONFIG_OUTPUTREGION          | \
7842                                    NVVIOCONFIG_OUTPUTAREA            | \
7843                                    NVVIOCONFIG_COLORCONVERSION       | \
7844                                    NVVIOCONFIG_FLIPQUEUELENGTH)
7845 
7846 #define NVVIOCONFIG_GAMMAFIELDS  ( NVVIOCONFIG_GAMMACORRECTION       )
7847 
7848 #define NVVIOCONFIG_RMCTRLFIELDS ( NVVIOCONFIG_SIGNALFORMAT          | \
7849                                    NVVIOCONFIG_DATAFORMAT            | \
7850                                    NVVIOCONFIG_SYNCSOURCEENABLE      | \
7851                                    NVVIOCONFIG_COMPOSITESYNCTYPE     | \
7852                                    NVVIOCONFIG_FRAMELOCKENABLE       | \
7853                                    NVVIOCONFIG_422FILTER             | \
7854                                    NVVIOCONFIG_COMPOSITETERMINATE    | \
7855                                    NVVIOCONFIG_DATAINTEGRITYCHECK    | \
7856                                    NVVIOCONFIG_COMPOSITE             | \
7857                                    NVVIOCONFIG_ALPHAKEYCOMPOSITE     | \
7858                                    NVVIOCONFIG_COMPOSITE_Y           | \
7859                                    NVVIOCONFIG_COMPOSITE_CR          | \
7860                                    NVVIOCONFIG_COMPOSITE_CB)
7861 
7862 #define NVVIOCONFIG_RMSKEWFIELDS ( NVVIOCONFIG_SYNCDELAY             )
7863 
7864 #define NVVIOCONFIG_ALLOWSDIRUNNING_FIELDS ( NVVIOCONFIG_DATAINTEGRITYCHECK     | \
7865                                              NVVIOCONFIG_SYNCDELAY              | \
7866                                              NVVIOCONFIG_CSCOVERRIDE            | \
7867                                              NVVIOCONFIG_ANCTIMECODEGENERATION  | \
7868                                              NVVIOCONFIG_COMPOSITE              | \
7869                                              NVVIOCONFIG_ALPHAKEYCOMPOSITE      | \
7870                                              NVVIOCONFIG_COMPOSITE_Y            | \
7871                                              NVVIOCONFIG_COMPOSITE_CR           | \
7872                                              NVVIOCONFIG_COMPOSITE_CB           | \
7873                                              NVVIOCONFIG_ANC_PARITY_COMPUTATION)
7874 
7875 
7876  #define NVVIOCONFIG_RMMODESET_FIELDS ( NVVIOCONFIG_SIGNALFORMAT         | \
7877                                         NVVIOCONFIG_DATAFORMAT           | \
7878                                         NVVIOCONFIG_SYNCSOURCEENABLE     | \
7879                                         NVVIOCONFIG_FRAMELOCKENABLE      | \
7880                                         NVVIOCONFIG_COMPOSITESYNCTYPE	 | \
7881 										NVVIOCONFIG_ANC_AUDIO_REPEAT)
7882 
7883 
7884 //! Output device configuration
7885 // No members can be deleted from below structure. Only add new members at the
7886 // end of the structure.
7887 typedef struct _NVVIOOUTPUTCONFIG_V1
7888 {
7889     NVVIOSIGNALFORMAT    signalFormat;                         //!< Signal format for video output
7890     NVVIODATAFORMAT      dataFormat;                           //!< Data format for video output
7891     NVVIOOUTPUTREGION    outputRegion;                         //!< Region for video output (Desktop mode)
7892     NVVIOOUTPUTAREA      outputArea;                           //!< Usable resolution for video output (safe area)
7893     NVVIOCOLORCONVERSION colorConversion;                      //!< Color conversion.
7894     NVVIOGAMMACORRECTION gammaCorrection;
7895     NvU32                syncEnable;                           //!< Sync enable (TRUE to use syncSource)
7896     NVVIOSYNCSOURCE      syncSource;                           //!< Sync source
7897     NVVIOSYNCDELAY       syncDelay;                            //!< Sync delay
7898     NVVIOCOMPSYNCTYPE    compositeSyncType;                    //!< Composite sync type
7899     NvU32                frameLockEnable;                      //!< Flag indicating whether framelock was on/off
7900     NvU32                psfSignalFormat;                      //!< Indicates whether contained format is PSF Signal format
7901     NvU32                enable422Filter;                      //!< Enables/Disables 4:2:2 filter
7902     NvU32                compositeTerminate;                   //!< Composite termination
7903     NvU32                enableDataIntegrityCheck;             //!< Enable data integrity check: true - enable, false - disable
7904     NvU32                cscOverride;                          //!< Use provided CSC color matrix to overwrite
7905     NvU32                flipQueueLength;                      //!< Number of buffers used for the internal flipqueue
7906     NvU32                enableANCTimeCodeGeneration;          //!< Enable SDI ANC time code generation
7907     NvU32                enableComposite;                      //!< Enable composite
7908     NvU32                enableAlphaKeyComposite;              //!< Enable Alpha key composite
7909     NVVIOCOMPOSITERANGE  compRange;                            //!< Composite ranges
7910     NvU8                 reservedData[256];                    //!< Inicates last stored SDI output state TRUE-ON / FALSE-OFF
7911     NvU32                enableFullColorRange;                 //!< Flag indicating Full Color Range
7912     NvU32                enableRGBData;                        //!< Indicates data is in RGB format
7913 } NVVIOOUTPUTCONFIG_V1;
7914 
7915 typedef struct _NVVIOOUTPUTCONFIG_V2
7916 {
7917     NVVIOSIGNALFORMAT    signalFormat;                         //!< Signal format for video output
7918     NVVIODATAFORMAT      dataFormat;                           //!< Data format for video output
7919     NVVIOOUTPUTREGION    outputRegion;                         //!< Region for video output (Desktop mode)
7920     NVVIOOUTPUTAREA      outputArea;                           //!< Usable resolution for video output (safe area)
7921     NVVIOCOLORCONVERSION colorConversion;                      //!< Color conversion.
7922     NVVIOGAMMACORRECTION gammaCorrection;
7923     NvU32                syncEnable;                           //!< Sync enable (TRUE to use syncSource)
7924     NVVIOSYNCSOURCE      syncSource;                           //!< Sync source
7925     NVVIOSYNCDELAY       syncDelay;                            //!< Sync delay
7926     NVVIOCOMPSYNCTYPE    compositeSyncType;                    //!< Composite sync type
7927     NvU32                frameLockEnable;                      //!< Flag indicating whether framelock was on/off
7928     NvU32                psfSignalFormat;                      //!< Indicates whether contained format is PSF Signal format
7929     NvU32                enable422Filter;                      //!< Enables/Disables 4:2:2 filter
7930     NvU32                compositeTerminate;                   //!< Composite termination
7931     NvU32                enableDataIntegrityCheck;             //!< Enable data integrity check: true - enable, false - disable
7932     NvU32                cscOverride;                          //!< Use provided CSC color matrix to overwrite
7933     NvU32                flipQueueLength;                      //!< Number of buffers used for the internal flip queue
7934     NvU32                enableANCTimeCodeGeneration;          //!< Enable SDI ANC time code generation
7935     NvU32                enableComposite;                      //!< Enable composite
7936     NvU32                enableAlphaKeyComposite;              //!< Enable Alpha key composite
7937     NVVIOCOMPOSITERANGE  compRange;                            //!< Composite ranges
7938     NvU8                 reservedData[256];                    //!< Indicates last stored SDI output state TRUE-ON / FALSE-OFF
7939     NvU32                enableFullColorRange;                 //!< Flag indicating Full Color Range
7940     NvU32                enableRGBData;                        //!< Indicates data is in RGB format
7941     NVVIOANCPARITYCOMPUTATION ancParityComputation;            //!< Enable HW ANC parity bit computation (auto/on/off)
7942 } NVVIOOUTPUTCONFIG_V2;
7943 
7944 typedef struct _NVVIOOUTPUTCONFIG_V3
7945 {
7946     NVVIOSIGNALFORMAT    signalFormat;                         //!< Signal format for video output
7947     NVVIODATAFORMAT      dataFormat;                           //!< Data format for video output
7948     NVVIOOUTPUTREGION    outputRegion;                         //!< Region for video output (Desktop mode)
7949     NVVIOOUTPUTAREA      outputArea;                           //!< Usable resolution for video output (safe area)
7950     NVVIOCOLORCONVERSION colorConversion;                      //!< Color conversion.
7951     NVVIOGAMMACORRECTION gammaCorrection;
7952     NvU32                syncEnable;                           //!< Sync enable (TRUE to use syncSource)
7953     NVVIOSYNCSOURCE      syncSource;                           //!< Sync source
7954     NVVIOSYNCDELAY       syncDelay;                            //!< Sync delay
7955     NVVIOCOMPSYNCTYPE    compositeSyncType;                    //!< Composite sync type
7956     NvU32                frameLockEnable;                      //!< Flag indicating whether framelock was on/off
7957     NvU32                psfSignalFormat;                      //!< Indicates whether contained format is PSF Signal format
7958     NvU32                enable422Filter;                      //!< Enables/Disables 4:2:2 filter
7959     NvU32                compositeTerminate;                   //!< Composite termination
7960     NvU32                enableDataIntegrityCheck;             //!< Enable data integrity check: true - enable, false - disable
7961     NvU32                cscOverride;                          //!< Use provided CSC color matrix to overwrite
7962     NvU32                flipQueueLength;                      //!< Number of buffers used for the internal flip queue
7963     NvU32                enableANCTimeCodeGeneration;          //!< Enable SDI ANC time code generation
7964     NvU32                enableComposite;                      //!< Enable composite
7965     NvU32                enableAlphaKeyComposite;              //!< Enable Alpha key composite
7966     NVVIOCOMPOSITERANGE  compRange;                            //!< Composite ranges
7967     NvU8                 reservedData[256];                    //!< Indicates last stored SDI output state TRUE-ON / FALSE-OFF
7968     NvU32                enableFullColorRange;                 //!< Flag indicating Full Color Range
7969     NvU32                enableRGBData;                        //!< Indicates data is in RGB format
7970     NVVIOANCPARITYCOMPUTATION ancParityComputation;            //!< Enable HW ANC parity bit computation (auto/on/off)
7971 	NvU32				 enableAudioBlanking;				   //!< Enable HANC audio blanking on repeat frames
7972 } NVVIOOUTPUTCONFIG_V3;
7973 
7974 //! Stream configuration
7975 typedef struct _NVVIOSTREAM
7976 {
7977     NvU32                   bitsPerComponent;                     //!< Bits per component
7978     NVVIOCOMPONENTSAMPLING  sampling;                             //!< Sampling
7979     NvU32                   expansionEnable;                      //!< Enable/disable 4:2:2->4:4:4 expansion
7980     NvU32                   numLinks;                             //!< Number of active links
7981     struct
7982     {
7983         NvU32               jack;                                 //!< This stream's link[i] will use the specified (0-based) channel within the
7984         NvU32               channel;                              //!< specified (0-based) jack
7985     } links[NVAPI_MAX_VIO_LINKS_PER_STREAM];
7986 } NVVIOSTREAM;
7987 
7988 //! Input device configuration
7989 typedef struct _NVVIOINPUTCONFIG
7990 {
7991     NvU32                numRawCaptureImages;                  //!< numRawCaptureImages is the number of frames to keep in the capture queue.
7992                                                                //!< must be between NVAPI_GVI_MIN_RAW_CAPTURE_IMAGES and NVAPI_GVI_MAX_RAW_CAPTURE_IMAGES,
7993     NVVIOSIGNALFORMAT    signalFormat;                         //!< Signal format.
7994                                                                //!< Please note that both numRawCaptureImages and signalFormat should be set together.
7995     NvU32                numStreams;                           //!< Number of active streams.
7996     NVVIOSTREAM          streams[NVAPI_MAX_VIO_STREAMS];       //!< Stream configurations
7997     NvU32                bTestMode;                            //!< This attribute controls the GVI test mode.
7998                                                                //!< Possible values 0/1. When testmode enabled, the
7999                                                                //!< GVI device will generate fake data as quickly as possible.
8000 } NVVIOINPUTCONFIG;
8001 
8002 typedef struct _NVVIOCONFIG_V1
8003 {
8004     NvU32                version;                              //!< Structure version
8005     NvU32                fields;                               //!< Caller sets to NVVIOCONFIG_* mask for fields to use
8006     NVVIOCONFIGTYPE      nvvioConfigType;                      //!< Input or Output configuration
8007     union
8008     {
8009         NVVIOINPUTCONFIG  inConfig;                            //!<  Input device configuration
8010         NVVIOOUTPUTCONFIG_V1 outConfig;                           //!<  Output device configuration
8011     }vioConfig;
8012 } NVVIOCONFIG_V1;
8013 
8014 
8015 typedef struct _NVVIOCONFIG_V2
8016 {
8017     NvU32                version;                              //!< Structure version
8018     NvU32                fields;                               //!< Caller sets to NVVIOCONFIG_* mask for fields to use
8019     NVVIOCONFIGTYPE      nvvioConfigType;                      //!< Input or Output configuration
8020     union
8021     {
8022         NVVIOINPUTCONFIG     inConfig;                         //!< Input device configuration
8023         NVVIOOUTPUTCONFIG_V2 outConfig;                        //!< Output device configuration
8024     }vioConfig;
8025 } NVVIOCONFIG_V2;
8026 
8027 typedef struct _NVVIOCONFIG_V3
8028 {
8029     NvU32                version;                              //!< Structure version
8030     NvU32                fields;                               //!< Caller sets to NVVIOCONFIG_* mask for fields to use
8031     NVVIOCONFIGTYPE      nvvioConfigType;                      //!< Input or Output configuration
8032     union
8033     {
8034         NVVIOINPUTCONFIG     inConfig;                         //!< Input device configuration
8035         NVVIOOUTPUTCONFIG_V3 outConfig;                        //!< Output device configuration
8036     }vioConfig;
8037 } NVVIOCONFIG_V3;
8038 typedef NVVIOOUTPUTCONFIG_V3 NVVIOOUTPUTCONFIG;
8039 typedef NVVIOCONFIG_V3 NVVIOCONFIG;
8040 
8041 #define NVVIOCONFIG_VER1  MAKE_NVAPI_VERSION(NVVIOCONFIG_V1,1)
8042 #define NVVIOCONFIG_VER2  MAKE_NVAPI_VERSION(NVVIOCONFIG_V2,2)
8043 #define NVVIOCONFIG_VER3  MAKE_NVAPI_VERSION(NVVIOCONFIG_V3,3)
8044 #define NVVIOCONFIG_VER   NVVIOCONFIG_VER3
8045 
8046 
8047 typedef struct
8048 {
8049     NvPhysicalGpuHandle                    hPhysicalGpu;                    //!< Handle to Physical GPU (This could be NULL for GVI device if its not binded)
8050     NvVioHandle                         hVioHandle;                     //!<handle to SDI Input/Output device
8051     NvU32                               vioId;                          //!<device Id of SDI Input/Output device
8052     NvU32                               outputId;            //!<deviceMask of the SDI display connected to GVO device.
8053                                                                         //!<outputId will be 0 for GVI device.
8054 } NVVIOTOPOLOGYTARGET;
8055 
8056 typedef struct _NV_VIO_TOPOLOGY
8057 {
8058     NvU32                       version;
8059     NvU32                       vioTotalDeviceCount;                    //!<How many video I/O targets are valid
8060     NVVIOTOPOLOGYTARGET         vioTarget[NVAPI_MAX_VIO_DEVICES];       //!<Array of video I/O targets
8061 }NV_VIO_TOPOLOGY, NVVIOTOPOLOGY;
8062 
8063 
8064 //! Macro for constructing the version field of NV_VIO_TOPOLOGY
8065 #define NV_VIO_TOPOLOGY_VER  MAKE_NVAPI_VERSION(NV_VIO_TOPOLOGY,1)
8066 
8067 //! Macro for constructing the version field of NVVIOTOPOLOGY
8068 #define NVVIOTOPOLOGY_VER    MAKE_NVAPI_VERSION(NVVIOTOPOLOGY,1)
8069 
8070 
8071 
8072 //! @}
8073 
8074 
8075 
8076 //! \addtogroup vidio
8077 //! @{
8078 ///////////////////////////////////////////////////////////////////////////////
8079 //!
8080 //!   Function:    NvAPI_VIO_GetCapabilities
8081 //!
8082 //!   Description: This API determine the graphics adapter video I/O capabilities.
8083 //!
8084 //! SUPPORTED OS:  Windows XP and higher
8085 //!
8086 //!
8087 //! \since Release: 190
8088 //!
8089 //! \param [in]  NvVioHandle   The caller provides the SDI device handle as input.
8090 //! \param [out] pAdapterCaps  Pointer to receive capabilities
8091 //!
8092 //! \retval ::NVAPI_OK                           Success
8093 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8094 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8095 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  NVVIOCAPS struct version used by the app is not compatible
8096 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8097 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8098 ///////////////////////////////////////////////////////////////////////////////
8099 NVAPI_INTERFACE NvAPI_VIO_GetCapabilities(NvVioHandle     hVioHandle,
8100                                           NVVIOCAPS       *pAdapterCaps);
8101 
8102 
8103 ////////////////////////////////////////////////////////////////////////////////
8104 //!   Function:    NvAPI_VIO_Open
8105 //!
8106 //!   Description: This API opens the graphics adapter for video I/O operations
8107 //!                using the OpenGL application interface.  Read operations
8108 //!                are permitted in this mode by multiple clients, but Write
8109 //!                operations are application exclusive.
8110 //!
8111 //! SUPPORTED OS:  Windows XP and higher
8112 //!
8113 //!
8114 //! \since Release: 190
8115 //!
8116 //! \param [in]  NvVioHandle      The caller provides the SDI output device handle as input.
8117 //! \param [in]  vioClass         Class interface (NVVIOCLASS_* value)
8118 //! \param [in]  ownerType        Specify NVVIOOWNERTYPE_APPLICATION or NVVIOOWNERTYPE_DESKTOP.
8119 //!
8120 //! \retval ::NVAPI_OK                           Success
8121 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8122 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8123 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8124 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8125 //! \retval ::NVAPI_DEVICE_BUSY                  Access denied for requested access
8126 ///////////////////////////////////////////////////////////////////////////////
8127 NVAPI_INTERFACE NvAPI_VIO_Open(NvVioHandle       hVioHandle,
8128                                NvU32             vioClass,
8129                                NVVIOOWNERTYPE    ownerType);
8130 
8131 ///////////////////////////////////////////////////////////////////////////////
8132 //!   Function:    NvAPI_VIO_Close
8133 //!
8134 //!   Description: This API closes the graphics adapter for graphics-to-video operations
8135 //!                using the OpenGL application interface.  Closing an
8136 //!                OpenGL handle releases the device.
8137 //!
8138 //! SUPPORTED OS:  Windows XP and higher
8139 //!
8140 //!
8141 //! \since Release: 190
8142 //!
8143 //! \param [in]  NvVioHandle   The caller provides the SDI output device handle as input.
8144 //! \param [in]  bRelease      boolean value to either keep or release ownership
8145 //!
8146 //! \retval ::NVAPI_OK                           Success
8147 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8148 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8149 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8150 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8151 //! \retval ::NVAPI_DEVICE_BUSY                  Access denied for requested access
8152 ///////////////////////////////////////////////////////////////////////////////
8153 NVAPI_INTERFACE NvAPI_VIO_Close(NvVioHandle       hVioHandle,
8154                                 NvU32             bRelease);
8155 ///////////////////////////////////////////////////////////////////////////////
8156 //!   Function:    NvAPI_VIO_Status
8157 //!
8158 //!   Description: This API gets the Video I/O LED status.
8159 //!
8160 //! SUPPORTED OS:  Windows XP and higher
8161 //!
8162 //!
8163 //! \since Release: 190
8164 //!
8165 //! \param [in]  NvVioHandle   The caller provides the SDI device handle as input.
8166 //! \param [out] pStatus       Return pointer to NVVIOSTATUS
8167 //!
8168 //! \retval ::NVAPI_OK                           Success
8169 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8170 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8171 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Invalid structure version
8172 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8173 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8174 ///////////////////////////////////////////////////////////////////////////////
8175 NVAPI_INTERFACE NvAPI_VIO_Status(NvVioHandle     hVioHandle,
8176                                  NVVIOSTATUS     *pStatus);
8177 
8178 ////////////////////////////////////////////////////////////////////////////////
8179 //!   Function:    NvAPI_VIO_SyncFormatDetect
8180 //!
8181 //!   Description: This API detects the Video I/O incoming sync video format.
8182 //!
8183 //! SUPPORTED OS:  Windows XP and higher
8184 //!
8185 //!
8186 //! \since Release: 190
8187 //!
8188 //! \param [in]  NvVioHandle  The caller provides the SDI device handle as input.
8189 //! \param [out] pWait        Pointer to receive how many milliseconds will lapse
8190 //!                           before VIOStatus returns the detected syncFormat.
8191 //!
8192 //! \retval ::NVAPI_OK                          Success
8193 //! \retval ::NVAPI_API_NOT_INTIALIZED          NVAPI Not Initialized
8194 //! \retval ::NVAPI_INVALID_ARGUMENT            Arguments passed to API are not valid
8195 //! \retval ::NVAPI_NOT_SUPPORTED               Video I/O not supported
8196 //! \retval ::NVAPI_ERROR                       NVAPI Random errors
8197 ///////////////////////////////////////////////////////////////////////////////
8198 NVAPI_INTERFACE NvAPI_VIO_SyncFormatDetect(NvVioHandle hVioHandle,
8199                                            NvU32       *pWait);
8200 ///////////////////////////////////////////////////////////////////////////////
8201 //!   Function:    NvAPI_VIO_GetConfig
8202 //!
8203 //!   Description: This API gets the graphics-to-video configuration.
8204 //!
8205 //! SUPPORTED OS:  Windows XP and higher
8206 //!
8207 //!
8208 //! \since Release: 190
8209 //!
8210 //! \param [in]  NvVioHandle   The caller provides the SDI device handle as input.
8211 //! \param [out] pConfig       Pointer to the graphics-to-video configuration
8212 //!
8213 //! \retval ::NVAPI_OK                           Success
8214 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8215 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8216 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Invalid structure version
8217 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8218 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8219 ///////////////////////////////////////////////////////////////////////////////
8220 NVAPI_INTERFACE NvAPI_VIO_GetConfig(NvVioHandle        hVioHandle,
8221                                     NVVIOCONFIG        *pConfig);
8222 
8223 ///////////////////////////////////////////////////////////////////////////////
8224 //!   Function:    NvAPI_VIO_SetConfig
8225 //!
8226 //!   Description: This API sets the graphics-to-video configuration.
8227 //!
8228 //! SUPPORTED OS:  Windows XP and higher
8229 //!
8230 //!
8231 //! \since Release: 190
8232 //!
8233 //! \param [in]  NvVioHandle      The caller provides the SDI device handle as input.
8234 //! \param [in]  pConfig          Pointer to Graphics-to-Video configuration
8235 //!
8236 //! \retval ::NVAPI_OK                           Success
8237 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8238 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8239 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Stucture version invalid
8240 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8241 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8242 //! \retval ::NVAPI_DEVICE_BUSY                  Access denied for requested access
8243 ///////////////////////////////////////////////////////////////////////////////
8244 NVAPI_INTERFACE NvAPI_VIO_SetConfig(NvVioHandle            hVioHandle,
8245                                     const NVVIOCONFIG      *pConfig);
8246 
8247 ///////////////////////////////////////////////////////////////////////////////
8248 //!   Function:    NvAPI_VIO_SetCSC
8249 //!
8250 //!   Description: This API sets the colorspace conversion parameters.
8251 //!
8252 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.
8253 //! SUPPORTED OS:  Windows XP and higher
8254 //!
8255 //!
8256 //! \since Release: 190
8257 //!
8258 //! \param [in]  NvVioHandle      The caller provides the SDI device handle as input.
8259 //! \param [in]  pCSC             Pointer to CSC parameters
8260 //!
8261 //! \retval ::NVAPI_OK                           Success
8262 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8263 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8264 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Stucture version invalid
8265 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8266 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8267 //! \retval ::NVAPI_DEVICE_BUSY                  Access denied for requested access
8268 ////////////////////////////////////////////////////////////////////////////////----
8269 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.")
8270 NVAPI_INTERFACE NvAPI_VIO_SetCSC(NvVioHandle           hVioHandle,
8271                                  NVVIOCOLORCONVERSION  *pCSC);
8272 ////////////////////////////////////////////////////////////////////////////////
8273 //!   Function:    NvAPI_VIO_GetCSC
8274 //!
8275 //!   Description: This API gets the colorspace conversion parameters.
8276 //!
8277 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
8278 //! SUPPORTED OS:  Windows XP and higher
8279 //!
8280 //!
8281 //! \since Release: 190
8282 //!
8283 //! \param [in]  NvVioHandle      The caller provides the SDI device handle as input.
8284 //! \param [out] pCSC             Pointer to CSC parameters
8285 //!
8286 //! \retval ::NVAPI_OK                           Success
8287 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8288 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8289 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Stucture version invalid
8290 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8291 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8292 ////////////////////////////////////////////////////////////////////////////////
8293 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
8294 NVAPI_INTERFACE NvAPI_VIO_GetCSC(NvVioHandle           hVioHandle,
8295                                  NVVIOCOLORCONVERSION  *pCSC);
8296 ///////////////////////////////////////////////////////////////////////////////
8297 //!   Function:    NvAPI_VIO_SetGamma
8298 //!
8299 //!   Description: This API sets the gamma conversion parameters.
8300 //!
8301 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.
8302 //! SUPPORTED OS:  Windows XP and higher
8303 //!
8304 //!
8305 //! \since Release: 190
8306 //!
8307 //! \param [in]  NvVioHandle       The caller provides the SDI device handle as input.
8308 //! \param [in]  pGamma            Pointer to gamma parameters
8309 //!
8310 //! \retval ::NVAPI_OK                           Success
8311 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8312 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8313 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Stucture version invalid
8314 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8315 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8316 //! \retval ::NVAPI_DEVICE_BUSY                  Access denied for requested access
8317 ///////////////////////////////////////////////////////////////////////////////
8318 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.")
8319 NVAPI_INTERFACE NvAPI_VIO_SetGamma(NvVioHandle           hVioHandle,
8320                                    NVVIOGAMMACORRECTION  *pGamma);
8321 
8322 ///////////////////////////////////////////////////////////////////////////////
8323 //!   Function:    NvAPI_VIO_GetGamma
8324 //!
8325 //!   Description: This API gets the gamma conversion parameters.
8326 //!
8327 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
8328 //! SUPPORTED OS:  Windows XP and higher
8329 //!
8330 //!
8331 //! \since Release: 190
8332 //!
8333 //! \param [in]  NvVioHandle      The caller provides the SDI device handle as input.
8334 //! \param [out] pGamma           Pointer to gamma parameters
8335 //!
8336 //! \retval ::NVAPI_OK                           Success
8337 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8338 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8339 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Stucture version invalid
8340 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8341 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8342 ///////////////////////////////////////////////////////////////////////////////
8343 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
8344 NVAPI_INTERFACE NvAPI_VIO_GetGamma(NvVioHandle           hVioHandle,
8345                                    NVVIOGAMMACORRECTION* pGamma);
8346 ////////////////////////////////////////////////////////////////////////////////
8347 //!   Function:    NvAPI_VIO_SetSyncDelay
8348 //!
8349 //!   Description: This API sets the sync delay parameters.
8350 //!
8351 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.
8352 //! SUPPORTED OS:  Windows XP and higher
8353 //!
8354 //!
8355 //! \since Release: 190
8356 //!
8357 //! \param [in]  NvVioHandle   The caller provides the SDI device handle as input.
8358 //! \param [in]  pSyncDelay    Pointer to sync delay parameters
8359 //!
8360 //! \retval ::NVAPI_OK                           Success
8361 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8362 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8363 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Stucture version invalid
8364 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8365 //! \retval ::NVAPI_DEVICE_BUSY                  Access denied for requested access
8366 ///////////////////////////////////////////////////////////////////////////////
8367 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_SetConfig.")
8368 NVAPI_INTERFACE NvAPI_VIO_SetSyncDelay(NvVioHandle            hVioHandle,
8369                                        const NVVIOSYNCDELAY   *pSyncDelay);
8370 
8371 ////////////////////////////////////////////////////////////////////////////////
8372 //!   Function:    NvAPI_VIO_GetSyncDelay
8373 //!
8374 //!   Description: This API gets the sync delay parameters.
8375 //!
8376 //! \deprecated  Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.
8377 //! SUPPORTED OS:  Windows XP and higher
8378 //!
8379 //!
8380 //! \since Release: 190
8381 //!
8382 //! \param [in]  NvVioHandle      The caller provides the SDI device handle as input.
8383 //! \param [out] pSyncDelay       Pointer to sync delay parameters
8384 //!
8385 //! \retval ::NVAPI_OK                           Success
8386 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8387 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8388 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Stucture version invalid
8389 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8390 ///////////////////////////////////////////////////////////////////////////////
8391 __nvapi_deprecated_function("Do not use this function - it is deprecated in release 290. Instead, use NvAPI_VIO_GetConfig.")
8392 NVAPI_INTERFACE NvAPI_VIO_GetSyncDelay(NvVioHandle      hVioHandle,
8393                                        NVVIOSYNCDELAY   *pSyncDelay);
8394 
8395 typedef enum _NVVIOPCILINKRATE
8396 {
8397     NVVIOPCILINKRATE_UNKNOWN          = 0,
8398     NVVIOPCILINKRATE_GEN1             = 1,                    //<! 2.5 Gbps.
8399     NVVIOPCILINKRATE_GEN2             = 2,                    //<! 5 Gbps.
8400     NVVIOPCILINKRATE_GEN3             = 3,                    //<! 8 Gbps.
8401 }NVVIOPCILINKRATE;
8402 
8403 typedef enum _NVVIOPCILINKWIDTH
8404 {
8405     NVVIOPCILINKWIDTH_UNKNOWN         = 0,
8406     NVVIOPCILINKWIDTH_x1              = 1,
8407     NVVIOPCILINKWIDTH_x2              = 2,
8408     NVVIOPCILINKWIDTH_x4              = 4,
8409     NVVIOPCILINKWIDTH_x8              = 8,
8410     NVVIOPCILINKWIDTH_x16            = 16,
8411 }NVVIOPCILINKWIDTH;
8412 
8413 typedef struct _NVVIOPCIINFO
8414 {
8415     NvU32                     version;                            //!< Structure version
8416 
8417     NvU32                   pciDeviceId;                        //!< specifies the internal PCI device identifier for the GVI.
8418     NvU32                   pciSubSystemId;                        //!< specifies the internal PCI subsystem identifier for the GVI.
8419     NvU32                   pciRevisionId;                        //!< specifies the internal PCI device-specific revision identifier for the GVI.
8420     NvU32                   pciDomain;                            //!< specifies the PCI domain of the GVI device.
8421     NvU32                   pciBus;                                //!< specifies the PCI bus number of the GVI device.
8422     NvU32                   pciSlot;                            //!< specifies the PCI slot number of the GVI device.
8423     NVVIOPCILINKWIDTH       pciLinkWidth;                        //!< specifies the the negotiated PCIE link width.
8424     NVVIOPCILINKRATE           pciLinkRate;                        //!< specifies the the negotiated PCIE link rate.
8425 } NVVIOPCIINFO_V1;
8426 
8427 typedef NVVIOPCIINFO_V1                                         NVVIOPCIINFO;
8428 #define NVVIOPCIINFO_VER1                                          MAKE_NVAPI_VERSION(NVVIOPCIINFO_V1,1)
8429 #define NVVIOPCIINFO_VER                                        NVVIOPCIINFO_VER1
8430 
8431 ///////////////////////////////////////////////////////////////////////////////
8432 //
8433 // FUNCTION NAME: NvAPI_VIO_GetPCIInfo()
8434 //
8435 // DESCRIPTION:   This API gets PCI information of the attached SDI(input) capture card.
8436 //
8437 // PARAMETERS:      hVioHandle    (IN)    - Handle to SDI capture card.
8438 //                  pVioPCIInfo    (OUT)    - PCI information of the attached SDI capture card.
8439 //
8440 //! SUPPORTED OS:  Windows XP and higher
8441 //!
8442 //
8443 // RETURN STATUS: This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with
8444 //                specific meaning for this API, they are listed below.
8445 //
8446 ///////////////////////////////////////////////////////////////////////////////
8447 NVAPI_INTERFACE NvAPI_VIO_GetPCIInfo(__in NvVioHandle hVioHandle,
8448                                             __inout NVVIOPCIINFO* pVioPCIInfo);
8449 
8450 ////////////////////////////////////////////////////////////////////////////////
8451 //!   Function:    NvAPI_VIO_IsRunning
8452 //!
8453 //!   Description: This API determines if Video I/O is running.
8454 //!
8455 //! SUPPORTED OS:  Windows XP and higher
8456 //!
8457 //!
8458 //! \since Release: 190
8459 //!
8460 //! \param [in]  NvVioHandle[IN]          The caller provides the SDI device handle as input.
8461 //!
8462 //! \retval ::NVAPI_DRIVER_RUNNING        Video I/O running
8463 //! \retval ::NVAPI_DRIVER_NOTRUNNING     Video I/O not running
8464 ///////////////////////////////////////////////////////////////////////////////
8465 NVAPI_INTERFACE NvAPI_VIO_IsRunning(NvVioHandle   hVioHandle);
8466 
8467 ///////////////////////////////////////////////////////////////////////////////
8468 //!   Function:    NvAPI_VIO_Start
8469 //!
8470 //!   Description: This API starts Video I/O.
8471 //!              This API should be called for NVVIOOWNERTYPE_DESKTOP only and will not work for OGL applications.
8472 //!
8473 //! SUPPORTED OS:  Windows XP and higher
8474 //!
8475 //!
8476 //! \since Release: 190
8477 //!
8478 //! \param [in]  NvVioHandle[IN]     The caller provides the SDI device handle as input.
8479 //!
8480 //! \retval ::NVAPI_OK                           Success
8481 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8482 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8483 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8484 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8485 //! \retval ::NVAPI_DEVICE_BUSY                  Access denied for requested access
8486 ///////////////////////////////////////////////////////////////////////////////
8487 NVAPI_INTERFACE NvAPI_VIO_Start(NvVioHandle     hVioHandle);
8488 
8489 ///////////////////////////////////////////////////////////////////////////////
8490 //!   Function:    NvAPI_VIO_Stop
8491 //!
8492 //!   Description: This API stops Video I/O.
8493 //!              This API should be called for NVVIOOWNERTYPE_DESKTOP only and will not work for OGL applications.
8494 //!
8495 //! SUPPORTED OS:  Windows XP and higher
8496 //!
8497 //!
8498 //! \since Release: 190
8499 //!
8500 //! \param [in]  NvVioHandle[IN]     The caller provides the SDI device handle as input.
8501 //!
8502 //! \retval ::NVAPI_OK                           Success
8503 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8504 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8505 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8506 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8507 //! \retval ::NVAPI_DEVICE_BUSY                  Access denied for requested access
8508 ///////////////////////////////////////////////////////////////////////////////
8509 NVAPI_INTERFACE NvAPI_VIO_Stop(NvVioHandle     hVioHandle);
8510 
8511 
8512 ///////////////////////////////////////////////////////////////////////////////
8513 //!   Function:    NvAPI_VIO_IsFrameLockModeCompatible
8514 //!
8515 //!   Description: This API checks whether modes are compatible in frame lock mode.
8516 //!
8517 //! SUPPORTED OS:  Windows XP and higher
8518 //!
8519 //!
8520 //! \since Release: 190
8521 //!
8522 //! \param [in]   NvVioHandle          The caller provides the SDI device handle as input.
8523 //! \param [in]   srcEnumIndex         Source Enumeration index
8524 //! \param [in]   destEnumIndex        Destination Enumeration index
8525 //! \param [out]  pbCompatible         Pointer to receive compatibility
8526 //!
8527 //! \retval ::NVAPI_OK                           Success
8528 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8529 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8530 //! \retval ::NVAPI_NOT_SUPPORTED                Video I/O not supported
8531 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8532 ///////////////////////////////////////////////////////////////////////////////
8533 NVAPI_INTERFACE NvAPI_VIO_IsFrameLockModeCompatible(NvVioHandle              hVioHandle,
8534                                                     NvU32                    srcEnumIndex,
8535                                                     NvU32                    destEnumIndex,
8536                                                     NvU32*                   pbCompatible);
8537 
8538 
8539 ///////////////////////////////////////////////////////////////////////////////
8540 //!   Function:    NvAPI_VIO_EnumDevices
8541 //!
8542 //!   Description: This API enumerate all VIO devices connected to the system.
8543 //!
8544 //! SUPPORTED OS:  Windows XP and higher
8545 //!
8546 //!
8547 //! \since Release: 190
8548 //!
8549 //! \param [out]  NvVioHandle                  User passes the pointer of NvVioHandle[] array to get handles to
8550 //!                                            all the connected video I/O devices.
8551 //! \param [out]  vioDeviceCount               User gets total number of VIO devices connected to the system.
8552 //!
8553 //! \retval ::NVAPI_OK                         Success
8554 //! \retval ::NVAPI_API_NOT_INTIALIZED         NVAPI Not Initialized
8555 //! \retval ::NVAPI_INVALID_ARGUMENT           Arguments passed to API are not valid
8556 //! \retval ::NVAPI_ERROR                      NVAPI Random errors
8557 //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND    No SDI Device found
8558 ///////////////////////////////////////////////////////////////////////////////
8559 NVAPI_INTERFACE NvAPI_VIO_EnumDevices(NvVioHandle       hVioHandle[NVAPI_MAX_VIO_DEVICES],
8560                                       NvU32             *vioDeviceCount);
8561 
8562 
8563 ///////////////////////////////////////////////////////////////////////////////
8564 //!   Function:    NvAPI_VIO_QueryTopology
8565 //!
8566 //!   Description: This API queries the valid SDI topologies.
8567 //!
8568 //! SUPPORTED OS:  Windows XP and higher
8569 //!
8570 //!
8571 //! \since Release: 190
8572 //!
8573 //! \param [out] pNvVIOTopology     User passes the pointer to NVVIOTOPOLOGY to fetch all valid SDI topologies.
8574 //!
8575 //! \retval ::NVAPI_OK                           Success
8576 //! \retval ::NVAPI_API_NOT_INTIALIZED           NVAPI Not Initialized
8577 //! \retval ::NVAPI_INVALID_ARGUMENT             Arguments passed to API are not valid
8578 //! \retval ::NVAPI_INCOMPATIBLE_STRUCT_VERSION  Invalid structure version
8579 //! \retval ::NVAPI_ERROR                        NVAPI Random errors
8580 ///////////////////////////////////////////////////////////////////////////////
8581 NVAPI_INTERFACE NvAPI_VIO_QueryTopology(NV_VIO_TOPOLOGY   *pNvVIOTopology);
8582 
8583 
8584 ///////////////////////////////////////////////////////////////////////////////
8585 //!   Function:    NvAPI_VIO_EnumSignalFormats
8586 //!
8587 //!   Description: This API enumerates signal formats supported by Video I/O.
8588 //!
8589 //! SUPPORTED OS:  Windows XP and higher
8590 //!
8591 //!
8592 //! \since Release: 190
8593 //!
8594 //! \param [in]   NvVioHandle          The caller provides the SDI device handle as input.
8595 //! \param [in]   enumIndex            Enumeration index
8596 //! \param [out]  pSignalFormatDetail  Pointer to receive detail or NULL
8597 //!
8598 //! \retval ::NVAPI_OK                  Success
8599 //! \retval ::NVAPI_API_NOT_INTIALIZED  NVAPI not initialized
8600 //! \retval ::NVAPI_INVALID_ARGUMENT    Invalid argument passed
8601 //! \retval ::NVAPI_END_ENUMERATION     No more signal formats to enumerate
8602 ///////////////////////////////////////////////////////////////////////////////
8603 NVAPI_INTERFACE NvAPI_VIO_EnumSignalFormats(NvVioHandle              hVioHandle,
8604                                             NvU32                    enumIndex,
8605                                             NVVIOSIGNALFORMATDETAIL  *pSignalFormatDetail);
8606 
8607 ///////////////////////////////////////////////////////////////////////////////
8608 //!   Function:    NvAPI_VIO_EnumDataFormats
8609 //!
8610 //!   Description: This API enumerates data formats supported by Video I/O.
8611 //!
8612 //! SUPPORTED OS:  Windows XP and higher
8613 //!
8614 //!
8615 //! \since Release: 190
8616 //!
8617 //! \param [in]  NvVioHandle         The caller provides the SDI device handle as input.
8618 //! \param [in]  enumIndex           Enumeration index
8619 //! \param [out] pDataFormatDetail   Pointer to receive detail or NULL
8620 //!
8621 //! \retval ::NVAPI_OK                Success
8622 //! \retval ::NVAPI_END_ENUMERATION   No more data formats to enumerate
8623 //! \retval ::NVAPI_NOT_SUPPORTED     Unsupported NVVIODATAFORMAT_ enumeration
8624 ///////////////////////////////////////////////////////////////////////////////
8625 NVAPI_INTERFACE NvAPI_VIO_EnumDataFormats(NvVioHandle            hVioHandle,
8626                                           NvU32                  enumIndex,
8627                                           NVVIODATAFORMATDETAIL  *pDataFormatDetail);
8628 
8629 
8630 //! @}
8631 
8632 
8633 
8634 
8635 ///////////////////////////////////////////////////////////////////////////////////
8636 //  CAMERA TEST API
8637 //  These APIs allows test apps to perform low level camera tests
8638 
8639 //! \addtogroup vidio
8640 //! @{
8641 ///////////////////////////////////////////////////////////////////////////////
8642 //
8643 // FUNCTION NAME: NvAPI_Stereo_CreateConfigurationProfileRegistryKey
8644 //
8645 //! \fn NvAPI_Stereo_CreateConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType)
8646 //!
8647 //! DESCRIPTION:   Creates new configuration registry key for current application.
8648 //!
8649 //!                If there is no configuration profile prior to the function call,
8650 //!                this API tries to create a new configuration profile registry key
8651 //!                for a given application and fill it with the default values.
8652 //!                If an application already has a configuration profile registry key, the API does nothing.
8653 //!                The name of the key is automatically set to the name of the executable that calls this function.
8654 //!                Because of this, the executable should have a distinct and unique name.
8655 //!                If the application is using only one version of DirectX, then the default profile type will be appropriate.
8656 //!                If the application is using more than one version of DirectX from the same executable,
8657 //!                it should use the appropriate profile type for each configuration profile.
8658 //!
8659 //! HOW TO USE:    When there is a need for an application to have default stereo parameter values,
8660 //!                use this function to create a key to store the values.
8661 //!
8662 //! SUPPORTED OS:  Windows Vista and higher
8663 //!
8664 //!
8665 //! \since Release: 180
8666 //!
8667 //! \param [in]    registryProfileType  Type of profile the application wants to create. It should be one of the symbolic constants defined in
8668 //!                                     ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause function to do nothing and return
8669 //!                                     ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
8670 //!
8671 //! \retval ::NVAPI_OK                                           Key exists in the registry.
8672 //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED   This profile type is not supported.
8673 //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED                Access to registry failed.
8674 //! \retval ::NVAPI_API_NOT_INTIALIZED
8675 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED                       Stereo part of NVAPI not initialized.
8676 //! \retval ::NVAPI_ERROR
8677 //!
8678 ///////////////////////////////////////////////////////////////////////////////
8679 
8680 
8681 //! \ingroup stereoapi
8682 //! Used in NvAPI_Stereo_CreateConfigurationProfileRegistryKey()
8683 typedef enum _NV_StereoRegistryProfileType
8684 {
8685     NVAPI_STEREO_DEFAULT_REGISTRY_PROFILE, //!< Default registry configuration profile.
8686     NVAPI_STEREO_DX9_REGISTRY_PROFILE,     //!< Separate registry configuration profile for a DirectX 9 executable.
8687     NVAPI_STEREO_DX10_REGISTRY_PROFILE     //!< Separate registry configuration profile for a DirectX 10 executable.
8688 } NV_STEREO_REGISTRY_PROFILE_TYPE;
8689 
8690 
8691 //! \ingroup stereoapi
8692 NVAPI_INTERFACE NvAPI_Stereo_CreateConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType);
8693 
8694 
8695 
8696 
8697 ///////////////////////////////////////////////////////////////////////////////
8698 //
8699 // FUNCTION NAME: NvAPI_Stereo_DeleteConfigurationProfileRegistryKey
8700 //
8701 //! DESCRIPTION:   Removes configuration registry key for current application.
8702 //!
8703 //!                If an application already has a configuration profile prior to this function call,
8704 //!                the function attempts to remove the application's configuration profile registry key from the registry.
8705 //!                If there is no configuration profile registry key prior to the function call,
8706 //!                the function does nothing and does not report an error.
8707 //!
8708 //! SUPPORTED OS:  Windows Vista and higher
8709 //!
8710 //!
8711 //! \since Release: 180
8712 //!
8713 //! \param [in]   registryProfileType   Type of profile that the application wants to delete. This should be one of the symbolic
8714 //!                                     constants defined in ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause the function
8715 //!                                     to do nothing and return ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
8716 //!
8717 //! \retval ::NVAPI_OK                                           Key does not exist in the registry any more.
8718 //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED   This profile type is not supported.
8719 //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED                Access to registry failed.
8720 //! \retval ::NVAPI_API_NOT_INTIALIZED                           NVAPI is not initialized.
8721 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED                       Stereo part of NVAPI is not initialized.
8722 //! \retval ::NVAPI_ERROR
8723 //!
8724 //! \ingroup stereoapi
8725 ///////////////////////////////////////////////////////////////////////////////
8726 NVAPI_INTERFACE NvAPI_Stereo_DeleteConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType);
8727 
8728 ///////////////////////////////////////////////////////////////////////////////
8729 //
8730 // FUNCTION NAME: NvAPI_Stereo_SetConfigurationProfileValue
8731 //
8732 //! \fn NvAPI_Stereo_SetConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID, void *pValue)
8733 //!
8734 //! DESCRIPTION:   This API sets the given parameter value under the application's registry key.
8735 //!
8736 //!                If the value does not exist under the application's registry key,
8737 //!                the value will be created under the key.
8738 //!
8739 //! SUPPORTED OS:  Windows Vista and higher
8740 //!
8741 //!
8742 //! \since Release: 180
8743 //!
8744 //! \param [in]     registryProfileType  The type of profile the application wants to access. It should be one of the
8745 //!                                      symbolic constants defined in ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value
8746 //!                                      will cause function to do nothing and return ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
8747 //! \param [in]     valueRegistryID      ID of the value that is being set. It should be one of the symbolic constants defined in
8748 //!                                      ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause function to do nothing
8749 //!                                      and return ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED.
8750 //! \param [in]     pValue               Address of the value that is being set. It should be either address of a DWORD or of a float,
8751 //!                                      dependent on the type of the stereo parameter whose value is being set. The API will then cast that
8752 //!                                      address to DWORD* and write whatever is in those 4 bytes as a DWORD to the registry.
8753 //!
8754 //! \retval ::NVAPI_OK                                           Value is written to registry.
8755 //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED   This profile type is not supported.
8756 //! \retval ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED          This value is not supported.
8757 //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED                Access to registry failed.
8758 //! \retval ::NVAPI_API_NOT_INTIALIZED                           NVAPI is not initialized.
8759 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED                       Stereo part of NVAPI is not initialized.
8760 //! \retval ::NVAPI_ERROR                                        Something is wrong (generic error).
8761 //
8762 ///////////////////////////////////////////////////////////////////////////////
8763 
8764 
8765 //! \ingroup stereoapi
8766 //! Used in NvAPI_Stereo_SetConfigurationProfileValue()
8767 typedef enum _NV_StereoRegistryID
8768 {
8769     NVAPI_CONVERGENCE_ID,         //!< Symbolic constant for convergence registry ID.
8770     NVAPI_FRUSTUM_ADJUST_MODE_ID, //!< Symbolic constant for frustum adjust mode registry ID.
8771 } NV_STEREO_REGISTRY_ID;
8772 
8773 
8774 //! \ingroup stereoapi
8775 NVAPI_INTERFACE NvAPI_Stereo_SetConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID, void *pValue);
8776 
8777 
8778 ///////////////////////////////////////////////////////////////////////////////
8779 //
8780 // FUNCTION NAME: NvAPI_Stereo_DeleteConfigurationProfileValue
8781 //
8782 //! DESCRIPTION:   This API removes the given value from the application's configuration profile registry key.
8783 //!                If there is no such value, the function does nothing and does not report an error.
8784 //!
8785 //! SUPPORTED OS:  Windows Vista and higher
8786 //!
8787 //!
8788 //! \since Release: 180
8789 //!
8790 //! \param [in]     registryProfileType   The type of profile the application wants to access. It should be one of the
8791 //!                                       symbolic constants defined in ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will
8792 //!                                       cause function to do nothing and return ::NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
8793 //! \param [in]     valueRegistryID       ID of the value that is being deleted. It should be one of the symbolic constants defined in
8794 //!                                       ::NV_STEREO_REGISTRY_PROFILE_TYPE. Any other value will cause function to do nothing and return
8795 //!                                       ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED.
8796 //!
8797 //! \retval ::NVAPI_OK                                           Value does not exist in registry any more.
8798 //! \retval ::NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED   This profile type is not supported.
8799 //! \retval ::NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED          This value is not supported.
8800 //! \retval ::NVAPI_STEREO_REGISTRY_ACCESS_FAILED                Access to registry failed.
8801 //! \retval ::NVAPI_API_NOT_INTIALIZED
8802 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED                       Stereo part of NVAPI not initialized.
8803 //! \retval ::NVAPI_ERROR
8804 //!
8805 //! \ingroup stereoapi
8806 ///////////////////////////////////////////////////////////////////////////////
8807 NVAPI_INTERFACE NvAPI_Stereo_DeleteConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID);
8808 
8809 
8810 
8811 
8812 
8813 
8814 //! \addtogroup stereoapi
8815 //! @{
8816 
8817 typedef struct _NVAPI_STEREO_CAPS
8818 {
8819     NvU32 version;
8820     NvU32 supportsWindowedModeOff        : 1;
8821     NvU32 supportsWindowedModeAutomatic  : 1;
8822     NvU32 supportsWindowedModePersistent : 1;
8823     NvU32 reserved                       : 29;  // must be 0
8824     NvU32 reserved2[3];                         // must be 0
8825 } NVAPI_STEREO_CAPS_V1;
8826 
8827 #define NVAPI_STEREO_CAPS_VER1  MAKE_NVAPI_VERSION(NVAPI_STEREO_CAPS,1)
8828 #define NVAPI_STEREO_CAPS_VER   NVAPI_STEREO_CAPS_VER1
8829 
8830 typedef NVAPI_STEREO_CAPS_V1    NVAPI_STEREO_CAPS;
8831 
8832 //! @}
8833 
8834 ///////////////////////////////////////////////////////////////////////////////
8835 //
8836 // FUNCTION NAME: NvAPI_Stereo_GetStereoSupport
8837 //
8838 //! DESCRIPTION:  This API checks what kind of stereo support is currently supported on a particular display.
8839 //!               If the the display is prohibited from showing stereo (e.g. secondary in a multi-mon setup), we will
8840 //!               return 0 for all stereo modes (full screen exclusive, automatic windowed, persistent windowed).
8841 //!               Otherwise, we will check which stereo mode is supported. On 120Hz display, this will be what
8842 //!               the user chooses in control panel. On HDMI 1.4 display, persistent windowed mode is always assumed to be
8843 //!               supported. Note that this function does not check if the CURRENT RESOLUTION/REFRESH RATE can support
8844 //!               stereo. For HDMI 1.4, it is the app's responsibility to change the resolution/refresh rate to one that is
8845 //!               3D compatible. For 120Hz, the driver will ALWAYS force 120Hz anyway.
8846 //!
8847 //! SUPPORTED OS:  Windows Vista and higher
8848 //!
8849 //!
8850 //! \since Release: 304
8851 //!
8852 //! \param [in]     hMonitor handle to monitor that app is going to run on
8853 //! \param [out]    pCaps    Address where the result of the inquiry will be placed.
8854 //!                          *pCaps is defined in NVAPI_STEREO_CAPS.
8855 //! \return       This API can return any of the following error codes enumerated in #NvAPI_Status
8856 //! \retval ::NVAPI_OK
8857 //!
8858 //! \ingroup stereoapi
8859 ///////////////////////////////////////////////////////////////////////////////
8860 NVAPI_INTERFACE NvAPI_Stereo_GetStereoSupport(__in NvMonitorHandle hMonitor, __out NVAPI_STEREO_CAPS *pCaps);
8861 
8862 
8863 
8864 
8865 
8866 
8867 
8868 
8869 
8870 ///////////////////////////////////////////////////////////////////////////////
8871 //
8872 // FUNCTION NAME: NvAPI_Stereo_DecreaseSeparation
8873 //
8874 //! DESCRIPTION:   This API decreases separation for the given device interface (just like the Ctrl+F3 hotkey).
8875 //!
8876 //! WHEN TO USE:   After the stereo handle for device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
8877 //!
8878 //! SUPPORTED OS:  Windows Vista and higher
8879 //!
8880 //!
8881 //! \since Release: 180
8882 //!
8883 //! \param [in]   stereoHandle  Stereo handle that corresponds to the device interface.
8884 //!
8885 //! \retval ::NVAPI_OK - Decrease of separation percentage was successfull.
8886 //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
8887 //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
8888 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
8889 //! \retval ::NVAPI_ERROR - Something is wrong (generic error).
8890 //!
8891 //! \ingroup stereoapi
8892 ///////////////////////////////////////////////////////////////////////////////
8893 NVAPI_INTERFACE NvAPI_Stereo_DecreaseSeparation(StereoHandle stereoHandle);
8894 
8895 
8896 ///////////////////////////////////////////////////////////////////////////////
8897 //
8898 // FUNCTION NAME: NvAPI_Stereo_IncreaseSeparation
8899 //
8900 //! DESCRIPTION:   This API increases separation for the given device interface (just like the Ctrl+F4 hotkey).
8901 //!
8902 //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
8903 //!
8904 //! SUPPORTED OS:  Windows Vista and higher
8905 //!
8906 //!
8907 //! \since Release: 180
8908 //!
8909 //! \param [in]    stereoHandle  Stereo handle that corresponds to the device interface.
8910 //!
8911 //! \retval ::NVAPI_OK                               Increase of separation percentage was successfull.
8912 //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE  Device interface is not valid. Create again, then attach again.
8913 //! \retval ::NVAPI_API_NOT_INTIALIZED               NVAPI not initialized.
8914 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED           Stereo part of NVAPI not initialized.
8915 //! \retval ::NVAPI_ERROR                            Something is wrong (generic error).
8916 //!
8917 //! \ingroup stereoapi
8918 ///////////////////////////////////////////////////////////////////////////////
8919 NVAPI_INTERFACE NvAPI_Stereo_IncreaseSeparation(StereoHandle stereoHandle);
8920 
8921 
8922 
8923 
8924 ///////////////////////////////////////////////////////////////////////////////
8925 //
8926 // FUNCTION NAME: NvAPI_Stereo_DecreaseConvergence
8927 //
8928 //! DESCRIPTION:   This API decreases convergence for the given device interface (just like the Ctrl+F5 hotkey).
8929 //!
8930 //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
8931 //!
8932 //! SUPPORTED OS:  Windows Vista and higher
8933 //!
8934 //!
8935 //! \since Release: 180
8936 //!
8937 //! \param [in]     stereoHandle  Stereo handle that corresponds to the device interface.
8938 //!
8939 //! \retval ::NVAPI_OK - Decrease of convergence was successfull.
8940 //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
8941 //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
8942 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
8943 //! \retval ::NVAPI_ERROR - Something is wrong (generic error).
8944 //!
8945 //! \ingroup stereoapi
8946 ///////////////////////////////////////////////////////////////////////////////
8947 NVAPI_INTERFACE NvAPI_Stereo_DecreaseConvergence(StereoHandle stereoHandle);
8948 
8949 
8950 ///////////////////////////////////////////////////////////////////////////////
8951 //
8952 // FUNCTION NAME: NvAPI_Stereo_IncreaseConvergence
8953 //
8954 //! DESCRIPTION:   This API increases convergence for given the device interface (just like the Ctrl+F5 hotkey).
8955 //!
8956 //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
8957 //!
8958 //! SUPPORTED OS:  Windows Vista and higher
8959 //!
8960 //!
8961 //! \since Release: 180
8962 //!
8963 //! \param [in]    stereoHandle  Stereo handle that corresponds to the device interface.
8964 //!
8965 //! \retval ::NVAPI_OK                               Increase of convergence was successfull.
8966 //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE  Device interface is not valid. Create again, then attach again.
8967 //! \retval ::NVAPI_API_NOT_INTIALIZED
8968 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED           Stereo part of NVAPI not initialized.
8969 //! \retval ::NVAPI_ERROR
8970 //!
8971 //! \ingroup stereoapi
8972 ///////////////////////////////////////////////////////////////////////////////
8973 NVAPI_INTERFACE NvAPI_Stereo_IncreaseConvergence(StereoHandle stereoHandle);
8974 
8975 
8976 ///////////////////////////////////////////////////////////////////////////////
8977 //
8978 // FUNCTION NAME: NvAPI_Stereo_GetFrustumAdjustMode
8979 //
8980 //! \fn NvAPI_Stereo_GetFrustumAdjustMode(StereoHandle stereoHandle, NV_FRUSTUM_ADJUST_MODE *pFrustumAdjustMode)
8981 //! DESCRIPTION:   This API gets the current frustum adjust mode value.
8982 //!
8983 //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
8984 //!
8985 //! SUPPORTED OS:  Windows Vista and higher
8986 //!
8987 //!
8988 //! \since Release: 180
8989 //!
8990 //! \param [in]     stereoHandle         Stereo handle that corresponds to the device interface.
8991 //! \param [out]    pFrustumAdjustMode   Address of the NV_FRUSTUM_ADJUST_MODE type variable to store current frustum value in.
8992 //!
8993 //! \retval ::NVAPI_OK - Retrieval of frustum adjust mode was successfull.
8994 //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
8995 //! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
8996 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
8997 //! \retval ::NVAPI_ERROR - Something is wrong (generic error).
8998 //!
8999 ///////////////////////////////////////////////////////////////////////////////
9000 
9001 //! \ingroup stereoapi
9002 //! Used in NvAPI_Stereo_GetFrustumAdjustMode().
9003 typedef enum _NV_FrustumAdjustMode
9004 {
9005     NVAPI_NO_FRUSTUM_ADJUST,    //!< Do not adjust frustum.
9006     NVAPI_FRUSTUM_STRETCH,      //!< Stretch images in X.
9007     NVAPI_FRUSTUM_CLEAR_EDGES   //!< Clear corresponding edges for each eye.
9008 } NV_FRUSTUM_ADJUST_MODE;
9009 
9010 //! \ingroup stereoapi
9011 NVAPI_INTERFACE NvAPI_Stereo_GetFrustumAdjustMode(StereoHandle stereoHandle, NV_FRUSTUM_ADJUST_MODE *pFrustumAdjustMode);
9012 
9013 
9014 
9015 
9016 
9017 ///////////////////////////////////////////////////////////////////////////////
9018 //
9019 // FUNCTION NAME: NvAPI_Stereo_SetFrustumAdjustMode
9020 //
9021 //! DESCRIPTION:   This API sets the current frustum adjust mode value.
9022 //!
9023 //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
9024 //!
9025 //! SUPPORTED OS:  Windows Vista and higher
9026 //!
9027 //!
9028 //! \since Release: 180
9029 //!
9030 //! \param [in]     stereoHandle                Stereo handle that corresponds to the device interface.
9031 //! \param [in]     newFrustumAdjustModeValue   New value for frustum adjust mode. It should be one of the symbolic constants defined in
9032 //!                                             ::NV_FRUSTUM_ADJUST_MODE. Any other value will cause function to do nothing and return
9033 //!                                             ::NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED.
9034 //!
9035 //! \retval ::NVAPI_OK                                         Retrieval of frustum adjust mode was successfull.
9036 //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE            Device interface is not valid. Create again, then attach again.
9037 //! \retval ::NVAPI_API_NOT_INTIALIZED
9038 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED                     Stereo part of NVAPI not initialized.
9039 //! \retval ::NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED   Given frustum adjust mode is not supported.
9040 //! \retval ::NVAPI_ERROR
9041 //!
9042 //! \ingroup stereoapi
9043 ///////////////////////////////////////////////////////////////////////////////
9044 NVAPI_INTERFACE NvAPI_Stereo_SetFrustumAdjustMode(StereoHandle stereoHandle, NV_FRUSTUM_ADJUST_MODE newFrustumAdjustModeValue);
9045 
9046 
9047 ///////////////////////////////////////////////////////////////////////////////
9048 //
9049 // FUNCTION NAME: NvAPI_Stereo_CaptureJpegImage
9050 //
9051 //! DESCRIPTION:   This API captures the current stereo image in JPEG stereo format with the given quality.
9052 //!                Only the last capture call per flip will be effective.
9053 //!
9054 //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
9055 //!
9056 //! SUPPORTED OS:  Windows Vista and higher
9057 //!
9058 //!
9059 //! \since Release: 180
9060 //!
9061 //! \param [in]     stereoHandle  Stereo handle that corresponds to the device interface.
9062 //! \param [in]     quality        Quality of the JPEG image to be captured. Integer value betweeen 0 and 100.
9063 //!
9064 //! \retval ::NVAPI_OK                              Image captured.
9065 //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
9066 //! \retval ::NVAPI_API_NOT_INTIALIZED
9067 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED
9068 //! \retval ::NVAPI_STEREO_PARAMETER_OUT_OF_RANGE   Given quality is out of [0..100] range.
9069 //! \retval ::NVAPI_ERROR
9070 //!
9071 //! \ingroup stereoapi
9072 ///////////////////////////////////////////////////////////////////////////////
9073 NVAPI_INTERFACE NvAPI_Stereo_CaptureJpegImage(StereoHandle stereoHandle, NvU32 quality);
9074 
9075 ///////////////////////////////////////////////////////////////////////////////
9076 //
9077 // FUNCTION NAME: NvAPI_Stereo_InitActivation
9078 //
9079 //! DESCRIPTION:   This API allows an application to enable stereo viewing, without the need of a GUID/Key pair
9080 //!				   This API cannot be used to enable stereo viewing on 3DTV.
9081 //!
9082 //! HOW TO USE:    Call this function immediately after device creation, then follow with a reset. \n
9083 //!                Very generically:
9084 //!                Create Device->Create Stereo Handle->InitActivation->Reset Device
9085 //!
9086 //! SUPPORTED OS:  Windows Vista and higher
9087 //!
9088 //! \since Release: 302
9089 //!
9090 //! \param [in]   stereoHandle            Stereo handle corresponding to the device interface.
9091 //! \param [in]   bDelayed				  Use delayed activation
9092 //!
9093 //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
9094 //!         If there are return error codes with specific meaning for this API,
9095 //!         they are listed below.
9096 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
9097 //!
9098 //! \ingroup stereoapi
9099 ///////////////////////////////////////////////////////////////////////////////
9100 
9101 //! \addtogroup stereoapi
9102 //! @{
9103 
9104 //! InitActivation Flags
9105 typedef enum _NVAPI_STEREO_INIT_ACTIVATION_FLAGS
9106 {
9107 	NVAPI_STEREO_INIT_ACTIVATION_IMMEDIATE = 0X00,
9108     NVAPI_STEREO_INIT_ACTIVATION_DELAYED = 0x01,
9109 } NVAPI_STEREO_INIT_ACTIVATION_FLAGS;
9110 
9111 NVAPI_INTERFACE NvAPI_Stereo_InitActivation(__in StereoHandle hStereoHandle, __in NVAPI_STEREO_INIT_ACTIVATION_FLAGS flags);
9112 
9113 //! @}
9114 
9115 ///////////////////////////////////////////////////////////////////////////////
9116 //
9117 // FUNCTION NAME: NvAPI_Stereo_Trigger_Activation
9118 //
9119 //! DESCRIPTION:   This API allows an application to trigger creation of a stereo desktop,
9120 //!				   in case the creation was stopped on application launch.
9121 //!
9122 //! SUPPORTED OS:  Windows Vista and higher
9123 //!
9124 //! \since Release: 302
9125 //!
9126 //! \param [in]   stereoHandle   Stereo handle that corresponds to the device interface.
9127 //!
9128 //! \return This API can return any of the error codes enumerated in #NvAPI_Status.
9129 //!         If there are return error codes with specific meaning for this API,
9130 //!         they are listed below.
9131 //! \retval ::NVAPI_STEREO_INIT_ACTIVATION_NOT_DONE - Stereo InitActivation not called.
9132 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
9133 //!
9134 //! \ingroup stereoapi
9135 ///////////////////////////////////////////////////////////////////////////////
9136 NVAPI_INTERFACE NvAPI_Stereo_Trigger_Activation(__in StereoHandle hStereoHandle);
9137 
9138 ///////////////////////////////////////////////////////////////////////////////
9139 //
9140 // FUNCTION NAME: NvAPI_Stereo_CapturePngImage
9141 //
9142 //! DESCRIPTION:   This API captures the current stereo image in PNG stereo format.
9143 //!                Only the last capture call per flip will be effective.
9144 //!
9145 //! WHEN TO USE:   After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
9146 //!
9147 //! SUPPORTED OS:  Windows Vista and higher
9148 //!
9149 //!
9150 //! \since Release: 180
9151 //!
9152 //! \param [in]     stereoHandle  Stereo handle corresponding to the device interface.
9153 //!
9154 //! \retval ::NVAPI_OK                               Image captured.
9155 //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE  Device interface is not valid. Create again, then attach again.
9156 //! \retval ::NVAPI_API_NOT_INTIALIZED
9157 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED           Stereo part of NVAPI not initialized.
9158 //! \retval ::NVAPI_ERROR
9159 //!
9160 //! \ingroup stereoapi
9161 ///////////////////////////////////////////////////////////////////////////////
9162 NVAPI_INTERFACE NvAPI_Stereo_CapturePngImage(StereoHandle stereoHandle);
9163 
9164 
9165 ///////////////////////////////////////////////////////////////////////////////
9166 //
9167 // FUNCTION NAME: NvAPI_Stereo_ReverseStereoBlitControl
9168 //
9169 //! DESCRIPTION:   This API turns on/off reverse stereo blit.
9170 //!
9171 //! HOW TO USE:    Use after the stereo handle for the device interface is created via successfull call to the appropriate
9172 //!                NvAPI_Stereo_CreateHandleFrom() function.
9173 //!                After reversed stereo blit control is turned on, blits from the stereo surface will
9174 //!                produce the right-eye image in the left side of the destination surface and the left-eye
9175 //!                image in the right side of the destination surface.
9176 //!
9177 //!                In DirectX 9, the destination surface must be created as the render target, and StretchRect must be used.
9178 //!                Conditions:
9179 //!                - DstWidth == 2*SrcWidth
9180 //!                - DstHeight == SrcHeight
9181 //!                - Src surface is the stereo surface.
9182 //!                - SrcRect must be {0,0,SrcWidth,SrcHeight}
9183 //!                - DstRect must be {0,0,DstWidth,DstHeight}
9184 //!
9185 //!                In DirectX 10, ResourceCopyRegion must be used.
9186 //!                Conditions:
9187 //!                - DstWidth == 2*SrcWidth
9188 //!                - DstHeight == SrcHeight
9189 //!                - dstX == 0,
9190 //!                - dstY == 0,
9191 //!                - dstZ == 0,
9192 //!                - SrcBox: left=top=front==0; right==SrcWidth; bottom==SrcHeight; back==1;
9193 //!
9194 //! SUPPORTED OS:  Windows Vista and higher
9195 //!
9196 //!
9197 //! \since Release: 185
9198 //!
9199 //! \param [in]    stereoHandle  Stereo handle corresponding to the device interface.
9200 //! \param [in]    TurnOn         != 0 : Turns on \n
9201 //!                               == 0 : Turns off
9202 //!
9203 //!
9204 //! \retval ::NVAPI_OK                                Retrieval of frustum adjust mode was successfull.
9205 //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE   Device interface is not valid. Create again, then attach again.
9206 //! \retval ::NVAPI_API_NOT_INTIALIZED
9207 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED            Stereo part of NVAPI not initialized.
9208 //! \retval ::NVAPI_ERROR
9209 //!
9210 //! \ingroup stereoapi
9211 ///////////////////////////////////////////////////////////////////////////////
9212 NVAPI_INTERFACE NvAPI_Stereo_ReverseStereoBlitControl(StereoHandle hStereoHandle, NvU8 TurnOn);
9213 
9214 
9215 ///////////////////////////////////////////////////////////////////////////////
9216 //
9217 // FUNCTION NAME: NvAPI_Stereo_SetNotificationMessage
9218 //
9219 //! DESCRIPTION:   This API is a Setup notification message that the stereo driver uses to notify the application
9220 //!                when the user changes the stereo driver state.
9221 //!
9222 //!                When the user changes the stereo state (Activated or Deactivated, separation or conversion)
9223 //!                the stereo driver posts a defined message with the following parameters:
9224 //!
9225 //!                lParam  is the current conversion. (Actual conversion is *(float*)&lParam )
9226 //!
9227 //!                wParam == MAKEWPARAM(l, h) where
9228 //!                - l == 0 if stereo is deactivated
9229 //!                - l == 1 if stereo is deactivated
9230 //!                - h is the current separation. (Actual separation is float(h*100.f/0xFFFF)
9231 //!
9232 //!                Call this API with NULL hWnd to prohibit notification.
9233 //!
9234 //! WHEN TO USE:   Use after the stereo handle for device interface is created via successful call to appropriate
9235 //!                NvAPI_Stereo_CreateHandleFrom() function.
9236 //!
9237 //!
9238 //! SUPPORTED OS:  Windows Vista and higher
9239 //!
9240 //!
9241 //! \since Release: 180
9242 //!
9243 //!
9244 //! \param [in]     stereoHandle  Stereo handle corresponding to the device interface.
9245 //! \param [in]     hWnd          Window HWND that will be notified when the user changes the stereo driver state.
9246 //!                               Actual HWND must be cast to an NvU64.
9247 //! \param [in]     messageID     MessageID of the message that will be posted to hWnd
9248 //!
9249 //! \retval ::NVAPI_OK                                Notification set.
9250 //! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE   Device interface is not valid. Create again, then attach again.
9251 //! \retval ::NVAPI_API_NOT_INTIALIZED
9252 //! \retval ::NVAPI_STEREO_NOT_INITIALIZED            Stereo part of NVAPI not initialized.
9253 //! \retval ::NVAPI_ERROR
9254 //!
9255 //! \ingroup stereoapi
9256 ///////////////////////////////////////////////////////////////////////////////
9257 NVAPI_INTERFACE NvAPI_Stereo_SetNotificationMessage(StereoHandle hStereoHandle, NvU64 hWnd,NvU64 messageID);
9258 
9259 
9260 
9261 
9262 
9263 
9264 
9265 
9266 
9267 
9268 
9269 
9270 
9271 
9272 
9273 //! \ingroup stereoapi
9274 #define NVAPI_STEREO_QUADBUFFERED_API_VERSION   0x2
9275 
9276 //! \ingroup stereoapi
9277  typedef enum _NV_StereoSwapChainMode
9278  {
9279    NVAPI_STEREO_SWAPCHAIN_DEFAULT = 0,
9280    NVAPI_STEREO_SWAPCHAIN_STEREO = 1,
9281    NVAPI_STEREO_SWAPCHAIN_MONO = 2,
9282  } NV_STEREO_SWAPCHAIN_MODE;
9283 
9284 #if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
9285 ///////////////////////////////////////////////////////////////////////////////
9286 //
9287 // FUNCTION NAME: NvAPI_D3D1x_CreateSwapChain
9288 //
9289 //! DESCRIPTION: This API allows the user to create a mono or a stereo swap chain.
9290 //!
9291 //!          NOTE: NvAPI_D3D1x_CreateSwapChain is a wrapper of the method IDXGIFactory::CreateSwapChain which
9292 //!                additionally notifies the D3D driver of the mode in which stereo mode the swap chain is to be
9293 //!                created.
9294 //!
9295 //! \since Release: 285
9296 //!
9297 //! SUPPORTED OS:  Windows 7 and higher
9298 //!
9299 //!
9300 //! \param [in]     hStereoHandle      Stereo handle that corresponds to the device interface.
9301 //!                                   A pointer to the device that will write 2D images to the swap chain.
9302 //! \param [in]     pDesc             A pointer to the swap-chain description (DXGI_SWAP_CHAIN_DESC). This parameter cannot be NULL.
9303 //! \param [out]    ppSwapChain       A pointer to the swap chain created.
9304 //! \param [in]     mode              The stereo mode fot the swap chain.
9305 //!                                   NVAPI_STEREO_SWAPCHAIN_DEFAULT
9306 //!                                   NVAPI_STEREO_SWAPCHAIN_STEREO
9307 //!                                   NVAPI_STEREO_SWAPCHAIN_MONO
9308 //!
9309 //! \retval ::NVAPI_OK                 The swap chain was created successfully.
9310 //! \retval ::NVAPI_ERROR              The operation failed.
9311 //!
9312 //! \ingroup stereoapi
9313 ///////////////////////////////////////////////////////////////////////////////
9314 NVAPI_INTERFACE NvAPI_D3D1x_CreateSwapChain(StereoHandle hStereoHandle,
9315                                             DXGI_SWAP_CHAIN_DESC* pDesc,
9316                                             IDXGISwapChain** ppSwapChain,
9317                                             NV_STEREO_SWAPCHAIN_MODE mode);
9318 
9319 #endif //if defined(__d3d10_h__) || defined(__d3d10_1_h__) || defined(__d3d11_h__)
9320 
9321 
9322 #if defined(_D3D9_H_)
9323 ///////////////////////////////////////////////////////////////////////////////
9324 //
9325 // FUNCTION NAME: NvAPI_D3D9_CreateSwapChain
9326 //
9327 //! DESCRIPTION: This API allows the user to create a mono or a stereo swap chain.
9328 //!
9329 //!          NOTE: NvAPI_D3D9_CreateSwapChain is a wrapper of the method IDirect3DDevice9::CreateAdditionalSwapChain which
9330 //!                additionally notifies the D3D driver if the swap chain creation mode must be stereo or mono.
9331 //!
9332 //!
9333 //! \since Release: 285
9334 //!
9335 //! SUPPORTED OS:  Windows 7 and higher
9336 //!
9337 //!
9338 //! \param [in]      hStereoHandle            Stereo handle that corresponds to the device interface.
9339 //! \param [in, out] pPresentationParameters  A pointer to the swap-chain description (DXGI). This parameter cannot be NULL.
9340 //! \param [out]     ppSwapChain              A pointer to the swap chain created.
9341 //! \param [in]      mode                     The stereo mode for the swap chain.
9342 //!                                           NVAPI_STEREO_SWAPCHAIN_DEFAULT
9343 //!                                           NVAPI_STEREO_SWAPCHAIN_STEREO
9344 //!                                           NVAPI_STEREO_SWAPCHAIN_MONO
9345 //!
9346 //! \retval ::NVAPI_OK                        The swap chain creation was successful
9347 //! \retval ::NVAPI_ERROR                     The operation failed.
9348 //!
9349 //!\ingroup stereoapi
9350 ///////////////////////////////////////////////////////////////////////////////
9351 NVAPI_INTERFACE NvAPI_D3D9_CreateSwapChain(StereoHandle hStereoHandle,
9352                                            D3DPRESENT_PARAMETERS *pPresentationParameters,
9353                                            IDirect3DSwapChain9 **ppSwapChain,
9354                                            NV_STEREO_SWAPCHAIN_MODE mode);
9355 #endif //if defined(_D3D9_H_)
9356 
9357 
9358 
9359 
9360 
9361 //! \addtogroup drsapi
9362 //! @{
9363 
9364 
9365 // GPU Profile APIs
9366 
9367 NV_DECLARE_HANDLE(NvDRSSessionHandle);
9368 NV_DECLARE_HANDLE(NvDRSProfileHandle);
9369 
9370 #define NVAPI_DRS_GLOBAL_PROFILE                             ((NvDRSProfileHandle) -1)
9371 
9372 #define NVAPI_SETTING_MAX_VALUES                             100
9373 
9374 typedef enum _NVDRS_SETTING_TYPE
9375 {
9376      NVDRS_DWORD_TYPE,
9377      NVDRS_BINARY_TYPE,
9378      NVDRS_STRING_TYPE,
9379      NVDRS_WSTRING_TYPE
9380 } NVDRS_SETTING_TYPE;
9381 
9382 typedef enum _NVDRS_SETTING_LOCATION
9383 {
9384      NVDRS_CURRENT_PROFILE_LOCATION,
9385      NVDRS_GLOBAL_PROFILE_LOCATION,
9386      NVDRS_BASE_PROFILE_LOCATION,
9387      NVDRS_DEFAULT_PROFILE_LOCATION
9388 } NVDRS_SETTING_LOCATION;
9389 
9390 
9391 typedef struct _NVDRS_GPU_SUPPORT
9392 {
9393     NvU32 geforce    :  1;
9394     NvU32 quadro     :  1;
9395     NvU32 nvs        :  1;
9396     NvU32 reserved4  :  1;
9397     NvU32 reserved5  :  1;
9398     NvU32 reserved6  :  1;
9399     NvU32 reserved7  :  1;
9400     NvU32 reserved8  :  1;
9401     NvU32 reserved9  :  1;
9402     NvU32 reserved10 :  1;
9403     NvU32 reserved11 :  1;
9404     NvU32 reserved12 :  1;
9405     NvU32 reserved13 :  1;
9406     NvU32 reserved14 :  1;
9407     NvU32 reserved15 :  1;
9408     NvU32 reserved16 :  1;
9409     NvU32 reserved17 :  1;
9410     NvU32 reserved18 :  1;
9411     NvU32 reserved19 :  1;
9412     NvU32 reserved20 :  1;
9413     NvU32 reserved21 :  1;
9414     NvU32 reserved22 :  1;
9415     NvU32 reserved23 :  1;
9416     NvU32 reserved24 :  1;
9417     NvU32 reserved25 :  1;
9418     NvU32 reserved26 :  1;
9419     NvU32 reserved27 :  1;
9420     NvU32 reserved28 :  1;
9421     NvU32 reserved29 :  1;
9422     NvU32 reserved30 :  1;
9423     NvU32 reserved31 :  1;
9424     NvU32 reserved32 :  1;
9425 } NVDRS_GPU_SUPPORT;
9426 
9427 //! Enum to decide on the datatype of setting value.
9428 typedef struct _NVDRS_BINARY_SETTING
9429 {
9430      NvU32                valueLength;               //!< valueLength should always be in number of bytes.
9431      NvU8                 valueData[NVAPI_BINARY_DATA_MAX];
9432 } NVDRS_BINARY_SETTING;
9433 
9434 typedef struct _NVDRS_SETTING_VALUES
9435 {
9436      NvU32                      version;                //!< Structure Version
9437      NvU32                      numSettingValues;       //!< Total number of values available in a setting.
9438      NVDRS_SETTING_TYPE         settingType;            //!< Type of setting value.
9439      union                                              //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
9440      {
9441          NvU32                      u32DefaultValue;    //!< Accessing default DWORD value of this setting.
9442          NVDRS_BINARY_SETTING       binaryDefaultValue; //!< Accessing default Binary value of this setting.
9443                                                         //!< Must be allocated by caller with valueLength specifying buffer size, or only valueLength will be filled in.
9444          NvAPI_UnicodeString        wszDefaultValue;    //!< Accessing default unicode string value of this setting.
9445      };
9446      union                                                //!< Setting values can be of either DWORD, Binary values or String type,
9447      {                                                    //!< NOT mixed types.
9448          NvU32                      u32Value;           //!< All possible DWORD values for a setting
9449          NVDRS_BINARY_SETTING       binaryValue;        //!< All possible Binary values for a setting
9450          NvAPI_UnicodeString        wszValue;           //!< Accessing current unicode string value of this setting.
9451      }settingValues[NVAPI_SETTING_MAX_VALUES];
9452 } NVDRS_SETTING_VALUES;
9453 
9454 //! Macro for constructing the version field of ::_NVDRS_SETTING_VALUES
9455 #define NVDRS_SETTING_VALUES_VER    MAKE_NVAPI_VERSION(NVDRS_SETTING_VALUES,1)
9456 
9457 typedef struct _NVDRS_SETTING
9458 {
9459      NvU32                      version;                //!< Structure Version
9460      NvAPI_UnicodeString        settingName;            //!< String name of setting
9461      NvU32                      settingId;              //!< 32 bit setting Id
9462      NVDRS_SETTING_TYPE         settingType;            //!< Type of setting value.
9463      NVDRS_SETTING_LOCATION     settingLocation;        //!< Describes where the value in CurrentValue comes from.
9464      NvU32                      isCurrentPredefined;    //!< It is different than 0 if the currentValue is a predefined Value,
9465                                                         //!< 0 if the currentValue is a user value.
9466      NvU32                      isPredefinedValid;      //!< It is different than 0 if the PredefinedValue union contains a valid value.
9467      union                                              //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
9468      {
9469          NvU32                      u32PredefinedValue;    //!< Accessing default DWORD value of this setting.
9470          NVDRS_BINARY_SETTING       binaryPredefinedValue; //!< Accessing default Binary value of this setting.
9471                                                            //!< Must be allocated by caller with valueLength specifying buffer size,
9472                                                            //!< or only valueLength will be filled in.
9473          NvAPI_UnicodeString        wszPredefinedValue;    //!< Accessing default unicode string value of this setting.
9474      };
9475      union                                              //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
9476      {
9477          NvU32                      u32CurrentValue;    //!< Accessing current DWORD value of this setting.
9478          NVDRS_BINARY_SETTING       binaryCurrentValue; //!< Accessing current Binary value of this setting.
9479                                                         //!< Must be allocated by caller with valueLength specifying buffer size,
9480                                                         //!< or only valueLength will be filled in.
9481          NvAPI_UnicodeString        wszCurrentValue;    //!< Accessing current unicode string value of this setting.
9482      };
9483 } NVDRS_SETTING;
9484 
9485 //! Macro for constructing the version field of ::_NVDRS_SETTING
9486 #define NVDRS_SETTING_VER        MAKE_NVAPI_VERSION(NVDRS_SETTING,1)
9487 
9488 typedef struct _NVDRS_APPLICATION_V1
9489 {
9490      NvU32                      version;            //!< Structure Version
9491      NvU32                      isPredefined;       //!< Is the application userdefined/predefined
9492      NvAPI_UnicodeString        appName;            //!< String name of the Application
9493      NvAPI_UnicodeString        userFriendlyName;   //!< UserFriendly name of the Application
9494      NvAPI_UnicodeString        launcher;           //!< Indicates the name (if any) of the launcher that starts the application
9495 } NVDRS_APPLICATION_V1;
9496 
9497 typedef struct _NVDRS_APPLICATION_V2
9498 {
9499      NvU32                      version;            //!< Structure Version
9500      NvU32                      isPredefined;       //!< Is the application userdefined/predefined
9501      NvAPI_UnicodeString        appName;            //!< String name of the Application
9502      NvAPI_UnicodeString        userFriendlyName;   //!< UserFriendly name of the Application
9503      NvAPI_UnicodeString        launcher;           //!< Indicates the name (if any) of the launcher that starts the Application
9504      NvAPI_UnicodeString        fileInFolder;       //!< Select this application only if this file is found.
9505                                                     //!< When specifying multiple files, separate them using the ':' character.
9506 } NVDRS_APPLICATION_V2;
9507 
9508 typedef struct _NVDRS_APPLICATION_V3
9509 {
9510      NvU32                      version;            //!< Structure Version
9511      NvU32                      isPredefined;       //!< Is the application userdefined/predefined
9512      NvAPI_UnicodeString        appName;            //!< String name of the Application
9513      NvAPI_UnicodeString        userFriendlyName;   //!< UserFriendly name of the Application
9514      NvAPI_UnicodeString        launcher;           //!< Indicates the name (if any) of the launcher that starts the Application
9515      NvAPI_UnicodeString        fileInFolder;       //!< Select this application only if this file is found.
9516                                                     //!< When specifying multiple files, separate them using the ':' character.
9517      NvU32                      isMetro:1;          //!< Windows 8 style app
9518      NvU32                      reserved:31;        //!< Reserved. Should be 0.
9519 } NVDRS_APPLICATION_V3;
9520 
9521 #define NVDRS_APPLICATION_VER_V1        MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V1,1)
9522 #define NVDRS_APPLICATION_VER_V2        MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V2,2)
9523 #define NVDRS_APPLICATION_VER_V3        MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V3,3)
9524 
9525 typedef NVDRS_APPLICATION_V3 NVDRS_APPLICATION;
9526 #define NVDRS_APPLICATION_VER NVDRS_APPLICATION_VER_V3
9527 
9528 typedef struct _NVDRS_PROFILE
9529 {
9530      NvU32                      version;            //!< Structure Version
9531      NvAPI_UnicodeString        profileName;        //!< String name of the Profile
9532      NVDRS_GPU_SUPPORT          gpuSupport;         //!< This read-only flag indicates the profile support on either
9533                                                     //!< Quadro, or Geforce, or both.
9534      NvU32                      isPredefined;       //!< Is the Profile user-defined, or predefined
9535      NvU32                      numOfApps;          //!< Total number of applications that belong to this profile. Read-only
9536      NvU32                      numOfSettings;      //!< Total number of settings applied for this Profile. Read-only
9537 } NVDRS_PROFILE;
9538 
9539 //! Macro for constructing the version field of ::_NVDRS_PROFILE
9540 #define NVDRS_PROFILE_VER        MAKE_NVAPI_VERSION(NVDRS_PROFILE,1)
9541 
9542 
9543 ///////////////////////////////////////////////////////////////////////////////
9544 //
9545 // FUNCTION NAME: NvAPI_DRS_CreateSession
9546 //
9547 //!   DESCRIPTION: This API allocates memory and initializes the session.
9548 //!
9549 //! SUPPORTED OS:  Windows XP and higher
9550 //!
9551 //!
9552 //! \param [out]  *phSession Return pointer to the session handle.
9553 //!
9554 //! \retval ::NVAPI_OK SUCCESS
9555 //! \retval ::NVAPI_ERROR: For miscellaneous errors.
9556 //
9557 ///////////////////////////////////////////////////////////////////////////////
9558 NVAPI_INTERFACE NvAPI_DRS_CreateSession(NvDRSSessionHandle *phSession);
9559 
9560 
9561 ///////////////////////////////////////////////////////////////////////////////
9562 //
9563 // FUNCTION NAME: NvAPI_DRS_DestroySession
9564 //
9565 //!   DESCRIPTION: This API frees the allocation: cleanup of NvDrsSession.
9566 //!
9567 //! SUPPORTED OS:  Windows XP and higher
9568 //!
9569 //!
9570 //! \param [in] hSession Input to the session handle.
9571 //!
9572 //! \retval ::NVAPI_OK SUCCESS
9573 //! \retval ::NVAPI_ERROR For miscellaneous errors.
9574 //
9575 ///////////////////////////////////////////////////////////////////////////////
9576 NVAPI_INTERFACE NvAPI_DRS_DestroySession(NvDRSSessionHandle hSession);
9577 
9578 ///////////////////////////////////////////////////////////////////////////////
9579 //
9580 // FUNCTION NAME: NvAPI_DRS_LoadSettings
9581 //
9582 //!   DESCRIPTION: This API loads and parses the settings data.
9583 //!
9584 //! SUPPORTED OS:  Windows XP and higher
9585 //!
9586 //!
9587 //! \param [in] hSession  Input to the session handle.
9588 //!
9589 //! \retval ::NVAPI_OK     SUCCESS
9590 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9591 //
9592 ///////////////////////////////////////////////////////////////////////////////
9593 NVAPI_INTERFACE NvAPI_DRS_LoadSettings(NvDRSSessionHandle hSession);
9594 
9595 
9596 ///////////////////////////////////////////////////////////////////////////////
9597 //
9598 // FUNCTION NAME: NvAPI_DRS_SaveSettings
9599 //
9600 //!   DESCRIPTION: This API saves the settings data to the system.
9601 //!
9602 //! SUPPORTED OS:  Windows XP and higher
9603 //!
9604 //!
9605 //! \param [in] hSession  Input to the session handle.
9606 //!
9607 //! \retval ::NVAPI_OK    SUCCESS
9608 //! \retval ::NVAPI_ERROR For miscellaneous errors.
9609 //
9610 ///////////////////////////////////////////////////////////////////////////////
9611 NVAPI_INTERFACE NvAPI_DRS_SaveSettings(NvDRSSessionHandle hSession);
9612 
9613 ///////////////////////////////////////////////////////////////////////////////
9614 //
9615 // FUNCTION NAME: NvAPI_DRS_LoadSettingsFromFile
9616 //
9617 //!   DESCRIPTION: This API loads settings from the given file path.
9618 //!
9619 //! SUPPORTED OS:  Windows XP and higher
9620 //!
9621 //!
9622 //! \param [in]  hSession Input to the session handle
9623 //! \param [in]  fileName Binary File Name/Path
9624 //!
9625 //! \retval ::NVAPI_OK     SUCCESS
9626 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9627 //
9628 ///////////////////////////////////////////////////////////////////////////////
9629 NVAPI_INTERFACE NvAPI_DRS_LoadSettingsFromFile(NvDRSSessionHandle hSession, NvAPI_UnicodeString fileName);
9630 
9631 ///////////////////////////////////////////////////////////////////////////////
9632 //
9633 // FUNCTION NAME: NvAPI_DRS_SaveSettingsToFile
9634 //
9635 //!   DESCRIPTION: This API saves settings to the given file path.
9636 //!
9637 //! SUPPORTED OS:  Windows XP and higher
9638 //!
9639 //!
9640 //! \param [in]  hSession  Input to the session handle.
9641 //! \param [in]  fileName  Binary File Name/Path
9642 //!
9643 //! \retval ::NVAPI_OK     SUCCESS
9644 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9645 //
9646 ///////////////////////////////////////////////////////////////////////////////
9647 NVAPI_INTERFACE NvAPI_DRS_SaveSettingsToFile(NvDRSSessionHandle hSession, NvAPI_UnicodeString fileName);
9648 
9649 //! @}
9650 
9651 
9652 
9653 ///////////////////////////////////////////////////////////////////////////////
9654 //
9655 // FUNCTION NAME: NvAPI_DRS_CreateProfile
9656 //
9657 //!   DESCRIPTION: This API creates an empty profile.
9658 //!
9659 //! SUPPORTED OS:  Windows XP and higher
9660 //!
9661 //!
9662 //! \param [in]  hSession        Input to the session handle.
9663 //! \param [in]  *pProfileInfo   Input pointer to NVDRS_PROFILE.
9664 //! \param [in]  *phProfile      Returns pointer to profile handle.
9665 //!
9666 //! \retval ::NVAPI_OK     SUCCESS
9667 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9668 //!
9669 //! \ingroup drsapi
9670 ///////////////////////////////////////////////////////////////////////////////
9671 NVAPI_INTERFACE NvAPI_DRS_CreateProfile(NvDRSSessionHandle hSession, NVDRS_PROFILE *pProfileInfo, NvDRSProfileHandle *phProfile);
9672 
9673 ///////////////////////////////////////////////////////////////////////////////
9674 //
9675 // FUNCTION NAME: NvAPI_DRS_DeleteProfile
9676 //
9677 //!   DESCRIPTION: This API deletes a profile or sets it back to a predefined value.
9678 //!
9679 //! SUPPORTED OS:  Windows XP and higher
9680 //!
9681 //!
9682 //! \param [in] hSession  Input to the session handle.
9683 //! \param [in] hProfile  Input profile handle.
9684 //!
9685 //! \retval ::NVAPI_OK     SUCCESS if the profile is found
9686 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9687 //!
9688 //! \ingroup drsapi
9689 ///////////////////////////////////////////////////////////////////////////////
9690 NVAPI_INTERFACE NvAPI_DRS_DeleteProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile);
9691 
9692 ///////////////////////////////////////////////////////////////////////////////
9693 //
9694 // FUNCTION NAME: NvAPI_DRS_SetCurrentGlobalProfile
9695 //
9696 //!   DESCRIPTION: This API sets the current global profile in the driver.
9697 //!
9698 //! SUPPORTED OS:  Windows XP and higher
9699 //!
9700 //!
9701 //! \param [in] hSession                Input to the session handle.
9702 //! \param [in] wszGlobalProfileName    Input current Global profile name.
9703 //!
9704 //! \retval ::NVAPI_OK     SUCCESS
9705 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9706 //!
9707 //! \ingroup drsapi
9708 ///////////////////////////////////////////////////////////////////////////////
9709 NVAPI_INTERFACE NvAPI_DRS_SetCurrentGlobalProfile(NvDRSSessionHandle hSession, NvAPI_UnicodeString wszGlobalProfileName);
9710 
9711 
9712 ///////////////////////////////////////////////////////////////////////////////
9713 //
9714 // FUNCTION NAME: NvAPI_DRS_GetCurrentGlobalProfile
9715 //
9716 //!   DESCRIPTION: This API returns the handle to the current global profile.
9717 //!
9718 //! SUPPORTED OS:  Windows XP and higher
9719 //!
9720 //!
9721 //! \param [in]   hSession     Input to the session handle.
9722 //! \param [out]  *phProfile   Returns current Global profile handle.
9723 //!
9724 //! \retval ::NVAPI_OK     SUCCESS
9725 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9726 //!
9727 //! \ingroup drsapi
9728 ///////////////////////////////////////////////////////////////////////////////
9729 NVAPI_INTERFACE NvAPI_DRS_GetCurrentGlobalProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile);
9730 
9731 ///////////////////////////////////////////////////////////////////////////////
9732 //
9733 // FUNCTION NAME: NvAPI_DRS_GetProfileInfo
9734 //
9735 //!   DESCRIPTION: This API gets information about the given profile. User needs to specify the name of the Profile.
9736 //!
9737 //! SUPPORTED OS:  Windows XP and higher
9738 //!
9739 //!
9740 //! \param [in]  hSession       Input to the session handle.
9741 //! \param [in]  hProfile       Input profile handle.
9742 //! \param [out] *pProfileInfo  Return the profile info.
9743 //!
9744 //! \retval ::NVAPI_OK     SUCCESS
9745 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9746 //!
9747 //! \ingroup drsapi
9748 ///////////////////////////////////////////////////////////////////////////////
9749 NVAPI_INTERFACE NvAPI_DRS_GetProfileInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_PROFILE *pProfileInfo);
9750 
9751 ///////////////////////////////////////////////////////////////////////////////
9752 //
9753 // FUNCTION NAME: NvAPI_DRS_SetProfileInfo
9754 //
9755 //!   DESCRIPTION: Specifies flags for a given profile. Currently only the NVDRS_GPU_SUPPORT is
9756 //!                used to update the profile. Neither the name, number of settings or applications
9757 //!                or other profile information can be changed with this function.
9758 //!
9759 //! SUPPORTED OS:  Windows XP and higher
9760 //!
9761 //!
9762 //! \param [in]  hSession       Input to the session handle.
9763 //! \param [in]  hProfile       Input profile handle.
9764 //! \param [in]  *pProfileInfo  Input the new profile info.
9765 //!
9766 //! \retval ::NVAPI_OK     SUCCESS
9767 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9768 //!
9769 //! \ingroup drsapi
9770 ///////////////////////////////////////////////////////////////////////////////
9771 NVAPI_INTERFACE NvAPI_DRS_SetProfileInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_PROFILE *pProfileInfo);
9772 
9773 
9774 ///////////////////////////////////////////////////////////////////////////////
9775 //
9776 // FUNCTION NAME: NvAPI_DRS_FindProfileByName
9777 //
9778 //!   DESCRIPTION: This API finds a profile in the current session.
9779 //!
9780 //! SUPPORTED OS:  Windows XP and higher
9781 //!
9782 //!
9783 //! \param [in]   hSession      Input to the session handle.
9784 //! \param [in]   profileName   Input profileName.
9785 //! \param [out]  phProfile     Input profile handle.
9786 //!
9787 //! \retval ::NVAPI_OK                SUCCESS if the profile is found
9788 //! \retval ::NVAPI_PROFILE_NOT_FOUND if profile is not found
9789 //! \retval ::NVAPI_ERROR             For miscellaneous errors.
9790 //!
9791 //! \ingroup drsapi
9792 ///////////////////////////////////////////////////////////////////////////////
9793 NVAPI_INTERFACE NvAPI_DRS_FindProfileByName(NvDRSSessionHandle hSession, NvAPI_UnicodeString profileName, NvDRSProfileHandle* phProfile);
9794 
9795 ///////////////////////////////////////////////////////////////////////////////
9796 //
9797 // FUNCTION NAME: NvAPI_DRS_EnumProfiles
9798 //
9799 //!   DESCRIPTION: This API enumerates through all the profiles in the session.
9800 //!
9801 //! SUPPORTED OS:  Windows XP and higher
9802 //!
9803 //!
9804 //! \param [in]   hSession        Input to the session handle.
9805 //! \param [in]   index           Input the index for enumeration.
9806 //! \param [out]  *phProfile      Returns profile handle.
9807 //!
9808 //!   RETURN STATUS: NVAPI_OK: SUCCESS if the profile is found
9809 //!                  NVAPI_ERROR: For miscellaneous errors.
9810 //!                  NVAPI_END_ENUMERATION: index exceeds the total number of available Profiles in DB.
9811 //!
9812 //! \ingroup drsapi
9813 ///////////////////////////////////////////////////////////////////////////////
9814 NVAPI_INTERFACE NvAPI_DRS_EnumProfiles(NvDRSSessionHandle hSession, NvU32 index, NvDRSProfileHandle *phProfile);
9815 
9816 ///////////////////////////////////////////////////////////////////////////////
9817 //
9818 // FUNCTION NAME: NvAPI_DRS_GetNumProfiles
9819 //
9820 //!   DESCRIPTION: This API obtains the number of profiles in the current session object.
9821 //!
9822 //! SUPPORTED OS:  Windows XP and higher
9823 //!
9824 //!
9825 //! \param [in]  hSession       Input to the session handle.
9826 //! \param out]  *numProfiles   Returns count of profiles in the current hSession.
9827 //!
9828 //! \retval ::NVAPI_OK                  SUCCESS
9829 //! \retval ::NVAPI_API_NOT_INTIALIZED  Failed to initialize.
9830 //! \retval ::NVAPI_INVALID_ARGUMENT    Invalid Arguments.
9831 //!
9832 //! \ingroup drsapi
9833 ///////////////////////////////////////////////////////////////////////////////
9834 NVAPI_INTERFACE NvAPI_DRS_GetNumProfiles(NvDRSSessionHandle hSession, NvU32 *numProfiles);
9835 
9836 ///////////////////////////////////////////////////////////////////////////////
9837 //
9838 // FUNCTION NAME: NvAPI_DRS_CreateApplication
9839 //
9840 //!   DESCRIPTION: This API adds an executable name to a profile.
9841 //!
9842 //! SUPPORTED OS:  Windows XP and higher
9843 //!
9844 //!
9845 //! \param [in]  hSession       Input to the session handle.
9846 //! \param [in]  hProfile       Input profile handle.
9847 //! \param [in]  *pApplication  Input NVDRS_APPLICATION struct with the executable name to be added.
9848 //!
9849 //! \retval ::NVAPI_OK     SUCCESS
9850 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9851 //!
9852 //! \ingroup drsapi
9853 ///////////////////////////////////////////////////////////////////////////////
9854 NVAPI_INTERFACE NvAPI_DRS_CreateApplication(NvDRSSessionHandle hSession, NvDRSProfileHandle  hProfile, NVDRS_APPLICATION *pApplication);
9855 
9856 
9857 ///////////////////////////////////////////////////////////////////////////////
9858 //
9859 // FUNCTION NAME: NvAPI_DRS_DeleteApplicationEx
9860 //
9861 //!   DESCRIPTION: This API removes an executable from a profile.
9862 //!
9863 //! SUPPORTED OS:  Windows XP and higher
9864 //!
9865 //!
9866 //! \param [in]   hSession  - Input to the session handle.
9867 //! \param [in]   hProfile  - Input profile handle.
9868 //! \param [in]   *pApp     - Input all the information about the application to be removed.
9869 //!
9870 //! \retval ::NVAPI_OK  SUCCESS
9871 //! \retval ::NVAPI_ERROR For miscellaneous errors.
9872 //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the path provided could refer to two different executables,
9873 //!                                              this error will be returned.
9874 //!
9875 //! \ingroup drsapi
9876 ///////////////////////////////////////////////////////////////////////////////
9877 NVAPI_INTERFACE NvAPI_DRS_DeleteApplicationEx(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_APPLICATION *pApp);
9878 
9879 
9880 ///////////////////////////////////////////////////////////////////////////////
9881 //
9882 // FUNCTION NAME: NvAPI_DRS_DeleteApplication
9883 //
9884 //!   DESCRIPTION: This API removes an executable name from a profile.
9885 //!
9886 //! SUPPORTED OS:  Windows XP and higher
9887 //!
9888 //!
9889 //! \param [in]  hSessionPARAMETERS   Input to the session handle.
9890 //! \param [in]  hProfile             Input profile handle.
9891 //! \param [in]  appName              Input the executable name to be removed.
9892 //!
9893 //! \retval ::NVAPI_OK     SUCCESS
9894 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9895 //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS If the path provided could refer to two different executables,
9896 //!                                              this error will be returned
9897 //!
9898 //! \ingroup drsapi
9899 ///////////////////////////////////////////////////////////////////////////////
9900 NVAPI_INTERFACE NvAPI_DRS_DeleteApplication(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvAPI_UnicodeString appName);
9901 
9902 ///////////////////////////////////////////////////////////////////////////////
9903 //
9904 // FUNCTION NAME: NvAPI_DRS_GetApplicationInfo
9905 //
9906 //!   DESCRIPTION: This API gets information about the given application.  The input application name
9907 //!                must match exactly what the Profile has stored for the application.
9908 //!                This function is better used to retrieve application information from a previous
9909 //!                enumeration.
9910 //!
9911 //! SUPPORTED OS:  Windows XP and higher
9912 //!
9913 //!
9914 //! \param [in]   hSession       Input to the session handle.
9915 //! \param [in]   hProfile       Input profile handle.
9916 //! \param [in]   appName        Input application name.
9917 //! \param [out]  *pApplication  Returns NVDRS_APPLICATION struct with all the attributes.
9918 //!
9919 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
9920 //!          If there are return error codes with specific meaning for this API,
9921 //!          they are listed below.
9922 //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS   The application name could not
9923 //                                                single out only one executable.
9924 //! \retval ::NVAPI_EXECUTABLE_NOT_FOUND           No application with that name is found on the profile.
9925 //!
9926 //! \ingroup drsapi
9927 ///////////////////////////////////////////////////////////////////////////////
9928 NVAPI_INTERFACE NvAPI_DRS_GetApplicationInfo(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvAPI_UnicodeString appName, NVDRS_APPLICATION *pApplication);
9929 
9930 ///////////////////////////////////////////////////////////////////////////////
9931 //
9932 // FUNCTION NAME: NvAPI_DRS_EnumApplications
9933 //
9934 //!   DESCRIPTION: This API enumerates all the applications in a given profile from the starting index to the maximum length.
9935 //!
9936 //! SUPPORTED OS:  Windows XP and higher
9937 //!
9938 //!
9939 //! \param [in]      hSession         Input to the session handle.
9940 //! \param [in]      hProfile         Input profile handle.
9941 //! \param [in]      startIndex       Indicates starting index for enumeration.
9942 //! \param [in,out]  *appCount        Input maximum length of the passed in arrays. Returns the actual length.
9943 //! \param [out]     *pApplication    Returns NVDRS_APPLICATION struct with all the attributes.
9944 //!
9945 //! \retval ::NVAPI_OK               SUCCESS
9946 //! \retval ::NVAPI_ERROR            For miscellaneous errors.
9947 //! \retval ::NVAPI_END_ENUMERATION  startIndex exceeds the total appCount.
9948 //!
9949 //! \ingroup drsapi
9950 ///////////////////////////////////////////////////////////////////////////////
9951 NVAPI_INTERFACE NvAPI_DRS_EnumApplications(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 startIndex, NvU32 *appCount, NVDRS_APPLICATION *pApplication);
9952 
9953 ///////////////////////////////////////////////////////////////////////////////
9954 //
9955 // FUNCTION NAME: NvAPI_DRS_FindApplicationByName
9956 //
9957 //!   DESCRIPTION: This API searches the application and the associated profile for the given application name.
9958 //!                If a fully qualified path is provided, this function will always return the profile
9959 //!                the driver will apply upon running the application (on the path provided).
9960 //!
9961 //! SUPPORTED OS:  Windows XP and higher
9962 //!
9963 //!
9964 //! \param [in]   hSession       Input to the hSession handle
9965 //! \param [in]   appName        Input appName. For best results, provide a fully qualified path of the type
9966 //!                              c:/Folder1/Folder2/App.exe
9967 //! \param [out]  *phProfile     Returns profile handle.
9968 //! \param [out]  *pApplication  Returns NVDRS_APPLICATION struct pointer.
9969 //!
9970 //! \return  This API can return any of the error codes enumerated in #NvAPI_Status.
9971 //!                  If there are return error codes with specific meaning for this API,
9972 //!                  they are listed below:
9973 //! \retval ::NVAPI_APPLICATION_NOT_FOUND          If App not found
9974 //! \retval ::NVAPI_EXECUTABLE_PATH_IS_AMBIGUOUS   If the input appName was not fully qualified, this error might return in the case of multiple matches
9975 //!
9976 //! \ingroup drsapi
9977 ///////////////////////////////////////////////////////////////////////////////
9978 NVAPI_INTERFACE NvAPI_DRS_FindApplicationByName(NvDRSSessionHandle hSession, NvAPI_UnicodeString appName, NvDRSProfileHandle *phProfile, NVDRS_APPLICATION *pApplication);
9979 
9980 ///////////////////////////////////////////////////////////////////////////////
9981 //
9982 // FUNCTION NAME: NvAPI_DRS_SetSetting
9983 //
9984 //!   DESCRIPTION: This API adds/modifies a setting to a profile.
9985 //!
9986 //! SUPPORTED OS:  Windows XP and higher
9987 //!
9988 //!
9989 //! \param [in]  hSession     Input to the session handle.
9990 //! \param [in]  hProfile     Input profile handle.
9991 //! \param [in]   *pSetting   Input NVDRS_SETTING struct pointer.
9992 //!
9993 //! \retval ::NVAPI_OK     SUCCESS
9994 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
9995 //!
9996 //! \ingroup drsapi
9997 ///////////////////////////////////////////////////////////////////////////////
9998 NVAPI_INTERFACE NvAPI_DRS_SetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NVDRS_SETTING *pSetting);
9999 
10000 ///////////////////////////////////////////////////////////////////////////////
10001 //
10002 // FUNCTION NAME: NvAPI_DRS_GetSetting
10003 //
10004 //!   DESCRIPTION: This API gets information about the given setting.
10005 //!
10006 //! SUPPORTED OS:  Windows XP and higher
10007 //!
10008 //!
10009 //! \param [in]   hSession   Input to the session handle.
10010 //! \param [in]   hProfile   Input profile handle.
10011 //! \param [in]   settingId  Input settingId.
10012 //! \param [out]  *pSetting  Returns all the setting info
10013 //!
10014 //! \retval ::NVAPI_OK     SUCCESS
10015 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
10016 //!
10017 //! \ingroup drsapi
10018 ///////////////////////////////////////////////////////////////////////////////
10019 NVAPI_INTERFACE NvAPI_DRS_GetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId, NVDRS_SETTING *pSetting);
10020 
10021 
10022 ///////////////////////////////////////////////////////////////////////////////
10023 //
10024 // FUNCTION NAME: NvAPI_DRS_EnumSettings
10025 //
10026 //!   DESCRIPTION: This API enumerates all the settings of a given profile from startIndex to the maximum length.
10027 //!
10028 //! SUPPORTED OS:  Windows XP and higher
10029 //!
10030 //!
10031 //! \param [in]      hSession        Input to the session handle.
10032 //! \param [in]      hProfile        Input profile handle.
10033 //! \param [in]      startIndex      Indicates starting index for enumeration.
10034 //! \param [in,out]  *settingsCount  Input max length of the passed in arrays, Returns the actual length.
10035 //! \param [out]     *pSetting       Returns all the settings info.
10036 //!
10037 //! \retval ::NVAPI_OK              SUCCESS
10038 //! \retval ::NVAPI_ERROR           For miscellaneous errors.
10039 //! \retval ::NVAPI_END_ENUMERATION startIndex exceeds the total appCount.
10040 //!
10041 //! \ingroup drsapi
10042 ///////////////////////////////////////////////////////////////////////////////
10043 NVAPI_INTERFACE NvAPI_DRS_EnumSettings(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 startIndex, NvU32 *settingsCount, NVDRS_SETTING *pSetting);
10044 
10045 ///////////////////////////////////////////////////////////////////////////////
10046 //
10047 // FUNCTION NAME: NvAPI_DRS_EnumAvailableSettingIds
10048 //
10049 //!   DESCRIPTION: This API enumerates all the Ids of all the settings recognized by NVAPI.
10050 //!
10051 //! SUPPORTED OS:  Windows XP and higher
10052 //!
10053 //!
10054 //! \param [out]    pSettingIds     User-provided array of length *pMaxCount that NVAPI will fill with IDs.
10055 //! \param [in,out] pMaxCount       Input max length of the passed in array, Returns the actual length.
10056 //!
10057 //! \retval ::NVAPI_OK     SUCCESS
10058 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
10059 //!                  NVAPI_END_ENUMERATION: the provided pMaxCount is not enough to hold all settingIds.
10060 //!
10061 //! \ingroup drsapi
10062 ///////////////////////////////////////////////////////////////////////////////
10063 NVAPI_INTERFACE NvAPI_DRS_EnumAvailableSettingIds(NvU32 *pSettingIds, NvU32 *pMaxCount);
10064 
10065 ///////////////////////////////////////////////////////////////////////////////
10066 //
10067 // FUNCTION NAME: NvAPI_DRS_EnumAvailableSettingValues
10068 //
10069 //!   DESCRIPTION: This API enumerates all available setting values for a given setting.
10070 //!
10071 //! SUPPORTED OS:  Windows XP and higher
10072 //!
10073 //!
10074 //! \param [in]      settingId          Input settingId.
10075 //! \param [in,out]  maxNumCount        Input max length of the passed in arrays, Returns the actual length.
10076 //! \param [out]     *pSettingValues    Returns all available setting values and its count.
10077 //!
10078 //! \retval ::NVAPI_OK     SUCCESS
10079 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
10080 //!
10081 //! \ingroup drsapi
10082 ///////////////////////////////////////////////////////////////////////////////
10083 NVAPI_INTERFACE NvAPI_DRS_EnumAvailableSettingValues(NvU32 settingId, NvU32 *pMaxNumValues, NVDRS_SETTING_VALUES *pSettingValues);
10084 
10085 ///////////////////////////////////////////////////////////////////////////////
10086 //
10087 // FUNCTION NAME: NvAPI_DRS_GetSettingIdFromName
10088 //
10089 //!   DESCRIPTION: This API gets the binary ID of a setting given the setting name.
10090 //!
10091 //! SUPPORTED OS:  Windows XP and higher
10092 //!
10093 //!
10094 //! \param [in]   settingName  Input Unicode settingName.
10095 //! \param [out]  *pSettingId  Returns corresponding settingId.
10096 //!
10097 //! \retval ::NVAPI_OK                 SUCCESS if the profile is found
10098 //! \retval ::NVAPI_PROFILE_NOT_FOUND  if profile is not found
10099 //! \retval ::NVAPI_SETTING_NOT_FOUND  if setting is not found
10100 //! \retval ::NVAPI_ERROR              For miscellaneous errors.
10101 //!
10102 //! \ingroup drsapi
10103 ///////////////////////////////////////////////////////////////////////////////
10104 NVAPI_INTERFACE NvAPI_DRS_GetSettingIdFromName(NvAPI_UnicodeString settingName, NvU32 *pSettingId);
10105 
10106 ///////////////////////////////////////////////////////////////////////////////
10107 //
10108 // FUNCTION NAME: NvAPI_DRS_GetSettingNameFromId
10109 //
10110 //!   DESCRIPTION: This API gets the setting name given the binary ID.
10111 //!
10112 //! SUPPORTED OS:  Windows XP and higher
10113 //!
10114 //!
10115 //! \param [in]  settingId        Input settingId.
10116 //! \param [in]  *pSettingName    Returns corresponding Unicode settingName.
10117 //!
10118 //! \retval ::NVAPI_OK                 SUCCESS if the profile is found
10119 //! \retval ::NVAPI_PROFILE_NOT_FOUND  if profile is not found
10120 //! \retval ::NVAPI_SETTING_NOT_FOUND  if setting is not found
10121 //! \retval ::NVAPI_ERROR              For miscellaneous errors.
10122 //!
10123 //! \ingroup drsapi
10124 ///////////////////////////////////////////////////////////////////////////////
10125 NVAPI_INTERFACE NvAPI_DRS_GetSettingNameFromId(NvU32 settingId, NvAPI_UnicodeString *pSettingName);
10126 
10127 ///////////////////////////////////////////////////////////////////////////////
10128 //
10129 // FUNCTION NAME: NvAPI_DRS_DeleteProfileSetting
10130 //
10131 //!   DESCRIPTION: This API deletes a setting or sets it back to predefined value.
10132 //!
10133 //! SUPPORTED OS:  Windows XP and higher
10134 //!
10135 //!
10136 //! \param [in]  hSession            Input to the session handle.
10137 //! \param [in]  hProfile            Input profile handle.
10138 //! \param [in]  settingId           Input settingId to be deleted.
10139 //!
10140 //! \retval ::NVAPI_OK     SUCCESS if the profile is found
10141 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
10142 //!
10143 //! \ingroup drsapi
10144 ///////////////////////////////////////////////////////////////////////////////
10145 NVAPI_INTERFACE NvAPI_DRS_DeleteProfileSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId);
10146 
10147 ///////////////////////////////////////////////////////////////////////////////
10148 //
10149 // FUNCTION NAME: NvAPI_DRS_RestoreAllDefaults
10150 //
10151 //!   DESCRIPTION: This API restores the whole system to predefined(default) values.
10152 //!
10153 //! SUPPORTED OS:  Windows XP and higher
10154 //!
10155 //!
10156 //! \param [in]  hSession  Input to the session handle.
10157 //!
10158 //! \retval ::NVAPI_OK     SUCCESS if the profile is found
10159 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
10160 //!
10161 //! \ingroup drsapi
10162 ///////////////////////////////////////////////////////////////////////////////
10163 NVAPI_INTERFACE NvAPI_DRS_RestoreAllDefaults(NvDRSSessionHandle hSession);
10164 
10165 ///////////////////////////////////////////////////////////////////////////////
10166 //
10167 // FUNCTION NAME: NvAPI_DRS_RestoreProfileDefault
10168 //
10169 //!   DESCRIPTION: This API restores the given profile to predefined(default) values.
10170 //!                Any and all user specified modifications will be removed.
10171 //!                If the whole profile was set by the user, the profile will be removed.
10172 //!
10173 //! SUPPORTED OS:  Windows XP and higher
10174 //!
10175 //!
10176 //! \param [in]  hSession  Input to the session handle.
10177 //! \param [in]  hProfile  Input profile handle.
10178 //!
10179 //! \retval ::NVAPI_OK              SUCCESS if the profile is found
10180 //! \retval ::NVAPI_ERROR           For miscellaneous errors.
10181 //! \retval ::NVAPI_PROFILE_REMOVED SUCCESS, and the hProfile is no longer valid.
10182 //! \retval ::NVAPI_ERROR           For miscellaneous errors.
10183 //!
10184 //! \ingroup drsapi
10185 ///////////////////////////////////////////////////////////////////////////////
10186 NVAPI_INTERFACE NvAPI_DRS_RestoreProfileDefault(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile);
10187 
10188 ///////////////////////////////////////////////////////////////////////////////
10189 //
10190 // FUNCTION NAME: NvAPI_DRS_RestoreProfileDefaultSetting
10191 //
10192 //!   DESCRIPTION: This API restores the given profile setting to predefined(default) values.
10193 //!
10194 //! SUPPORTED OS:  Windows XP and higher
10195 //!
10196 //!
10197 //! \param [in]  hSession  Input to the session handle.
10198 //! \param [in]  hProfile  Input profile handle.
10199 //! \param [in]  settingId Input settingId.
10200 //!
10201 //! \retval ::NVAPI_OK     SUCCESS if the profile is found
10202 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
10203 //!
10204 //! \ingroup drsapi
10205 ///////////////////////////////////////////////////////////////////////////////
10206 NVAPI_INTERFACE NvAPI_DRS_RestoreProfileDefaultSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId);
10207 
10208 ///////////////////////////////////////////////////////////////////////////////
10209 //
10210 // FUNCTION NAME: NvAPI_DRS_GetBaseProfile
10211 //
10212 //!   DESCRIPTION: Returns the handle to the current global profile.
10213 //!
10214 //! SUPPORTED OS:  Windows XP and higher
10215 //!
10216 //!
10217 //! \param [in]  hSession    Input to the session handle.
10218 //! \param [in]  *phProfile   Returns Base profile handle.
10219 //!
10220 //! \retval ::NVAPI_OK     SUCCESS if the profile is found
10221 //! \retval ::NVAPI_ERROR  For miscellaneous errors.
10222 //!
10223 //! \ingroup drsapi
10224 ///////////////////////////////////////////////////////////////////////////////
10225 NVAPI_INTERFACE NvAPI_DRS_GetBaseProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile);
10226 
10227 
10228 
10229 
10230 //! \addtogroup sysgeneral
10231 //! @{
10232 
10233 typedef struct
10234 {
10235     NvU32               version;            //!< structure version
10236     NvU32               vendorId;           //!< Chipset vendor identification
10237     NvU32               deviceId;           //!< Chipset device identification
10238     NvAPI_ShortString   szVendorName;       //!< Chipset vendor Name
10239     NvAPI_ShortString   szChipsetName;      //!< Chipset device Name
10240     NvU32               flags;              //!< Chipset info flags - obsolete
10241     NvU32               subSysVendorId;     //!< Chipset subsystem vendor identification
10242     NvU32               subSysDeviceId;     //!< Chipset subsystem device identification
10243     NvAPI_ShortString   szSubSysVendorName; //!< subsystem vendor Name
10244     NvU32               HBvendorId;         //!< Host bridge vendor identification
10245     NvU32               HBdeviceId;         //!< Host bridge device identification
10246     NvU32               HBsubSysVendorId;   //!< Host bridge subsystem vendor identification
10247     NvU32               HBsubSysDeviceId;   //!< Host bridge subsystem device identification
10248 
10249 } NV_CHIPSET_INFO_v4;
10250 
10251 typedef struct
10252 {
10253     NvU32               version;            //!< structure version
10254     NvU32               vendorId;           //!< vendor ID
10255     NvU32               deviceId;           //!< device ID
10256     NvAPI_ShortString   szVendorName;       //!< vendor Name
10257     NvAPI_ShortString   szChipsetName;      //!< device Name
10258     NvU32               flags;              //!< Chipset info flags - obsolete
10259     NvU32               subSysVendorId;     //!< subsystem vendor ID
10260     NvU32               subSysDeviceId;     //!< subsystem device ID
10261     NvAPI_ShortString   szSubSysVendorName; //!< subsystem vendor Name
10262 } NV_CHIPSET_INFO_v3;
10263 
10264 typedef enum
10265 {
10266     NV_CHIPSET_INFO_HYBRID          = 0x00000001,
10267 } NV_CHIPSET_INFO_FLAGS;
10268 
10269 typedef struct
10270 {
10271     NvU32               version;        //!< structure version
10272     NvU32               vendorId;       //!< vendor ID
10273     NvU32               deviceId;       //!< device ID
10274     NvAPI_ShortString   szVendorName;   //!< vendor Name
10275     NvAPI_ShortString   szChipsetName;  //!< device Name
10276     NvU32               flags;          //!< Chipset info flags
10277 } NV_CHIPSET_INFO_v2;
10278 
10279 typedef struct
10280 {
10281     NvU32               version;        //structure version
10282     NvU32               vendorId;       //vendor ID
10283     NvU32               deviceId;       //device ID
10284     NvAPI_ShortString   szVendorName;   //vendor Name
10285     NvAPI_ShortString   szChipsetName;  //device Name
10286 } NV_CHIPSET_INFO_v1;
10287 
10288 #define NV_CHIPSET_INFO_VER_1  MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v1,1)
10289 #define NV_CHIPSET_INFO_VER_2   MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v2,2)
10290 #define NV_CHIPSET_INFO_VER_3   MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v3,3)
10291 #define NV_CHIPSET_INFO_VER_4   MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v4,4)
10292 
10293 #define NV_CHIPSET_INFO         NV_CHIPSET_INFO_v4
10294 #define NV_CHIPSET_INFO_VER     NV_CHIPSET_INFO_VER_4
10295 
10296 //! @}
10297 
10298 ///////////////////////////////////////////////////////////////////////////////
10299 //
10300 // FUNCTION NAME: NvAPI_SYS_GetChipSetInfo
10301 //
10302 //!  This function returns information about the system's chipset.
10303 //!
10304 //! SUPPORTED OS:  Windows XP and higher,  Mac OS X
10305 //!
10306 //!
10307 //! \since Release: 95
10308 //!
10309 //! \retval  NVAPI_INVALID_ARGUMENT              pChipSetInfo is NULL.
10310 //! \retval  NVAPI_OK                           *pChipSetInfo is now set.
10311 //! \retval  NVAPI_INCOMPATIBLE_STRUCT_VERSION   NV_CHIPSET_INFO version not compatible with driver.
10312 //! \ingroup sysgeneral
10313 ///////////////////////////////////////////////////////////////////////////////
10314 NVAPI_INTERFACE NvAPI_SYS_GetChipSetInfo(NV_CHIPSET_INFO *pChipSetInfo);
10315 
10316 
10317 //! \ingroup sysgeneral
10318 //! Lid and dock information - used in NvAPI_GetLidDockInfo()
10319 typedef struct
10320 {
10321     NvU32 version;    //! Structure version, constructed from the macro #NV_LID_DOCK_PARAMS_VER
10322     NvU32 currentLidState;
10323     NvU32 currentDockState;
10324     NvU32 currentLidPolicy;
10325     NvU32 currentDockPolicy;
10326     NvU32 forcedLidMechanismPresent;
10327     NvU32 forcedDockMechanismPresent;
10328 }NV_LID_DOCK_PARAMS;
10329 
10330 
10331 //! ingroup sysgeneral
10332 #define NV_LID_DOCK_PARAMS_VER  MAKE_NVAPI_VERSION(NV_LID_DOCK_PARAMS,1)
10333 ///////////////////////////////////////////////////////////////////////////////
10334 //
10335 // FUNCTION NAME: NvAPI_GetLidDockInfo
10336 //
10337 //! DESCRIPTION: This function returns the current lid and dock information.
10338 //!
10339 //! SUPPORTED OS:  Windows XP and higher
10340 //!
10341 //!
10342 //! \since Release: 177
10343 //!
10344 //! \retval ::NVAPI_OK
10345 //! \retval ::NVAPI_ERROR
10346 //! \retval ::NVAPI_NOT_SUPPORTED
10347 //! \retval ::NVAPI_HANDLE_INVALIDATED
10348 //! \retval ::NVAPI_API_NOT_INTIALIZED
10349 //!
10350 //! \ingroup sysgeneral
10351 ///////////////////////////////////////////////////////////////////////////////
10352 NVAPI_INTERFACE NvAPI_SYS_GetLidAndDockInfo(NV_LID_DOCK_PARAMS *pLidAndDock);
10353 
10354 
10355 
10356 
10357 ///////////////////////////////////////////////////////////////////////////////
10358 // FUNCTION NAME:   NvAPI_SYS_GetDisplayIdFromGpuAndOutputId
10359 //
10360 //! DESCRIPTION:     This API converts a Physical GPU handle and output ID to a
10361 //!                  display ID.
10362 //!
10363 //! SUPPORTED OS:  Windows XP and higher
10364 //!
10365 //!
10366 //! \param [in]     hPhysicalGpu   Handle to the physical GPU
10367 //! \param [in]     outputId       Connected display output ID on the
10368 //!                                target GPU - must only have one bit set
10369 //! \param [out]    displayId      Pointer to an NvU32 which contains
10370 //!                                 the display ID
10371 //!
10372 //! \retval  ::NVAPI_OK - completed request
10373 //! \retval  ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
10374 //! \retval  ::NVAPI_ERROR - miscellaneous error occurred
10375 //! \retval  ::NVAPI_INVALID_ARGUMENT - Invalid input parameter.
10376 //!
10377 //! \ingroup sysgeneral
10378 ///////////////////////////////////////////////////////////////////////////////
10379 NVAPI_INTERFACE NvAPI_SYS_GetDisplayIdFromGpuAndOutputId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NvU32* displayId);
10380 
10381 
10382 ///////////////////////////////////////////////////////////////////////////////
10383 // FUNCTION NAME:   NvAPI_SYS_GetGpuAndOutputIdFromDisplayId
10384 //
10385 //! DESCRIPTION:     This API converts a display ID to a Physical GPU handle and output ID.
10386 //!
10387 //! SUPPORTED OS:  Windows XP and higher
10388 //!
10389 //!
10390 //! \param [in]     displayId       Display ID of display to retrieve
10391 //!                                 GPU and outputId for
10392 //! \param [out]    hPhysicalGpu    Handle to the physical GPU
10393 //! \param [out]    outputId )      Connected display output ID on the
10394 //!                                 target GPU will only have one bit set.
10395 //!
10396 //! \retval ::NVAPI_OK
10397 //! \retval ::NVAPI_API_NOT_INTIALIZED
10398 //! \retval ::NVAPI_ID_OUT_OF_RANGE    The DisplayId corresponds to a
10399 //!                                    display which is not within the
10400 //!                                    normal outputId range.
10401 //! \retval ::NVAPI_ERROR
10402 //! \retval ::NVAPI_INVALID_ARGUMENT
10403 //!
10404 //! \ingroup sysgeneral
10405 ///////////////////////////////////////////////////////////////////////////////
10406 NVAPI_INTERFACE NvAPI_SYS_GetGpuAndOutputIdFromDisplayId(NvU32 displayId, NvPhysicalGpuHandle *hPhysicalGpu, NvU32 *outputId);
10407 
10408 
10409 ///////////////////////////////////////////////////////////////////////////////
10410 // FUNCTION NAME:   NvAPI_SYS_GetPhysicalGpuFromDisplayId
10411 //
10412 //! \code
10413 //! DESCRIPTION:     This API retrieves the Physical GPU handle of the connected display
10414 //!
10415 //! \since Release: 313
10416 //!
10417 //! SUPPORTED OS:  Windows Vista and higher
10418 //!
10419 //!
10420 //! PARAMETERS:      displayId(IN)     - Display ID of display to retrieve
10421 //!                                      GPU handle
10422 //!                  hPhysicalGpu(OUT) - Handle to the physical GPU
10423 //!
10424 //! RETURN STATUS:
10425 //!                  NVAPI_OK - completed request
10426 //!                  NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
10427 //!                  NVAPI_ERROR - miscellaneous error occurred
10428 //!                  NVAPI_INVALID_ARGUMENT - Invalid input parameter.
10429 //! \endcode
10430 //! \ingroup sysgeneral
10431 ///////////////////////////////////////////////////////////////////////////////
10432 NVAPI_INTERFACE NvAPI_SYS_GetPhysicalGpuFromDisplayId(NvU32 displayId, NvPhysicalGpuHandle *hPhysicalGpu);
10433 
10434 
10435 
10436 
10437 #ifdef __cplusplus
10438 }; //extern "C" {
10439 
10440 #endif
10441 
10442 #pragma pack(pop)
10443 
10444 #endif // _NVAPI_H
10445 
10446 #include"nvapi_lite_salend.h"
10447