spacepaste

  1.  
  2. /***************************************************************************\
  3. |* *|
  4. |* Copyright 2005-2010 NVIDIA Corporation. All rights reserved. *|
  5. |* *|
  6. |* NOTICE TO USER: *|
  7. |* *|
  8. |* This source code is subject to NVIDIA ownership rights under U.S. *|
  9. |* and international Copyright laws. Users and possessors of this *|
  10. |* source code are hereby granted a nonexclusive, royalty-free *|
  11. |* license to use this code in individual and commercial software. *|
  12. |* *|
  13. |* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE *|
  14. |* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR *|
  15. |* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH *|
  16. |* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF *|
  17. |* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR *|
  18. |* PURPOSE. IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, *|
  19. |* INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES *|
  20. |* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN *|
  21. |* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *|
  22. |* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE *|
  23. |* CODE. *|
  24. |* *|
  25. |* U.S. Government End Users. This source code is a "commercial item" *|
  26. |* as that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting *|
  27. |* of "commercial computer software" and "commercial computer software *|
  28. |* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) *|
  29. |* and is provided to the U.S. Government only as a commercial end item. *|
  30. |* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through *|
  31. |* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the *|
  32. |* source code with only those rights set forth herein. *|
  33. |* *|
  34. |* Any use of this source code in individual and commercial software must *|
  35. |* include, in the user documentation and internal comments to the code, *|
  36. |* the above Disclaimer and U.S. Government End Users Notice. *|
  37. |* *|
  38. |* *|
  39. \***************************************************************************/
  40. ///////////////////////////////////////////////////////////////////////////////
  41. //
  42. // Date: Dec 12, 2010
  43. // File: nvapi.h
  44. //
  45. // NvAPI provides an interface to NVIDIA devices. This file contains the
  46. // interface constants, structure definitions and function prototypes.
  47. //
  48. // Target Profile: developer
  49. // Target Platform: windows
  50. //
  51. ///////////////////////////////////////////////////////////////////////////////
  52. #ifndef _NVAPI_H
  53. #define _NVAPI_H
  54. #pragma pack(push,8) // Make sure we have consistent structure packings
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58. // ====================================================
  59. // Universal NvAPI Definitions
  60. // ====================================================
  61. #ifndef _WIN32
  62. #define __cdecl
  63. #endif
  64. #define NVAPI_INTERFACE extern NvAPI_Status __cdecl
  65. /* 64-bit types for compilers that support them, plus some obsolete variants */
  66. #if defined(__GNUC__) || defined(__arm) || defined(__IAR_SYSTEMS_ICC__) || defined(__ghs__) || defined(_WIN64)
  67. typedef unsigned long long NvU64; /* 0 to 18446744073709551615 */
  68. #else
  69. typedef unsigned __int64 NvU64; /* 0 to 18446744073709551615 */
  70. #endif
  71. // mac os 32-bit still needs this
  72. #if (defined(macintosh) || defined(__APPLE__)) && !defined(__LP64__)
  73. typedef signed long NvS32; /* -2147483648 to 2147483647 */
  74. #else
  75. typedef signed int NvS32; /* -2147483648 to 2147483647 */
  76. #endif
  77. // mac os 32-bit still needs this
  78. #if ( (defined(macintosh) && defined(__LP64__) && (__NVAPI_RESERVED0__)) || \
  79. (!defined(macintosh) && defined(__NVAPI_RESERVED0__)) )
  80. typedef unsigned int NvU32; /* 0 to 4294967295 */
  81. #else
  82. typedef unsigned long NvU32; /* 0 to 4294967295 */
  83. #endif
  84. typedef signed short NvS16;
  85. typedef unsigned short NvU16;
  86. typedef unsigned char NvU8;
  87. typedef struct _NV_RECT
  88. {
  89. NvU32 left;
  90. NvU32 top;
  91. NvU32 right;
  92. NvU32 bottom;
  93. } NV_RECT;
  94. #define NV_DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name
  95. // NVAPI Handles - These handles are retrieved from various calls and passed in to others in NvAPI
  96. // These are meant to be opaque types. Do not assume they correspond to indices, HDCs,
  97. // display indexes or anything else.
  98. //
  99. // Most handles remain valid until a display re-configuration (display mode set) or GPU
  100. // reconfiguration (going into or out of SLI modes) occurs. If NVAPI_HANDLE_INVALIDATED
  101. // is received by an app, it should discard all handles, and re-enumerate them.
  102. //
  103. NV_DECLARE_HANDLE(NvDisplayHandle); // Display Device driven by NVIDIA GPU(s) (an attached display)
  104. NV_DECLARE_HANDLE(NvUnAttachedDisplayHandle); // Unattached Display Device driven by NVIDIA GPU(s)
  105. NV_DECLARE_HANDLE(NvLogicalGpuHandle); // One or more physical GPUs acting in concert (SLI)
  106. NV_DECLARE_HANDLE(NvPhysicalGpuHandle); // A single physical GPU
  107. NV_DECLARE_HANDLE(NvEventHandle); // A handle to an event registration instance
  108. NV_DECLARE_HANDLE(NvVisualComputingDeviceHandle); // A handle to Visual Computing Device
  109. NV_DECLARE_HANDLE(NvHICHandle); // A handle to a Host Interface Card
  110. NV_DECLARE_HANDLE(NvGSyncDeviceHandle); // A handle to a GSync device
  111. NV_DECLARE_HANDLE(NvVioHandle); // A handle to a SDI device
  112. NV_DECLARE_HANDLE(NvTransitionHandle); // A handle to address a single transition request
  113. NV_DECLARE_HANDLE(NvAudioHandle); // NVIDIA HD Audio Device
  114. NV_DECLARE_HANDLE(Nv3DVPContextHandle); // A handle for a 3D Vision Pro (3DVP) context
  115. NV_DECLARE_HANDLE(Nv3DVPTransceiverHandle); // A handle for a 3DVP RF transceiver
  116. NV_DECLARE_HANDLE(Nv3DVPGlassesHandle); // A handle for a pair of 3DVP RF shutter glasses
  117. typedef void* StereoHandle;
  118. NV_DECLARE_HANDLE(NvSourceHandle); // Unique source handle on the system
  119. NV_DECLARE_HANDLE(NvTargetHandle); // Unique target handle on the system
  120. #define NVAPI_DEFAULT_HANDLE 0
  121. #define NV_BIT(x) (1 << (x))
  122. #define NVAPI_GENERIC_STRING_MAX 4096
  123. #define NVAPI_LONG_STRING_MAX 256
  124. #define NVAPI_SHORT_STRING_MAX 64
  125. typedef struct
  126. {
  127. NvS32 sX;
  128. NvS32 sY;
  129. NvS32 sWidth;
  130. NvS32 sHeight;
  131. } NvSBox;
  132. typedef struct
  133. {
  134. NvU32 data1;
  135. NvU16 data2;
  136. NvU16 data3;
  137. NvU8 data4[8];
  138. } NvGUID, NvLUID;
  139. #define NVAPI_MAX_PHYSICAL_GPUS 64
  140. #define NVAPI_PHYSICAL_GPUS 32
  141. #define NVAPI_MAX_LOGICAL_GPUS 64
  142. #define NVAPI_MAX_AVAILABLE_GPU_TOPOLOGIES 256
  143. #define NVAPI_MAX_AVAILABLE_SLI_GROUPS 256
  144. #define NVAPI_MAX_GPU_TOPOLOGIES NVAPI_MAX_PHYSICAL_GPUS
  145. #define NVAPI_MAX_GPU_PER_TOPOLOGY 8
  146. #define NVAPI_MAX_DISPLAY_HEADS 2
  147. #define NVAPI_ADVANCED_DISPLAY_HEADS 4
  148. #define NVAPI_MAX_DISPLAYS NVAPI_PHYSICAL_GPUS * NVAPI_ADVANCED_DISPLAY_HEADS
  149. #define NVAPI_MAX_ACPI_IDS 16
  150. #define NVAPI_MAX_VIEW_MODES 8
  151. #define NV_MAX_HEADS 4 // Maximum heads, each with NVAPI_DESKTOP_RES resolution
  152. #define NVAPI_MAX_HEADS_PER_GPU 32
  153. #define NV_MAX_HEADS 4 // Maximum heads, each with NVAPI_DESKTOP_RES resolution
  154. #define NV_MAX_VID_STREAMS 4 // Maximum input video streams, each with a NVAPI_VIDEO_SRC_INFO
  155. #define NV_MAX_VID_PROFILES 4 // Maximum output video profiles supported
  156. #define NVAPI_SYSTEM_MAX_DISPLAYS NVAPI_MAX_PHYSICAL_GPUS * NV_MAX_HEADS
  157. #define NVAPI_SYSTEM_MAX_HWBCS 128
  158. #define NVAPI_SYSTEM_HWBC_INVALID_ID 0xffffffff
  159. #define NVAPI_MAX_AUDIO_DEVICES 16
  160. typedef char NvAPI_String[NVAPI_GENERIC_STRING_MAX];
  161. typedef char NvAPI_LongString[NVAPI_LONG_STRING_MAX];
  162. typedef char NvAPI_ShortString[NVAPI_SHORT_STRING_MAX];
  163. // =========================================================================================
  164. // NvAPI Version Definition
  165. // Maintain per structure specific version define using the MAKE_NVAPI_VERSION macro.
  166. // Usage: #define NV_GENLOCK_STATUS_VER MAKE_NVAPI_VERSION(NV_GENLOCK_STATUS, 1)
  167. // =========================================================================================
  168. #define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16))
  169. #define GET_NVAPI_VERSION(ver) (NvU32)((ver)>>16)
  170. #define GET_NVAPI_SIZE(ver) (NvU32)((ver) & 0xffff)
  171. // ====================================================
  172. // NvAPI Status Values
  173. // All NvAPI functions return one of these codes.
  174. // ====================================================
  175. typedef enum
  176. {
  177. NVAPI_OK = 0, // Success
  178. NVAPI_ERROR = -1, // Generic error
  179. NVAPI_LIBRARY_NOT_FOUND = -2, // nvapi.dll can not be loaded
  180. NVAPI_NO_IMPLEMENTATION = -3, // not implemented in current driver installation
  181. NVAPI_API_NOT_INITIALIZED = -4, // NvAPI_Initialize has not been called (successfully)
  182. NVAPI_INVALID_ARGUMENT = -5, // invalid argument
  183. NVAPI_NVIDIA_DEVICE_NOT_FOUND = -6, // no NVIDIA display driver was found
  184. NVAPI_END_ENUMERATION = -7, // no more to enum
  185. NVAPI_INVALID_HANDLE = -8, // invalid handle
  186. NVAPI_INCOMPATIBLE_STRUCT_VERSION = -9, // an argument's structure version is not supported
  187. NVAPI_HANDLE_INVALIDATED = -10, // handle is no longer valid (likely due to GPU or display re-configuration)
  188. NVAPI_OPENGL_CONTEXT_NOT_CURRENT = -11, // no NVIDIA OpenGL context is current (but needs to be)
  189. NVAPI_INVALID_POINTER = -14, // An invalid pointer, usually NULL, was passed as a parameter
  190. NVAPI_NO_GL_EXPERT = -12, // OpenGL Expert is not supported by the current drivers
  191. NVAPI_INSTRUMENTATION_DISABLED = -13, // OpenGL Expert is supported, but driver instrumentation is currently disabled
  192. NVAPI_NO_GL_NSIGHT = -15, // OpenGL does not support Nsight
  193. NVAPI_EXPECTED_LOGICAL_GPU_HANDLE = -100, // expected a logical GPU handle for one or more parameters
  194. NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE = -101, // expected a physical GPU handle for one or more parameters
  195. NVAPI_EXPECTED_DISPLAY_HANDLE = -102, // expected an NV display handle for one or more parameters
  196. NVAPI_INVALID_COMBINATION = -103, // used in some commands to indicate that the combination of parameters is not valid
  197. NVAPI_NOT_SUPPORTED = -104, // Requested feature not supported in the selected GPU
  198. NVAPI_PORTID_NOT_FOUND = -105, // NO port ID found for I2C transaction
  199. NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106, // expected an unattached display handle as one of the input param
  200. NVAPI_INVALID_PERF_LEVEL = -107, // invalid perf level
  201. NVAPI_DEVICE_BUSY = -108, // device is busy, request not fulfilled
  202. NVAPI_NV_PERSIST_FILE_NOT_FOUND = -109, // NV persist file is not found
  203. NVAPI_PERSIST_DATA_NOT_FOUND = -110, // NV persist data is not found
  204. NVAPI_EXPECTED_TV_DISPLAY = -111, // expected TV output display
  205. NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112, // expected TV output on D Connector - HDTV_EIAJ4120.
  206. NVAPI_NO_ACTIVE_SLI_TOPOLOGY = -113, // SLI is not active on this device
  207. NVAPI_SLI_RENDERING_MODE_NOTALLOWED = -114, // setup of SLI rendering mode is not possible right now
  208. NVAPI_EXPECTED_DIGITAL_FLAT_PANEL = -115, // expected digital flat panel
  209. NVAPI_ARGUMENT_EXCEED_MAX_SIZE = -116, // argument exceeds expected size
  210. NVAPI_DEVICE_SWITCHING_NOT_ALLOWED = -117, // inhibit ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI Active
  211. NVAPI_TESTING_CLOCKS_NOT_SUPPORTED = -118, // testing clocks not supported
  212. NVAPI_UNKNOWN_UNDERSCAN_CONFIG = -119, // the specified underscan config is from an unknown source (e.g. INF)
  213. NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO = -120, // timeout while reconfiguring GPUs
  214. NVAPI_DATA_NOT_FOUND = -121, // Requested data was not found
  215. NVAPI_EXPECTED_ANALOG_DISPLAY = -122, // expected analog display
  216. NVAPI_NO_VIDLINK = -123, // No SLI video bridge present
  217. NVAPI_REQUIRES_REBOOT = -124, // NVAPI requires reboot for its settings to take effect
  218. NVAPI_INVALID_HYBRID_MODE = -125, // the function is not supported with the current hybrid mode.
  219. NVAPI_MIXED_TARGET_TYPES = -126, // The target types are not all the same
  220. NVAPI_SYSWOW64_NOT_SUPPORTED = -127, // the function is not supported from 32-bit on a 64-bit system
  221. NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128, //there is any implicit GPU topo active. Use NVAPI_SetHybridMode to change topology.
  222. NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129, //Prompt the user to close all non-migratable apps.
  223. NVAPI_OUT_OF_MEMORY = -130, // Could not allocate sufficient memory to complete the call
  224. NVAPI_WAS_STILL_DRAWING = -131, // The previous operation that is transferring information to or from this surface is incomplete
  225. NVAPI_FILE_NOT_FOUND = -132, // The file was not found
  226. NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS = -133, // There are too many unique instances of a particular type of state object
  227. NVAPI_INVALID_CALL = -134, // The method call is invalid. For example, a method's parameter may not be a valid pointer
  228. NVAPI_D3D10_1_LIBRARY_NOT_FOUND = -135, // d3d10_1.dll can not be loaded
  229. NVAPI_FUNCTION_NOT_FOUND = -136, // Couldn't find the function in loaded dll library
  230. NVAPI_INVALID_USER_PRIVILEGE = -137, // Current User is not Admin
  231. NVAPI_EXPECTED_NON_PRIMARY_DISPLAY_HANDLE = -138, // The handle corresponds to GDIPrimary
  232. NVAPI_EXPECTED_COMPUTE_GPU_HANDLE = -139, // Setting Physx GPU requires that the GPU is compute capable
  233. NVAPI_STEREO_NOT_INITIALIZED = -140, // Stereo part of NVAPI failed to initialize completely. Check if stereo driver is installed.
  234. NVAPI_STEREO_REGISTRY_ACCESS_FAILED = -141, // Access to stereo related registry keys or values failed.
  235. NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED = -142, // Given registry profile type is not supported.
  236. NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED = -143, // Given registry value is not supported.
  237. NVAPI_STEREO_NOT_ENABLED = -144, // Stereo is not enabled and function needed it to execute completely.
  238. NVAPI_STEREO_NOT_TURNED_ON = -145, // Stereo is not turned on and function needed it to execute completely.
  239. NVAPI_STEREO_INVALID_DEVICE_INTERFACE = -146, // Invalid device interface.
  240. NVAPI_STEREO_PARAMETER_OUT_OF_RANGE = -147, // Separation percentage or JPEG image capture quality out of [0-100] range.
  241. NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED = -148, // Given frustum adjust mode is not supported.
  242. NVAPI_TOPO_NOT_POSSIBLE = -149, // The mosaic topo is not possible given the current state of HW
  243. NVAPI_MODE_CHANGE_FAILED = -150, // An attempt to do a display resolution mode change has failed
  244. NVAPI_D3D11_LIBRARY_NOT_FOUND = -151, // d3d11.dll/d3d11_beta.dll cannot be loaded.
  245. NVAPI_INVALID_ADDRESS = -152, // Address outside of valid range.
  246. NVAPI_STRING_TOO_SMALL = -153, // The pre-allocated string is too small to hold the result.
  247. NVAPI_MATCHING_DEVICE_NOT_FOUND = -154, // The input does not match any of the available devices.
  248. NVAPI_DRIVER_RUNNING = -155, // Driver is running
  249. NVAPI_DRIVER_NOTRUNNING = -156, // Driver is not running
  250. NVAPI_ERROR_DRIVER_RELOAD_REQUIRED = -157, // A driver reload is required to apply these settings
  251. NVAPI_SET_NOT_ALLOWED = -158, // Intended Setting is not allowed
  252. NVAPI_ADVANCED_DISPLAY_TOPOLOGY_REQUIRED = -159, // Information can't be returned due to "advanced display topology"
  253. NVAPI_SETTING_NOT_FOUND = -160, // Setting is not found
  254. NVAPI_SETTING_SIZE_TOO_LARGE = -161, // Setting size is too large
  255. NVAPI_TOO_MANY_SETTINGS_IN_PROFILE = -162, // There are too many settings for a profile
  256. NVAPI_PROFILE_NOT_FOUND = -163, // Profile is not found
  257. NVAPI_PROFILE_NAME_IN_USE = -164, // Profile name is duplicated
  258. NVAPI_PROFILE_NAME_EMPTY = -165, // Profile name is empty
  259. NVAPI_EXECUTABLE_NOT_FOUND = -166, // Application not found in Profile
  260. NVAPI_EXECUTABLE_ALREADY_IN_USE = -167, // Application already exists in the other profile
  261. NVAPI_DATATYPE_MISMATCH = -168, // Data Type mismatch
  262. NVAPI_PROFILE_REMOVED = -169, /// The profile passed as parameter has been removed and is no longer valid.
  263. NVAPI_UNREGISTERED_RESOURCE = -170, // An unregistered resource was passed as a parameter
  264. NVAPI_ID_OUT_OF_RANGE = -171, // The DisplayId corresponds to a display which is not within the normal outputId range
  265. NVAPI_DISPLAYCONFIG_VALIDATION_FAILED = -172, // Display topology is not valid so we can't do a mode set on this config
  266. NVAPI_DPMST_CHANGED = -173, // Display Port Multi-Stream topology has been changed
  267. NVAPI_INSUFFICIENT_BUFFER = -174, // Input buffer is insufficient to hold the contents
  268. NVAPI_ACCESS_DENIED = -175, // No access to the caller.
  269. NVAPI_MOSAIC_NOT_ACTIVE = -176, // The requested action cannot be performed without Mosaic being enabled
  270. NVAPI_SHARE_RESOURCE_RELOCATED = -177, // The surface is relocated away from vidmem
  271. } NvAPI_Status;
  272. #define NVAPI_API_NOT_INTIALIZED NVAPI_API_NOT_INITIALIZED // Fix typo in error code
  273. #define NVAPI_INVALID_USER_PRIVILEDGE NVAPI_INVALID_USER_PRIVILEGE // Fix typo in error code
  274. ///////////////////////////////////////////////////////////////////////////////
  275. //
  276. // FUNCTION NAME: NvAPI_Initialize
  277. //
  278. // DESCRIPTION: Initializes NVAPI library. This must be called before any
  279. // other NvAPI_ function.
  280. //
  281. // SUPPORTED OS: Mac OS X, Windows XP and higher
  282. //
  283. // RETURN STATUS: NVAPI_ERROR Something is wrong during the initialization process (generic error)
  284. // NVAPI_LIBRARYNOTFOUND Can not load nvapi.dll
  285. // NVAPI_OK Initialized
  286. //
  287. ///////////////////////////////////////////////////////////////////////////////
  288. NVAPI_INTERFACE NvAPI_Initialize();
  289. ///////////////////////////////////////////////////////////////////////////////
  290. //
  291. // FUNCTION NAME: NvAPI_Unload
  292. //
  293. // DESCRIPTION: Unloads NVAPI library. This must be the last function called.
  294. //
  295. // SUPPORTED OS: Mac OS X, Windows XP and higher
  296. //
  297. // !! This is not thread safe. In a multithreaded environment, calling NvAPI_Unload !!
  298. // !! while another thread is executing another NvAPI_XXX function, results in !!
  299. // !! undefined behaviour and might even cause the application to crash. Developers !!
  300. // !! must make sure that they are not in any other function before calling NvAPI_Unload. !!
  301. //
  302. //
  303. // Unloading NvAPI library is not supported when the library is in a resource locked state.
  304. // Some functions in the NvAPI library initiates an operation or allocates certain resources
  305. // and there are corresponding functions available, to complete the operation or free the
  306. // allocated resources. All such function pairs are designed to prevent unloading NvAPI library.
  307. //
  308. // For example, if NvAPI_Unload is called after NvAPI_XXX which locks a resource, it fails with
  309. // NVAPI_ERROR. Developers need to call the corresponding NvAPI_YYY to unlock the resources,
  310. // before calling NvAPI_Unload again.
  311. //
  312. //
  313. // RETURN STATUS: NVAPI_ERROR One or more resources are locked and hence cannot unload NVAPI library
  314. // NVAPI_OK NVAPI library unloaded
  315. //
  316. ///////////////////////////////////////////////////////////////////////////////
  317. NVAPI_INTERFACE NvAPI_Unload();
  318. ///////////////////////////////////////////////////////////////////////////////
  319. //
  320. // FUNCTION NAME: NvAPI_GetErrorMessage
  321. //
  322. // DESCRIPTION: converts an NvAPI error code into a null terminated string
  323. //
  324. // SUPPORTED OS: Mac OS X, Windows XP and higher
  325. //
  326. // RETURN STATUS: null terminated string (always, never NULL)
  327. //
  328. ///////////////////////////////////////////////////////////////////////////////
  329. NVAPI_INTERFACE NvAPI_GetErrorMessage(NvAPI_Status nr,NvAPI_ShortString szDesc);
  330. ///////////////////////////////////////////////////////////////////////////////
  331. //
  332. // FUNCTION NAME: NvAPI_GetInterfaceVersionString
  333. //
  334. // DESCRIPTION: Returns a string describing the version of the NvAPI library.
  335. // Contents of the string are human readable. Do not assume a fixed
  336. // format.
  337. //
  338. // SUPPORTED OS: Mac OS X, Windows XP and higher
  339. //
  340. // RETURN STATUS: User readable string giving info on NvAPI's version
  341. //
  342. ///////////////////////////////////////////////////////////////////////////////
  343. NVAPI_INTERFACE NvAPI_GetInterfaceVersionString(NvAPI_ShortString szDesc);
  344. ///////////////////////////////////////////////////////////////////////////////
  345. //
  346. // FUNCTION NAME: NvAPI_GetDisplayDriverVersion
  347. //
  348. // DESCRIPTION: Returns a struct that describes aspects of the display driver
  349. // build.
  350. //
  351. // SUPPORTED OS: Mac OS X, Windows XP and higher
  352. //
  353. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  354. //
  355. ///////////////////////////////////////////////////////////////////////////////
  356. typedef struct
  357. {
  358. NvU32 version; // Structure version
  359. NvU32 drvVersion;
  360. NvU32 bldChangeListNum;
  361. NvAPI_ShortString szBuildBranchString;
  362. NvAPI_ShortString szAdapterString;
  363. } NV_DISPLAY_DRIVER_VERSION;
  364. #define NV_DISPLAY_DRIVER_VERSION_VER MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_VERSION,1)
  365. NVAPI_INTERFACE NvAPI_GetDisplayDriverVersion(NvDisplayHandle hNvDisplay, NV_DISPLAY_DRIVER_VERSION *pVersion);
  366. ///////////////////////////////////////////////////////////////////////////////
  367. //
  368. // FUNCTION NAME: NvAPI_SYS_GetDriverAndBranchVersion
  369. //
  370. // DESCRIPTION: Returns display driver version and driver-branch string.
  371. //
  372. // PARAMETERS: pDriverVersion(OUT) - contains driver-version after successful return
  373. // szBuildBranchString(OUT) - contains driver-branch string after successful return
  374. // SUPPORTED OS: Windows XP and higher
  375. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either pDriverVersion is NULL or enum index too big
  376. // NVAPI_OK - completed request
  377. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
  378. // NVAPI_ERROR - miscellaneous error occurred
  379. ///////////////////////////////////////////////////////////////////////////////
  380. NVAPI_INTERFACE NvAPI_SYS_GetDriverAndBranchVersion(NvU32* pDriverVersion, NvAPI_ShortString szBuildBranchString);
  381. ///////////////////////////////////////////////////////////////////////////////
  382. //
  383. // FUNCTION NAME: NvAPI_EnumNvidiaDisplayHandle
  384. //
  385. // DESCRIPTION: Returns the handle of the NVIDIA display specified by the enum
  386. // index (thisEnum). The client should keep enumerating until it
  387. // returns NVAPI_END_ENUMERATION.
  388. //
  389. // Note: Display handles can get invalidated on a modeset, so the calling applications need to
  390. // renum the handles after every modeset.
  391. //
  392. // SUPPORTED OS: Windows XP and higher
  393. //
  394. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either the handle pointer is NULL or enum index too big
  395. // NVAPI_OK: return a valid NvDisplayHandle based on the enum index
  396. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device found in the system
  397. // NVAPI_END_ENUMERATION: no more display device to enumerate.
  398. //
  399. ///////////////////////////////////////////////////////////////////////////////
  400. NVAPI_INTERFACE NvAPI_EnumNvidiaDisplayHandle(NvU32 thisEnum, NvDisplayHandle *pNvDispHandle);
  401. ///////////////////////////////////////////////////////////////////////////////
  402. //
  403. // FUNCTION NAME: NvAPI_EnumNvidiaUnAttachedDisplayHandle
  404. //
  405. // DESCRIPTION: Returns the handle of the NVIDIA UnAttached display specified by the enum
  406. // index (thisEnum). The client should keep enumerating till it
  407. // return error.
  408. //
  409. // Note: Display handles can get invalidated on a modeset, so the calling applications need to
  410. // renum the handles after every modeset.
  411. //
  412. // SUPPORTED OS: Windows XP and higher
  413. //
  414. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either the handle pointer is NULL or enum index too big
  415. // NVAPI_OK: return a valid NvDisplayHandle based on the enum index
  416. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device found in the system
  417. // NVAPI_END_ENUMERATION: no more display device to enumerate.
  418. //
  419. ///////////////////////////////////////////////////////////////////////////////
  420. NVAPI_INTERFACE NvAPI_EnumNvidiaUnAttachedDisplayHandle(NvU32 thisEnum, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle);
  421. ///////////////////////////////////////////////////////////////////////////////
  422. //
  423. // FUNCTION NAME: NvAPI_EnumPhysicalGPUs
  424. //
  425. // DESCRIPTION: Returns an array of physical GPU handles.
  426. //
  427. // Each handle represents a physical GPU present in the system.
  428. // That GPU may be part of a SLI configuration, or not be visible to the OS directly.
  429. //
  430. // At least 1 GPU must be present in the system and running an NV display driver.
  431. //
  432. // The array nvGPUHandle will be filled with physical GPU handle values. The returned
  433. // gpuCount determines how many entries in the array are valid.
  434. //
  435. // Note: In drivers older than 105.00, all physical GPU handles get invalidated on a modeset. So the calling applications
  436. // need to renum the handles after every modeset.
  437. // With drivers 105.00 and up all physical GPU handles are constant.
  438. // Physical GPU handles are constant as long as the GPUs are not physically moved and the SBIOS VGA order is unchanged.
  439. //
  440. // SUPPORTED OS: Mac OS X, Windows XP and higher
  441. //
  442. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: nvGPUHandle or pGpuCount is NULL
  443. // NVAPI_OK: one or more handles were returned
  444. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  445. //
  446. ///////////////////////////////////////////////////////////////////////////////
  447. NVAPI_INTERFACE NvAPI_EnumPhysicalGPUs(NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
  448. ///////////////////////////////////////////////////////////////////////////////
  449. //
  450. // FUNCTION NAME: NvAPI_EnumLogicalGPUs
  451. //
  452. // DESCRIPTION: Returns an array of logical GPU handles.
  453. //
  454. // Each handle represents one or more GPUs acting in concert as a single graphics device.
  455. //
  456. // At least 1 GPU must be present in the system and running an NV display driver.
  457. //
  458. // The array nvGPUHandle will be filled with logical GPU handle values. The returned
  459. // gpuCount determines how many entries in the array are valid.
  460. //
  461. // Note: All logical GPUs handles get invalidated on a GPU topology change, so the calling application is required to
  462. // renum the logical GPU handles to get latest physical handle mapping after every GPU topology change activated
  463. // by a call to NvAPI_SetGpuTopologies.
  464. //
  465. // To detect if SLI rendering is enabled please use NvAPI_D3D_GetCurrentSLIState
  466. //
  467. // SUPPORTED OS: Mac OS X, Windows XP and higher
  468. //
  469. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: nvGPUHandle or pGpuCount is NULL
  470. // NVAPI_OK: one or more handles were returned
  471. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  472. //
  473. ///////////////////////////////////////////////////////////////////////////////
  474. NVAPI_INTERFACE NvAPI_EnumLogicalGPUs(NvLogicalGpuHandle nvGPUHandle[NVAPI_MAX_LOGICAL_GPUS], NvU32 *pGpuCount);
  475. ///////////////////////////////////////////////////////////////////////////////
  476. //
  477. // FUNCTION NAME: NvAPI_GetPhysicalGPUsFromDisplay
  478. //
  479. // DESCRIPTION: Returns an array of physical GPU handles associated with the specified display.
  480. //
  481. // At least 1 GPU must be present in the system and running an NV display driver.
  482. //
  483. // The array nvGPUHandle will be filled with physical GPU handle values. The returned
  484. // gpuCount determines how many entries in the array are valid.
  485. //
  486. // If the display corresponds to more than one physical GPU, the first GPU returned
  487. // is the one with the attached active output.
  488. //
  489. // SUPPORTED OS: Windows XP and higher
  490. //
  491. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvDisp is not valid; nvGPUHandle or pGpuCount is NULL
  492. // NVAPI_OK: one or more handles were returned
  493. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  494. //
  495. ///////////////////////////////////////////////////////////////////////////////
  496. NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromDisplay(NvDisplayHandle hNvDisp, NvPhysicalGpuHandle nvGPUHandle[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
  497. ///////////////////////////////////////////////////////////////////////////////
  498. //
  499. // FUNCTION NAME: NvAPI_GetPhysicalGPUFromUnAttachedDisplay
  500. //
  501. // DESCRIPTION: Returns a physical source GPU handle associated with the specified unattached display.
  502. // The source GPU is a physical render GPU which renders the frame buffer but may or may not drive the scan out.
  503. //
  504. // At least 1 GPU must be present in the system and running an NV display driver.
  505. //
  506. // SUPPORTED OS: Windows XP and higher
  507. //
  508. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvUnAttachedDisp is not valid or pPhysicalGpu is NULL.
  509. // NVAPI_OK: one or more handles were returned
  510. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  511. //
  512. ///////////////////////////////////////////////////////////////////////////////
  513. NVAPI_INTERFACE NvAPI_GetPhysicalGPUFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvPhysicalGpuHandle *pPhysicalGpu);
  514. ///////////////////////////////////////////////////////////////////////////////
  515. //
  516. // FUNCTION NAME: NvAPI_CreateDisplayFromUnAttachedDisplay
  517. //
  518. // DESCRIPTION: The unattached display handle is converted to a active attached display handle.
  519. //
  520. // At least 1 GPU must be present in the system and running an NV display driver.
  521. //
  522. // SUPPORTED OS: Windows XP and higher
  523. //
  524. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvUnAttachedDisp is not valid or pNvDisplay is NULL.
  525. // NVAPI_OK: one or more handles were returned
  526. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  527. //
  528. ///////////////////////////////////////////////////////////////////////////////
  529. NVAPI_INTERFACE NvAPI_CreateDisplayFromUnAttachedDisplay(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvDisplayHandle *pNvDisplay);
  530. ///////////////////////////////////////////////////////////////////////////////
  531. //
  532. // FUNCTION NAME: NvAPI_GetLogicalGPUFromDisplay
  533. //
  534. // DESCRIPTION: Returns the logical GPU handle associated with the specified display.
  535. //
  536. // At least 1 GPU must be present in the system and running an NV display driver.
  537. //
  538. // SUPPORTED OS: Windows XP and higher
  539. //
  540. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvDisp is not valid; pLogicalGPU is NULL
  541. // NVAPI_OK: one or more handles were returned
  542. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  543. //
  544. ///////////////////////////////////////////////////////////////////////////////
  545. NVAPI_INTERFACE NvAPI_GetLogicalGPUFromDisplay(NvDisplayHandle hNvDisp, NvLogicalGpuHandle *pLogicalGPU);
  546. ///////////////////////////////////////////////////////////////////////////////
  547. //
  548. // FUNCTION NAME: NvAPI_GetLogicalGPUFromPhysicalGPU
  549. //
  550. // DESCRIPTION: Returns the logical GPU handle associated with specified physical GPU handle.
  551. //
  552. // At least 1 GPU must be present in the system and running an NV display driver.
  553. //
  554. // SUPPORTED OS: Mac OS X, Windows XP and higher
  555. //
  556. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGPU is not valid; pLogicalGPU is NULL
  557. // NVAPI_OK: one or more handles were returned
  558. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  559. //
  560. ///////////////////////////////////////////////////////////////////////////////
  561. NVAPI_INTERFACE NvAPI_GetLogicalGPUFromPhysicalGPU(NvPhysicalGpuHandle hPhysicalGPU, NvLogicalGpuHandle *pLogicalGPU);
  562. ///////////////////////////////////////////////////////////////////////////////
  563. //
  564. // FUNCTION NAME: NvAPI_GetPhysicalGPUsFromLogicalGPU
  565. //
  566. // DESCRIPTION: Returns the physical GPU handles associated with the specified logical GPU handle.
  567. //
  568. // At least 1 GPU must be present in the system and running an NV display driver.
  569. //
  570. // The array hPhysicalGPU will be filled with physical GPU handle values. The returned
  571. // gpuCount determines how many entries in the array are valid.
  572. //
  573. // SUPPORTED OS: Mac OS X, Windows XP and higher
  574. //
  575. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hLogicalGPU is not valid; hPhysicalGPU is NULL
  576. // NVAPI_OK: one or more handles were returned
  577. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  578. // NVAPI_EXPECTED_LOGICAL_GPU_HANDLE: hLogicalGPU was not a logical GPU handle
  579. //
  580. ///////////////////////////////////////////////////////////////////////////////
  581. NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromLogicalGPU(NvLogicalGpuHandle hLogicalGPU,NvPhysicalGpuHandle hPhysicalGPU[NVAPI_MAX_PHYSICAL_GPUS], NvU32 *pGpuCount);
  582. ///////////////////////////////////////////////////////////////////////////////
  583. //
  584. // FUNCTION NAME: NvAPI_GetAssociatedNvidiaDisplayHandle
  585. //
  586. // DESCRIPTION: Returns the handle of the NVIDIA display that is associated
  587. // with the display name given. Eg: "\\DISPLAY1"
  588. //
  589. // SUPPORTED OS: Windows XP and higher
  590. //
  591. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either argument is NULL
  592. // NVAPI_OK: *pNvDispHandle is now valid
  593. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device maps to that display name
  594. //
  595. ///////////////////////////////////////////////////////////////////////////////
  596. NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayHandle(const char *szDisplayName, NvDisplayHandle *pNvDispHandle);
  597. ///////////////////////////////////////////////////////////////////////////////
  598. //
  599. // FUNCTION NAME: NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle
  600. //
  601. // DESCRIPTION: Returns the handle of an unattached NVIDIA display that is
  602. // associated with the display name given. Eg: "\\DISPLAY1"
  603. //
  604. // SUPPORTED OS: Windows XP and higher
  605. //
  606. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either argument is NULL
  607. // NVAPI_OK: *pNvUnAttachedDispHandle is now valid
  608. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device maps to that display name
  609. //
  610. ///////////////////////////////////////////////////////////////////////////////
  611. NVAPI_INTERFACE NvAPI_DISP_GetAssociatedUnAttachedNvidiaDisplayHandle(const char *szDisplayName, NvUnAttachedDisplayHandle *pNvUnAttachedDispHandle);
  612. ///////////////////////////////////////////////////////////////////////////////
  613. //
  614. // FUNCTION NAME: NvAPI_GetAssociatedNvidiaDisplayName
  615. //
  616. // DESCRIPTION: Returns the display name given. Eg: "\\DISPLAY1" using the NVIDIA display handle
  617. //
  618. // SUPPORTED OS: Windows XP and higher
  619. //
  620. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either argument is NULL
  621. // NVAPI_OK: *pNvDispHandle is now valid
  622. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device maps to that display name
  623. //
  624. ///////////////////////////////////////////////////////////////////////////////
  625. NVAPI_INTERFACE NvAPI_GetAssociatedNvidiaDisplayName(NvDisplayHandle NvDispHandle, NvAPI_ShortString szDisplayName);
  626. ///////////////////////////////////////////////////////////////////////////////
  627. //
  628. // FUNCTION NAME: NvAPI_GetUnAttachedAssociatedDisplayName
  629. //
  630. // DESCRIPTION: Returns the display name given. Eg: "\\DISPLAY1" using the NVIDIA unattached display handle
  631. //
  632. // SUPPORTED OS: Windows XP and higher
  633. //
  634. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either argument is NULL
  635. // NVAPI_OK: *pNvDispHandle is now valid
  636. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device maps to that display name
  637. //
  638. ///////////////////////////////////////////////////////////////////////////////
  639. NVAPI_INTERFACE NvAPI_GetUnAttachedAssociatedDisplayName(NvUnAttachedDisplayHandle hNvUnAttachedDisp, NvAPI_ShortString szDisplayName);
  640. ///////////////////////////////////////////////////////////////////////////////
  641. //
  642. // FUNCTION NAME: NvAPI_EnableHWCursor
  643. //
  644. // DESCRIPTION: Enable hardware cursor support
  645. //
  646. // SUPPORTED OS: Windows XP
  647. //
  648. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  649. //
  650. ///////////////////////////////////////////////////////////////////////////////
  651. NVAPI_INTERFACE NvAPI_EnableHWCursor(NvDisplayHandle hNvDisplay);
  652. ///////////////////////////////////////////////////////////////////////////////
  653. //
  654. // FUNCTION NAME: NvAPI_DisableHWCursor
  655. //
  656. // DESCRIPTION: Disable hardware cursor support
  657. //
  658. // SUPPORTED OS: Windows XP and higher
  659. //
  660. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  661. //
  662. ///////////////////////////////////////////////////////////////////////////////
  663. NVAPI_INTERFACE NvAPI_DisableHWCursor(NvDisplayHandle hNvDisplay);
  664. ///////////////////////////////////////////////////////////////////////////////
  665. //
  666. // FUNCTION NAME: NvAPI_GetVBlankCounter
  667. //
  668. // DESCRIPTION: get vblank counter
  669. //
  670. // SUPPORTED OS: Windows XP and higher
  671. //
  672. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  673. //
  674. ///////////////////////////////////////////////////////////////////////////////
  675. NVAPI_INTERFACE NvAPI_GetVBlankCounter(NvDisplayHandle hNvDisplay, NvU32 *pCounter);
  676. ///////////////////////////////////////////////////////////////////////////////
  677. // FUNCTION NAME: NvAPI_SetRefreshRateOverride
  678. // DESCRIPTION: Override the refresh rate on the given display/outputsMask.
  679. // The new refresh rate can be applied right away in this API call or deferred to happen with the
  680. // next OS modeset. The override is only good for one modeset (doesn't matter it's deferred or immediate).
  681. //
  682. // SUPPORTED OS: Windows XP
  683. //
  684. //
  685. // INPUT: hNvDisplay - the NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle
  686. // enumerated from NvAPI_EnumNVidiaDisplayHandle().
  687. //
  688. // outputsMask - a set of bits that identify all target outputs which are associated with the NVIDIA
  689. // display handle to apply the refresh rate override. Note when SLI is enabled, the
  690. // outputsMask only applies to the GPU that is driving the display output.
  691. //
  692. // refreshRate - the override value. "0.0" means cancel the override.
  693. //
  694. //
  695. // bSetDeferred - "0": apply the refresh rate override immediately in this API call.
  696. // "1": apply refresh rate at the next OS modeset.
  697. //
  698. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvDisplay or outputsMask is invalid
  699. // NVAPI_OK: the refresh rate override is correct set
  700. // NVAPI_ERROR: the operation failed
  701. //
  702. ///////////////////////////////////////////////////////////////////////////////
  703. NVAPI_INTERFACE NvAPI_SetRefreshRateOverride(NvDisplayHandle hNvDisplay, NvU32 outputsMask, float refreshRate, NvU32 bSetDeferred);
  704. ///////////////////////////////////////////////////////////////////////////////
  705. //
  706. // FUNCTION NAME: NvAPI_GetAssociatedDisplayOutputId
  707. //
  708. // DESCRIPTION: Gets the active outputId associated with the display handle.
  709. //
  710. // SUPPORTED OS: Windows XP and higher
  711. //
  712. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  713. // outputId(OUT) - The active display output id associated with the selected display handle hNvDisplay.
  714. // The outputid will have only one bit set. In case of clone or span this will indicate the display
  715. // outputId of the primary display that the GPU is driving.
  716. // RETURN STATUS: NVAPI_OK: call successful.
  717. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found.
  718. // NVAPI_EXPECTED_DISPLAY_HANDLE: hNvDisplay is not a valid display handle.
  719. //
  720. ///////////////////////////////////////////////////////////////////////////////
  721. NVAPI_INTERFACE NvAPI_GetAssociatedDisplayOutputId(NvDisplayHandle hNvDisplay, NvU32 *pOutputId);
  722. ///////////////////////////////////////////////////////////////////////////////
  723. // FUNCTION NAME: NvAPI_GetDisplayPortInfo
  724. //
  725. // DESCRIPTION: This API returns the current DP related into on the specified device(monitor)
  726. //
  727. // SUPPORTED OS: Windows XP and higher
  728. //
  729. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  730. // outputId(IN) - The display output id. If it's "0" then the default outputId from NvAPI_GetAssociatedDisplayOutputId() will be used.
  731. // pInfo(OUT) - The display port info
  732. //
  733. // RETURN STATUS:
  734. // NVAPI_OK - completed request
  735. // NVAPI_ERROR - miscellaneous error occurred
  736. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  737. //
  738. ///////////////////////////////////////////////////////////////////////////////
  739. typedef enum
  740. {
  741. NV_DP_1_62GBPS = 6,
  742. NV_DP_2_70GBPS = 0xA,
  743. } NV_DP_LINK_RATE;
  744. typedef enum
  745. {
  746. NV_DP_1_LANE = 1,
  747. NV_DP_2_LANE = 2,
  748. NV_DP_4_LANE = 4,
  749. } NV_DP_LANE_COUNT;
  750. typedef enum
  751. {
  752. NV_DP_COLOR_FORMAT_RGB = 0,
  753. NV_DP_COLOR_FORMAT_YCbCr422,
  754. NV_DP_COLOR_FORMAT_YCbCr444,
  755. } NV_DP_COLOR_FORMAT;
  756. typedef enum
  757. {
  758. NV_DP_COLORIMETRY_RGB = 0,
  759. NV_DP_COLORIMETRY_YCbCr_ITU601,
  760. NV_DP_COLORIMETRY_YCbCr_ITU709,
  761. } NV_DP_COLORIMETRY;
  762. typedef enum
  763. {
  764. NV_DP_DYNAMIC_RANGE_VESA = 0,
  765. NV_DP_DYNAMIC_RANGE_CEA,
  766. } NV_DP_DYNAMIC_RANGE;
  767. typedef enum
  768. {
  769. NV_DP_BPC_DEFAULT = 0,
  770. NV_DP_BPC_6,
  771. NV_DP_BPC_8,
  772. NV_DP_BPC_10,
  773. NV_DP_BPC_12,
  774. NV_DP_BPC_16,
  775. } NV_DP_BPC;
  776. typedef struct
  777. {
  778. NvU32 version; // structure version
  779. NvU32 dpcd_ver; // the DPCD version of the monitor
  780. NV_DP_LINK_RATE maxLinkRate; // the max supported link rate
  781. NV_DP_LANE_COUNT maxLaneCount; // the max supported lane count
  782. NV_DP_LINK_RATE curLinkRate; // the current link rate
  783. NV_DP_LANE_COUNT curLaneCount; // the current lane count
  784. NV_DP_COLOR_FORMAT colorFormat; // the current color format
  785. NV_DP_DYNAMIC_RANGE dynamicRange; // the dynamic range
  786. NV_DP_COLORIMETRY colorimetry; // ignored in RGB space
  787. NV_DP_BPC bpc; // the current bit-per-component;
  788. NvU32 isDp : 1; // if the monitor is driven by display port
  789. NvU32 isInternalDp : 1; // if the monitor is driven by NV Dp transmitter
  790. NvU32 isColorCtrlSupported : 1; // if the color format change is supported
  791. NvU32 is6BPCSupported : 1; // if 6 bpc is supported
  792. NvU32 is8BPCSupported : 1; // if 8 bpc is supported
  793. NvU32 is10BPCSupported : 1; // if 10 bpc is supported
  794. NvU32 is12BPCSupported : 1; // if 12 bpc is supported
  795. NvU32 is16BPCSupported : 1; // if 16 bpc is supported
  796. NvU32 isYCrCb422Supported : 1; // if YCrCb422 is supported
  797. NvU32 isYCrCb444Supported : 1; // if YCrCb444 is supported
  798. } NV_DISPLAY_PORT_INFO;
  799. #define NV_DISPLAY_PORT_INFO_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO,1)
  800. NVAPI_INTERFACE NvAPI_GetDisplayPortInfo(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_INFO *pInfo);
  801. ///////////////////////////////////////////////////////////////////////////////
  802. // FUNCTION NAME: NvAPI_SetDisplayPort
  803. //
  804. // DESCRIPTION: This API is used to setup DP related configurations.
  805. //
  806. // SUPPORTED OS: Windows XP and higher
  807. //
  808. // PARAMETERS: hNvDisplay(IN) - NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  809. // outputId(IN) - This display output ID, when it's "0" it means the default outputId generated from the return of NvAPI_GetAssociatedDisplayOutputId().
  810. // pCfg(IN) - The display port config structure. If pCfg is NULL, it means to use the driver's default value to setup.
  811. //
  812. // RETURN STATUS:
  813. // NVAPI_OK - completed request
  814. // NVAPI_ERROR - miscellaneous error occurred
  815. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  816. ///////////////////////////////////////////////////////////////////////////////
  817. typedef struct
  818. {
  819. NvU32 version; // structure version - 2 is latest
  820. NV_DP_LINK_RATE linkRate; // the link rate
  821. NV_DP_LANE_COUNT laneCount; // the lane count
  822. NV_DP_COLOR_FORMAT colorFormat; // the color format to set
  823. NV_DP_DYNAMIC_RANGE dynamicRange; // the dynamic range
  824. NV_DP_COLORIMETRY colorimetry; // ignored in RGB space
  825. NV_DP_BPC bpc; // the current bit-per-component;
  826. NvU32 isHPD : 1; // if CPL is making this call due to HPD
  827. NvU32 isSetDeferred : 1; // requires an OS modeset to finalize the setup if set
  828. NvU32 isChromaLpfOff : 1; // force the chroma low_pass_filter to be off
  829. NvU32 isDitherOff : 1; // force to turn off dither
  830. NvU32 testLinkTrain : 1; // if testing mode, skip validation
  831. NvU32 testColorChange : 1; // if testing mode, skip validation
  832. } NV_DISPLAY_PORT_CONFIG;
  833. #define NV_DISPLAY_PORT_CONFIG_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2)
  834. #define NV_DISPLAY_PORT_CONFIG_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,1)
  835. #define NV_DISPLAY_PORT_CONFIG_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2)
  836. NVAPI_INTERFACE NvAPI_SetDisplayPort(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_DISPLAY_PORT_CONFIG *pCfg);
  837. ///////////////////////////////////////////////////////////////////////////////
  838. // FUNCTION NAME: NvAPI_GetHDMISupportInfo
  839. //
  840. // DESCRIPTION: This API returns the current infoframe data on the specified device(monitor)
  841. //
  842. // SUPPORTED OS: Windows Vista and higher
  843. //
  844. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  845. // outputId(IN) - The display output id. If it's "0" then the default outputId from NvAPI_GetAssociatedDisplayOutputId() will be used.
  846. // pInfo(OUT) - The monitor and GPU's HDMI support info
  847. //
  848. // RETURN STATUS:
  849. // NVAPI_OK - completed request
  850. // NVAPI_ERROR - miscellaneous error occurred
  851. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  852. //
  853. ///////////////////////////////////////////////////////////////////////////////
  854. typedef struct
  855. {
  856. NvU32 version; // structure version
  857. NvU32 isGpuHDMICapable : 1; // if the GPU can handle HDMI
  858. NvU32 isMonUnderscanCapable : 1; // if the monitor supports underscan
  859. NvU32 isMonBasicAudioCapable : 1; // if the monitor supports basic audio
  860. NvU32 isMonYCbCr444Capable : 1; // if YCbCr 4:4:4 is supported
  861. NvU32 isMonYCbCr422Capable : 1; // if YCbCr 4:2:2 is supported
  862. NvU32 isMonxvYCC601Capable : 1; // if xvYCC 601 is supported
  863. NvU32 isMonxvYCC709Capable : 1; // if xvYCC 709 is supported
  864. NvU32 isMonHDMI : 1; // if the monitor is HDMI (with IEEE's HDMI registry ID)
  865. NvU32 EDID861ExtRev; // the revision number of the EDID 861 extension
  866. } NV_HDMI_SUPPORT_INFO;
  867. #define NV_HDMI_SUPPORT_INFO_VER MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO,1)
  868. NVAPI_INTERFACE NvAPI_GetHDMISupportInfo(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_HDMI_SUPPORT_INFO *pInfo);
  869. ///////////////////////////////////////////////////////////////////////////////
  870. // FUNCTION NAME: NvAPI_DISP_GetMonitorCapabilities
  871. //
  872. // DESCRIPTION: This API returns the Monitor capabilities
  873. //
  874. // SUPPORTED OS: Windows Vista and higher
  875. //
  876. // PARAMETERS: displayId(IN) - Monitor Identifier
  877. // pMonitorCapabilities(OUT) - The monitor support info
  878. //
  879. // RETURN STATUS:
  880. // NVAPI_OK - completed request
  881. // NVAPI_ERROR - miscellaneous error occurred
  882. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  883. //
  884. ///////////////////////////////////////////////////////////////////////////////
  885. typedef enum
  886. {
  887. // hdmi related caps
  888. NV_MONITOR_CAPS_TYPE_HDMI_VSDB = 0x1000,
  889. NV_MONITOR_CAPS_TYPE_HDMI_VCDB = 0x1001
  890. } NV_MONITOR_CAPS_TYPE;
  891. typedef enum
  892. {
  893. NV_MONITOR_CONN_TYPE_UNINITIALIZED = 0,
  894. NV_MONITOR_CONN_TYPE_VGA,
  895. NV_MONITOR_CONN_TYPE_COMPONENT,
  896. NV_MONITOR_CONN_TYPE_SVIDEO,
  897. NV_MONITOR_CONN_TYPE_HDMI,
  898. NV_MONITOR_CONN_TYPE_DVI,
  899. NV_MONITOR_CONN_TYPE_LVDS,
  900. NV_MONITOR_CONN_TYPE_DP,
  901. NV_MONITOR_CONN_TYPE_COMPOSITE,
  902. NV_MONITOR_CONN_TYPE_UNKNOWN = -1
  903. } NV_MONITOR_CONN_TYPE;
  904. typedef struct _NV_MONITOR_CAPS_VCDB
  905. {
  906. NvU8 quantizationRangeYcc : 1;
  907. NvU8 quantizationRangeRgb : 1;
  908. NvU8 scanInfoPreferredVideoFormat : 2;
  909. NvU8 scanInfoITVideoFormats : 2;
  910. NvU8 scanInfoCEVideoFormats : 2;
  911. } NV_MONITOR_CAPS_VCDB;
  912. typedef struct _NV_MONITOR_CAPS_VSDB
  913. {
  914. // byte 1
  915. NvU8 sourcePhysicalAddressB : 4;
  916. NvU8 sourcePhysicalAddressA : 4;
  917. // byte 2
  918. NvU8 sourcePhysicalAddressD : 4;
  919. NvU8 sourcePhysicalAddressC : 4;
  920. // byte 3
  921. NvU8 supportDualDviOperation : 1;
  922. NvU8 reserved6 : 2;
  923. NvU8 supportDeepColorYCbCr444 : 1;
  924. NvU8 supportDeepColor30bits : 1;
  925. NvU8 supportDeepColor36bits : 1;
  926. NvU8 supportDeepColor48bits : 1;
  927. NvU8 supportAI : 1;
  928. // byte 4
  929. NvU8 maxTmdsClock;
  930. // byte 5
  931. NvU8 cnc0SupportGraphicsTextContent : 1;
  932. NvU8 cnc1SupportPhotoContent : 1;
  933. NvU8 cnc2SupportCinemaContent : 1;
  934. NvU8 cnc3SupportGameContent : 1;
  935. NvU8 reserved8 : 1;
  936. NvU8 hasVicEntries : 1;
  937. NvU8 hasInterlacedLatencyField : 1;
  938. NvU8 hasLatencyField : 1;
  939. // byte 6
  940. NvU8 videoLatency;
  941. // byte 7
  942. NvU8 audioLatency;
  943. // byte 8
  944. NvU8 interlacedVideoLatency;
  945. // byte 9
  946. NvU8 interlacedAudioLatency;
  947. // byte 10
  948. NvU8 reserved13 : 7;
  949. NvU8 has3dEntries : 1;
  950. // byte 11
  951. NvU8 hdmi3dLength : 5;
  952. NvU8 hdmiVicLength : 3;
  953. // Remaining bytes
  954. NvU8 hdmi_vic[7]; // Keeping maximum length for 3 bits
  955. NvU8 hdmi_3d[31]; // Keeping maximum length for 5 bits
  956. } NV_MONITOR_CAPS_VSDB;
  957. typedef struct _NV_MONITOR_CAPABILITIES
  958. {
  959. NvU32 version;
  960. NvU16 size;
  961. NvU32 infoType;
  962. NvU32 connectorType; // out: vga, tv, dvi, hdmi, dp
  963. NvU8 bIsValidInfo : 1; // boolean : Returns invalid if requested info is not present such as VCDB not present
  964. union {
  965. NV_MONITOR_CAPS_VSDB vsdb;
  966. NV_MONITOR_CAPS_VCDB vcdb;
  967. } data;
  968. } NV_MONITOR_CAPABILITIES;
  969. #define NV_MONITOR_CAPABILITIES_VER MAKE_NVAPI_VERSION(NV_MONITOR_CAPABILITIES,1)
  970. NVAPI_INTERFACE NvAPI_DISP_GetMonitorCapabilities(NvU32 displayId, NV_MONITOR_CAPABILITIES *pMonitorCapabilities);
  971. ///////////////////////////////////////////////////////////////////////////////
  972. // FUNCTION NAME: NvAPI_GetInfoFrame
  973. //
  974. // DESCRIPTION: This API returns the current infoframe data on the specified device(monitor)
  975. //
  976. // SUPPORTED OS: Windows XP and higher
  977. //
  978. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  979. // outputId(IN) - The display output id. If it's "0" then the default outputId from NvAPI_GetAssociatedDisplayOutputId() will be used.
  980. // type(IN) - The type of infoframe to set
  981. // pInfoFrame(IN) - The infoframe data
  982. //
  983. // RETURN STATUS:
  984. // NVAPI_OK - completed request
  985. // NVAPI_ERROR - miscellaneous error occurred
  986. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  987. //
  988. ///////////////////////////////////////////////////////////////////////////////
  989. typedef enum _NV_INFOFRAME_TYPE
  990. {
  991. NV_INFOFRAME_TYPE_AVI = 2,
  992. NV_INFOFRAME_TYPE_SPD = 3,
  993. NV_INFOFRAME_TYPE_AUDIO = 4,
  994. NV_INFOFRAME_TYPE_MS = 5,
  995. } NV_INFOFRAME_TYPE;
  996. typedef struct
  997. {
  998. NvU8 type;
  999. NvU8 version;
  1000. NvU8 length;
  1001. } NV_INFOFRAME_HEADER;
  1002. // since this is for Windows OS so far, we use this bit little endian defination
  1003. // to handle the translation
  1004. typedef struct
  1005. {
  1006. // byte 1
  1007. NvU8 channelCount : 3;
  1008. NvU8 rsvd_bits_byte1 : 1;
  1009. NvU8 codingType : 4;
  1010. // byte 2
  1011. NvU8 sampleSize : 2;
  1012. NvU8 sampleRate : 3;
  1013. NvU8 rsvd_bits_byte2 : 3;
  1014. // byte 3
  1015. NvU8 codingExtensionType : 5;
  1016. NvU8 rsvd_bits_byte3 : 3;
  1017. // byte 4
  1018. NvU8 speakerPlacement;
  1019. // byte 5
  1020. NvU8 lfePlaybackLevel : 2;
  1021. NvU8 rsvd_bits_byte5 : 1;
  1022. NvU8 levelShift : 4;
  1023. NvU8 downmixInhibit : 1;
  1024. // byte 6~10
  1025. NvU8 rsvd_byte6;
  1026. NvU8 rsvd_byte7;
  1027. NvU8 rsvd_byte8;
  1028. NvU8 rsvd_byte9;
  1029. NvU8 rsvd_byte10;
  1030. }NV_AUDIO_INFOFRAME;
  1031. typedef struct
  1032. {
  1033. // byte 1
  1034. NvU8 scanInfo : 2;
  1035. NvU8 barInfo : 2;
  1036. NvU8 activeFormatInfoPresent : 1;
  1037. NvU8 colorSpace : 2;
  1038. NvU8 rsvd_bits_byte1 : 1;
  1039. // byte 2
  1040. NvU8 activeFormatAspectRatio : 4;
  1041. NvU8 picAspectRatio : 2;
  1042. NvU8 colorimetry : 2;
  1043. // byte 3
  1044. NvU8 nonuniformScaling : 2;
  1045. NvU8 rgbQuantizationRange : 2;
  1046. NvU8 extendedColorimetry : 3;
  1047. NvU8 itContent : 1;
  1048. // byte 4
  1049. NvU8 vic : 7;
  1050. NvU8 rsvd_bits_byte4 : 1;
  1051. // byte 5
  1052. NvU8 pixelRepeat : 4;
  1053. NvU8 contentTypes : 2;
  1054. NvU8 yccQuantizationRange : 2;
  1055. // byte 6~13
  1056. NvU8 topBarLow;
  1057. NvU8 topBarHigh;
  1058. NvU8 bottomBarLow;
  1059. NvU8 bottomBarHigh;
  1060. NvU8 leftBarLow;
  1061. NvU8 leftBarHigh;
  1062. NvU8 rightBarLow;
  1063. NvU8 rightBarHigh;
  1064. } NV_VIDEO_INFOFRAME;
  1065. typedef struct
  1066. {
  1067. NV_INFOFRAME_HEADER header;
  1068. union
  1069. {
  1070. NV_AUDIO_INFOFRAME audio;
  1071. NV_VIDEO_INFOFRAME video;
  1072. }u;
  1073. } NV_INFOFRAME;
  1074. NVAPI_INTERFACE NvAPI_GetInfoFrame(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_INFOFRAME_TYPE type, NV_INFOFRAME *pInfoFrame);
  1075. ///////////////////////////////////////////////////////////////////////////////
  1076. // FUNCTION NAME: NvAPI_SetInfoFrame
  1077. //
  1078. // DESCRIPTION: This API returns the current infoframe data on the specified device(monitor)
  1079. //
  1080. // SUPPORTED OS: Windows XP and higher
  1081. //
  1082. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  1083. // outputId(IN) - The display output id. If it's "0" then the default outputId from NvAPI_GetAssociatedDisplayOutputId() will be used.
  1084. // type(IN) - The type of infoframe to set
  1085. // pInfoFrame(IN) - The infoframe data, NULL mean reset to the default value.
  1086. //
  1087. // RETURN STATUS:
  1088. // NVAPI_OK - completed request
  1089. // NVAPI_ERROR - miscellaneous error occurred
  1090. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  1091. //
  1092. ///////////////////////////////////////////////////////////////////////////////
  1093. NVAPI_INTERFACE NvAPI_SetInfoFrame(NvDisplayHandle hNvDisplay, NvU32 outputId, NV_INFOFRAME_TYPE type, NV_INFOFRAME *pInfoFrame);
  1094. ///////////////////////////////////////////////////////////////////////////////
  1095. // FUNCTION NAME: NvAPI_Disp_InfoFrameControl
  1096. //
  1097. // DESCRIPTION: Controls the InfoFrame values
  1098. //
  1099. // SUPPORTED OS: Windows Vista and higher
  1100. //
  1101. // PARAMETERS: displayId(IN) - Monitor Identifier
  1102. // pInfoframeData(IN/OUT) - Contains data corresponding to InfoFrame
  1103. //
  1104. // RETURN STATUS:
  1105. // NVAPI_OK - completed request
  1106. // NVAPI_ERROR - miscellaneous error occurred
  1107. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  1108. //
  1109. ///////////////////////////////////////////////////////////////////////////////
  1110. typedef enum
  1111. {
  1112. NV_INFOFRAME_CMD_GET_DEFAULT = 0, // returns the fields in the infoframe with values set by manufacturer:nvidia/oem
  1113. NV_INFOFRAME_CMD_RESET, // sets the fields in the infoframe to auto, and infoframe to default infoframe for use in a set
  1114. NV_INFOFRAME_CMD_GET, // get the current infoframe state
  1115. NV_INFOFRAME_CMD_SET, // set the current infoframe state (flushed to the monitor), the values are one time and does not persist
  1116. 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
  1117. 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
  1118. NV_INFOFRAME_CMD_GET_PROPERTY, // get properties associated with infoframe (each of the infoframe type will have properties)
  1119. NV_INFOFRAME_CMD_SET_PROPERTY, // set properties associated with infoframe
  1120. } NV_INFOFRAME_CMD;
  1121. typedef enum
  1122. {
  1123. NV_INFOFRAME_PROPERTY_MODE_AUTO = 0, // driver determines whether to send infoframes
  1124. NV_INFOFRAME_PROPERTY_MODE_ENABLE, // driver always sends infoframe
  1125. NV_INFOFRAME_PROPERTY_MODE_DISABLE, // driver always don't send infoframe
  1126. NV_INFOFRAME_PROPERTY_MODE_ALLOW_OVERRIDE, // driver only sends infoframe when client request thru infoframe escape call
  1127. } NV_INFOFRAME_PROPERTY_MODE;
  1128. // returns whether the current monitor is in blacklist or force this monitor to be in blacklist
  1129. typedef enum
  1130. {
  1131. NV_INFOFRAME_PROPERTY_BLACKLIST_FALSE = 0,
  1132. NV_INFOFRAME_PROPERTY_BLACKLIST_TRUE,
  1133. } NV_INFOFRAME_PROPERTY_BLACKLIST;
  1134. typedef struct
  1135. {
  1136. NvU32 mode : 4;
  1137. NvU32 blackList : 2;
  1138. NvU32 reserved : 10;
  1139. NvU32 version : 8;
  1140. NvU32 length : 8;
  1141. } NV_INFOFRAME_PROPERTY;
  1142. // byte1 related
  1143. typedef enum
  1144. {
  1145. NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_NODATA = 0,
  1146. NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_OVERSCAN,
  1147. NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_UNDERSCAN,
  1148. NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_FUTURE,
  1149. NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO_AUTO = 7
  1150. } NV_INFOFRAME_FIELD_VALUE_AVI_SCANINFO;
  1151. typedef enum
  1152. {
  1153. NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_NOT_PRESENT = 0,
  1154. NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_VERTICAL_PRESENT,
  1155. NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_HORIZONTAL_PRESENT,
  1156. NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_BOTH_PRESENT,
  1157. NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA_AUTO = 7
  1158. } NV_INFOFRAME_FIELD_VALUE_AVI_BARDATA;
  1159. typedef enum
  1160. {
  1161. NV_INFOFRAME_FIELD_VALUE_AVI_AFI_ABSENT = 0,
  1162. NV_INFOFRAME_FIELD_VALUE_AVI_AFI_PRESENT,
  1163. NV_INFOFRAME_FIELD_VALUE_AVI_AFI_AUTO = 3
  1164. } NV_INFOFRAME_FIELD_VALUE_AVI_ACTIVEFORMATINFO;
  1165. typedef enum
  1166. {
  1167. NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_RGB = 0,
  1168. NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr422,
  1169. NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_YCbCr444,
  1170. NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_FUTURE,
  1171. NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT_AUTO = 7
  1172. } NV_INFOFRAME_FIELD_VALUE_AVI_COLORFORMAT;
  1173. typedef enum
  1174. {
  1175. NV_INFOFRAME_FIELD_VALUE_AVI_F17_FALSE = 0,
  1176. NV_INFOFRAME_FIELD_VALUE_AVI_F17_TRUE,
  1177. NV_INFOFRAME_FIELD_VALUE_AVI_F17_AUTO = 3
  1178. } NV_INFOFRAME_FIELD_VALUE_AVI_F17;
  1179. // byte2 related
  1180. typedef enum
  1181. {
  1182. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_NO_AFD = 0,
  1183. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE01,
  1184. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE02,
  1185. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE03,
  1186. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_LETTERBOX_GT16x9,
  1187. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE05,
  1188. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE06,
  1189. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE07,
  1190. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_EQUAL_CODEDFRAME = 8,
  1191. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_4x3,
  1192. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_16x9,
  1193. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_CENTER_14x9,
  1194. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_RESERVE12,
  1195. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_4x3_ON_14x9,
  1196. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_14x9,
  1197. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_16x9_ON_4x3,
  1198. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION_AUTO = 31,
  1199. } NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOACTIVEPORTION;
  1200. typedef enum
  1201. {
  1202. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_NO_DATA = 0,
  1203. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_4x3,
  1204. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_16x9,
  1205. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_FUTURE,
  1206. NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME_AUTO = 7
  1207. } NV_INFOFRAME_FIELD_VALUE_AVI_ASPECTRATIOCODEDFRAME;
  1208. typedef enum
  1209. {
  1210. NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_NO_DATA = 0,
  1211. NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_SMPTE_170M,
  1212. NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_ITUR_BT709,
  1213. NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_USE_EXTENDED_COLORIMETRY,
  1214. NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY_AUTO = 7
  1215. } NV_INFOFRAME_FIELD_VALUE_AVI_COLORIMETRY;
  1216. // byte 3 related
  1217. typedef enum
  1218. {
  1219. NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_NO_DATA = 0,
  1220. NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_HORIZONTAL,
  1221. NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_VERTICAL,
  1222. NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_BOTH,
  1223. NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING_AUTO = 7
  1224. } NV_INFOFRAME_FIELD_VALUE_AVI_NONUNIFORMPICTURESCALING;
  1225. typedef enum
  1226. {
  1227. NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_DEFAULT = 0,
  1228. NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_LIMITED_RANGE,
  1229. NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_FULL_RANGE,
  1230. NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_RESERVED,
  1231. NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION_AUTO = 7
  1232. } NV_INFOFRAME_FIELD_VALUE_AVI_RGBQUANTIZATION;
  1233. typedef enum
  1234. {
  1235. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC601 = 0,
  1236. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_XVYCC709,
  1237. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_SYCC601,
  1238. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBEYCC601,
  1239. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_ADOBERGB,
  1240. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED05,
  1241. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED06,
  1242. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_RESERVED07,
  1243. NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY_AUTO = 15
  1244. } NV_INFOFRAME_FIELD_VALUE_AVI_EXTENDEDCOLORIMETRY;
  1245. typedef enum
  1246. {
  1247. NV_INFOFRAME_FIELD_VALUE_AVI_ITC_VIDEO_CONTENT = 0,
  1248. NV_INFOFRAME_FIELD_VALUE_AVI_ITC_ITCONTENT,
  1249. NV_INFOFRAME_FIELD_VALUE_AVI_ITC_AUTO = 3
  1250. } NV_INFOFRAME_FIELD_VALUE_AVI_ITC;
  1251. // byte 4 related
  1252. typedef enum
  1253. {
  1254. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_NONE = 0,
  1255. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X02,
  1256. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X03,
  1257. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X04,
  1258. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X05,
  1259. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X06,
  1260. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X07,
  1261. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X08,
  1262. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X09,
  1263. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_X10,
  1264. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED10,
  1265. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED11,
  1266. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED12,
  1267. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED13,
  1268. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED14,
  1269. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_RESERVED15,
  1270. NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION_AUTO = 31
  1271. } NV_INFOFRAME_FIELD_VALUE_AVI_PIXELREPETITION;
  1272. typedef enum
  1273. {
  1274. NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GRAPHICS = 0,
  1275. NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_PHOTO,
  1276. NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_CINEMA,
  1277. NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_GAME,
  1278. NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE_AUTO = 7
  1279. } NV_INFOFRAME_FIELD_VALUE_AVI_CONTENTTYPE;
  1280. typedef enum
  1281. {
  1282. NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_LIMITED_RANGE = 0,
  1283. NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_FULL_RANGE,
  1284. NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED02,
  1285. NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_RESERVED03,
  1286. NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION_AUTO = 7
  1287. } NV_INFOFRAME_FIELD_VALUE_AVI_YCCQUANTIZATION;
  1288. // Adding an Auto bit to each field
  1289. typedef struct
  1290. {
  1291. NvU32 vic : 8;
  1292. NvU32 pixelRepeat : 5;
  1293. NvU32 colorSpace : 3;
  1294. NvU32 colorimetry : 3;
  1295. NvU32 extendedColorimetry : 4;
  1296. NvU32 rgbQuantizationRange : 3;
  1297. NvU32 yccQuantizationRange : 3;
  1298. NvU32 itContent : 2;
  1299. NvU32 contentTypes : 3;
  1300. NvU32 scanInfo : 3;
  1301. NvU32 activeFormatInfoPresent : 2;
  1302. NvU32 activeFormatAspectRatio : 5;
  1303. NvU32 picAspectRatio : 3;
  1304. NvU32 nonuniformScaling : 3;
  1305. NvU32 barInfo : 3;
  1306. NvU32 top_bar : 17;
  1307. NvU32 bottom_bar : 17;
  1308. NvU32 left_bar : 17;
  1309. NvU32 right_bar : 17;
  1310. NvU32 Future17 : 2;
  1311. NvU32 Future47 : 2;
  1312. } NV_INFOFRAME_VIDEO;
  1313. // byte 1 related
  1314. typedef enum
  1315. {
  1316. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_IN_HEADER = 0,
  1317. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_2,
  1318. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_3,
  1319. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_4,
  1320. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_5,
  1321. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_6,
  1322. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_7,
  1323. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_8,
  1324. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT_AUTO = 15
  1325. } NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELCOUNT;
  1326. typedef enum
  1327. {
  1328. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_IN_HEADER = 0,
  1329. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_PCM,
  1330. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AC3,
  1331. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG1,
  1332. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MP3,
  1333. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MPEG2,
  1334. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AACLC,
  1335. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTS,
  1336. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_ATRAC,
  1337. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DSD,
  1338. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_EAC3,
  1339. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DTSHD,
  1340. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_MLP,
  1341. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_DST,
  1342. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_WMAPRO,
  1343. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_USE_CODING_EXTENSION_TYPE,
  1344. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE_AUTO = 31
  1345. } NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGTYPE;
  1346. // byte 2 related
  1347. typedef enum
  1348. {
  1349. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_IN_HEADER = 0,
  1350. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_16BITS,
  1351. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_20BITS,
  1352. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_24BITS,
  1353. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE_AUTO = 7
  1354. } NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLESIZE;
  1355. typedef enum
  1356. {
  1357. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_IN_HEADER = 0,
  1358. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_32000HZ,
  1359. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_44100HZ,
  1360. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_48000HZ,
  1361. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_88200KHZ,
  1362. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_96000KHZ,
  1363. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_176400KHZ,
  1364. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_192000KHZ,
  1365. NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY_AUTO = 15
  1366. } NV_INFOFRAME_FIELD_VALUE_AUDIO_SAMPLEFREQUENCY;
  1367. // byte 3 related
  1368. typedef enum
  1369. {
  1370. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_USE_CODING_TYPE = 0,
  1371. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAAC,
  1372. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_HEAACV2,
  1373. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_MPEGSURROUND,
  1374. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE04,
  1375. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE05,
  1376. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE06,
  1377. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE07,
  1378. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE08,
  1379. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE09,
  1380. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE10,
  1381. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE11,
  1382. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE12,
  1383. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE13,
  1384. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE14,
  1385. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE15,
  1386. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE16,
  1387. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE17,
  1388. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE18,
  1389. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE19,
  1390. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE20,
  1391. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE21,
  1392. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE22,
  1393. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE23,
  1394. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE24,
  1395. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE25,
  1396. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE26,
  1397. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE27,
  1398. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE28,
  1399. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE29,
  1400. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE30,
  1401. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_RESERVE31,
  1402. NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE_AUTO = 63
  1403. } NV_INFOFRAME_FIELD_VALUE_AUDIO_CODINGEXTENSIONTYPE;
  1404. // byte 4 related
  1405. typedef enum
  1406. {
  1407. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_X_FR_FL =0,
  1408. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_X_LFE_FR_FL,
  1409. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_X_FR_FL,
  1410. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_X_FC_LFE_FR_FL,
  1411. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_X_FR_FL,
  1412. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_X_LFE_FR_FL,
  1413. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_X_FR_FL,
  1414. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_X_RC_FC_LFE_FR_FL,
  1415. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_X_FR_FL,
  1416. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_X_LFE_FR_FL,
  1417. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_X_FR_FL,
  1418. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_X_RR_RL_FC_LFE_FR_FL,
  1419. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_X_FR_FL,
  1420. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_X_LFE_FR_FL,
  1421. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_X_FR_FL,
  1422. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_RC_RR_RL_FC_LFE_FR_FL,
  1423. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_X_FR_FL,
  1424. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_X_LFE_FR_FL,
  1425. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_X_FR_FL,
  1426. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_RRC_RLC_RR_RL_FC_LFE_FR_FL,
  1427. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_X_FR_FL,
  1428. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_X_LFE_FR_FL,
  1429. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_X_FR_FL,
  1430. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_X_FC_LFE_FR_FL,
  1431. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_X_FR_FL,
  1432. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_X_LFE_FR_FL,
  1433. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_X_FR_FL,
  1434. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_X_RC_FC_LFE_FR_FL,
  1435. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_X_FR_FL,
  1436. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_X_LFE_FR_FL,
  1437. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_X_FR_FL,
  1438. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRC_FLC_RR_RL_FC_LFE_FR_FL,
  1439. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_X_FR_FL,
  1440. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_X_FCH_RR_RL_FC_LFE_FR_FL,
  1441. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_X_FR_FL,
  1442. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_X_RR_RL_FC_LFE_FR_FL,
  1443. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_X_FR_FL,
  1444. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_X_LFE_FR_FL,
  1445. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_X_FR_FL,
  1446. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_X_LFE_FR_FL,
  1447. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_X_FR_FL,
  1448. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_RC_RR_RL_FC_LFE_FR_FL,
  1449. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_X_FR_FL,
  1450. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FCH_RC_RR_RL_FC_LFE_FR_FL,
  1451. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_X_FR_FL,
  1452. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_TC_FCH_RR_RL_FC_LFE_FR_FL,
  1453. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_X_FR_FL,
  1454. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRH_FLH_RR_RL_FC_LFE_FR_FL,
  1455. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_X_FR_FL,
  1456. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_FRW_FLW_RR_RL_FC_LFE_FR_FL = 0X31,
  1457. // all other values should default to auto
  1458. NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION_AUTO = 0x1FF
  1459. } NV_INFOFRAME_FIELD_VALUE_AUDIO_CHANNELALLOCATION;
  1460. // byte 5 related
  1461. typedef enum
  1462. {
  1463. NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_NO_DATA = 0,
  1464. NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_0DB,
  1465. NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_PLUS10DB,
  1466. NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_RESERVED03,
  1467. NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL_AUTO = 7
  1468. } NV_INFOFRAME_FIELD_VALUE_AUDIO_LFEPLAYBACKLEVEL;
  1469. typedef enum
  1470. {
  1471. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_0DB = 0,
  1472. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_1DB,
  1473. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_2DB,
  1474. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_3DB,
  1475. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_4DB,
  1476. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_5DB,
  1477. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_6DB,
  1478. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_7DB,
  1479. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_8DB,
  1480. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_9DB,
  1481. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_10DB,
  1482. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_11DB,
  1483. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_12DB,
  1484. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_13DB,
  1485. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_14DB,
  1486. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_15DB,
  1487. NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES_AUTO = 31
  1488. } NV_INFOFRAME_FIELD_VALUE_AUDIO_LEVELSHIFTVALUES;
  1489. typedef enum
  1490. {
  1491. NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PERMITTED = 0,
  1492. NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_PROHIBITED,
  1493. NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX_AUTO = 3
  1494. } NV_INFOFRAME_FIELD_VALUE_AUDIO_DOWNMIX;
  1495. typedef struct
  1496. {
  1497. NvU32 codingType : 5;
  1498. NvU32 codingExtensionType : 6;
  1499. NvU32 sampleSize : 3;
  1500. NvU32 sampleRate : 4;
  1501. NvU32 channelCount : 4;
  1502. NvU32 speakerPlacement : 9;
  1503. NvU32 downmixInhibit : 2;
  1504. NvU32 lfePlaybackLevel : 3;
  1505. NvU32 levelShift : 5;
  1506. NvU32 Future12 : 2;
  1507. NvU32 Future2x : 4;
  1508. NvU32 Future3x : 4;
  1509. NvU32 Future52 : 2;
  1510. NvU32 Future6 : 9;
  1511. NvU32 Future7 : 9;
  1512. NvU32 Future8 : 9;
  1513. NvU32 Future9 : 9;
  1514. NvU32 Future10 : 9;
  1515. } NV_INFOFRAME_AUDIO;
  1516. typedef struct
  1517. {
  1518. NvU32 version; // version of this structure
  1519. NvU16 size; // size of this structure
  1520. NvU8 cmd; // The actions to perform from NV_INFOFRAME_CMD
  1521. NvU8 type; // type of infoframe
  1522. union
  1523. {
  1524. NV_INFOFRAME_PROPERTY property; // This is NVIDIA specific and corresponds to the property cmds and associated infoframe
  1525. NV_INFOFRAME_AUDIO audio;
  1526. NV_INFOFRAME_VIDEO video;
  1527. } infoframe;
  1528. } NV_INFOFRAME_DATA;
  1529. #define NV_INFOFRAME_DATA_VER MAKE_NVAPI_VERSION(NV_INFOFRAME_DATA,1)
  1530. NVAPI_INTERFACE NvAPI_Disp_InfoFrameControl(NvU32 displayId, NV_INFOFRAME_DATA *pInfoframeData);
  1531. ///////////////////////////////////////////////////////////////////////////////
  1532. // FUNCTION NAME: NvAPI_Disp_ColorControl
  1533. //
  1534. // DESCRIPTION: Controls the Color values
  1535. //
  1536. // SUPPORTED OS: Windows Vista and higher
  1537. //
  1538. // PARAMETERS: displayId(IN) - Monitor Identifier
  1539. // pColorData(IN/OUT) - Contains data corresponding to color information
  1540. //
  1541. // RETURN STATUS:
  1542. // NVAPI_OK - completed request
  1543. // NVAPI_ERROR - miscellaneous error occurred
  1544. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  1545. //
  1546. ///////////////////////////////////////////////////////////////////////////////
  1547. typedef enum
  1548. {
  1549. NV_COLOR_CMD_GET = 1,
  1550. NV_COLOR_CMD_SET,
  1551. NV_COLOR_CMD_IS_SUPPORTED_COLOR,
  1552. NV_COLOR_CMD_GET_DEFAULT
  1553. } NV_COLOR_CMD;
  1554. // See Table 14 of CEA-861E. Not all this is supported by GPU.
  1555. typedef enum
  1556. {
  1557. NV_COLOR_FORMAT_RGB = 0,
  1558. NV_COLOR_FORMAT_YUV422,
  1559. NV_COLOR_FORMAT_YUV444,
  1560. NV_COLOR_FORMAT_DEFAULT = 0xFE,
  1561. NV_COLOR_FORMAT_AUTO = 0xFF
  1562. } NV_COLOR_FORMAT;
  1563. typedef enum
  1564. {
  1565. NV_COLOR_COLORIMETRY_RGB = 0,
  1566. NV_COLOR_COLORIMETRY_YCC601,
  1567. NV_COLOR_COLORIMETRY_YCC709,
  1568. NV_COLOR_COLORIMETRY_XVYCC601,
  1569. NV_COLOR_COLORIMETRY_XVYCC709,
  1570. NV_COLOR_COLORIMETRY_SYCC601,
  1571. NV_COLOR_COLORIMETRY_ADOBEYCC601,
  1572. NV_COLOR_COLORIMETRY_ADOBERGB,
  1573. NV_COLOR_COLORIMETRY_DEFAULT = 0xFE,
  1574. NV_COLOR_COLORIMETRY_AUTO = 0xFF
  1575. } NV_COLOR_COLORIMETRY;
  1576. typedef struct
  1577. {
  1578. NvU32 version; // version of this structure
  1579. NvU16 size; // size of this structure
  1580. NvU8 cmd;
  1581. struct
  1582. {
  1583. NvU8 colorFormat;
  1584. NvU8 colorimetry;
  1585. } data;
  1586. } NV_COLOR_DATA;
  1587. NVAPI_INTERFACE NvAPI_Disp_ColorControl(NvU32 displayId, NV_COLOR_DATA *pColorData);
  1588. #define NV_COLOR_DATA_VER MAKE_NVAPI_VERSION(NV_COLOR_DATA,1)
  1589. //-----------------------------------------------------------------------------
  1590. // DirectX APIs
  1591. //-----------------------------------------------------------------------------
  1592. typedef struct
  1593. {
  1594. NvU32 version; // Structure version
  1595. NvU32 maxNumAFRGroups; // [OUT] The maximum possible value of numAFRGroups
  1596. NvU32 numAFRGroups; // [OUT] The number of AFR groups enabled in the system
  1597. NvU32 currentAFRIndex; // [OUT] The AFR group index for the frame currently being rendered
  1598. NvU32 nextFrameAFRIndex; // [OUT] What the AFR group index will be for the next frame (i.e. after calling Present)
  1599. NvU32 previousFrameAFRIndex; // [OUT] The AFR group index that was used for the previous frame (~0 if more than one frame has not been rendered yet)
  1600. NvU32 bIsCurAFRGroupNew; // [OUT] boolean: Is this frame the first time running on the current AFR group
  1601. } NV_GET_CURRENT_SLI_STATE;
  1602. #define NV_GET_CURRENT_SLI_STATE_VER MAKE_NVAPI_VERSION(NV_GET_CURRENT_SLI_STATE,1)
  1603. #if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  1604. ///////////////////////////////////////////////////////////////////////////////
  1605. //
  1606. // FUNCTION NAME: NvAPI_D3D_GetCurrentSLIState
  1607. //
  1608. // DESCRIPTION: Returns the current SLI state for this device. The struct
  1609. // contains the number of AFR groups, the current AFR group index
  1610. // and what the AFR group index will be for the next frame.
  1611. // pDevice can be either a IDirect3DDevice9 or ID3D10Device ptr.
  1612. //
  1613. // SUPPORTED OS: Windows XP and higher
  1614. //
  1615. // RETURN STATUS:
  1616. // NVAPI_OK - completed request
  1617. // NVAPI_ERROR - error occurred
  1618. //
  1619. ///////////////////////////////////////////////////////////////////////////////
  1620. NVAPI_INTERFACE NvAPI_D3D_GetCurrentSLIState(IUnknown *pDevice, NV_GET_CURRENT_SLI_STATE *pSliState);
  1621. #endif //if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  1622. #if defined(_D3D9_H_)
  1623. ///////////////////////////////////////////////////////////////////////////////
  1624. //
  1625. // FUNCTION NAME: NvAPI_D3D9_RegisterResource
  1626. //
  1627. // DESCRIPTION: To bind a resource (surface/texture) so that it can be retrieved
  1628. // internally by nvapi.
  1629. //
  1630. // SUPPORTED OS: Windows XP and higher
  1631. // INPUT: pResource (IN) surface/texture
  1632. //
  1633. // RETURN STATUS:
  1634. // NVAPI_OK - completed request
  1635. // NVAPI_ERROR - error occurred
  1636. //
  1637. ///////////////////////////////////////////////////////////////////////////////
  1638. NVAPI_INTERFACE NvAPI_D3D9_RegisterResource(IDirect3DResource9* pResource);
  1639. ///////////////////////////////////////////////////////////////////////////////
  1640. //
  1641. // FUNCTION NAME: NvAPI_D3D9_UnregisterResource
  1642. //
  1643. // DESCRIPTION: To unbind a resource (surface/texture) after usage.
  1644. //
  1645. // SUPPORTED OS: Windows XP and higher
  1646. // INPUT: pResource (IN) surface/texture
  1647. //
  1648. // RETURN STATUS:
  1649. // NVAPI_OK - completed request
  1650. // NVAPI_ERROR - error occurred
  1651. //
  1652. ///////////////////////////////////////////////////////////////////////////////
  1653. NVAPI_INTERFACE NvAPI_D3D9_UnregisterResource(IDirect3DResource9* pResource);
  1654. ///////////////////////////////////////////////////////////////////////////////
  1655. //
  1656. // FUNCTION NAME: NvAPI_D3D9_AliasSurfaceAsTexture
  1657. //
  1658. // DESCRIPTION: Create a texture that is an alias of a surface registered with NvAPI. The
  1659. // new texture can be bound with IDirect3DDevice9::SetTexture(). Note that the texture must
  1660. // be unbound before drawing to the surface again.
  1661. // Unless the USE_SUPER flag is passed, MSAA surfaces will be resolved before
  1662. // being used as a texture. MSAA depth buffers are resolved with a point filter,
  1663. // and non-depth MSAA surfaces are resolved with a linear filter.
  1664. //
  1665. // SUPPORTED OS: Windows XP and higher
  1666. //
  1667. // INPUT: pDev (IN) The D3D device that owns the objects
  1668. // pSurface (IN) Pointer to a surface that has been registered with NvAPI
  1669. // to provide a texture alias to
  1670. // ppTexture (OUT) Fill with the texture created
  1671. // dwFlag (IN) NVAPI_ALIAS_SURFACE_FLAG to describe how to handle the texture
  1672. //
  1673. // RETURN STATUS:
  1674. // NVAPI_OK - completed request
  1675. // NVAPI_INVALID_POINTER - A null pointer was passed as an argument
  1676. // NVAPI_INVALID_ARGUMENT - One of the arguments was invalid, probably dwFlag.
  1677. // NVAPI_UNREGISTERED_RESOURCE - pSurface has not been registered with NvAPI
  1678. // NVAPI_ERROR - error occurred
  1679. //
  1680. ///////////////////////////////////////////////////////////////////////////////
  1681. typedef enum {
  1682. NVAPI_ALIAS_SURFACE_FLAG_NONE = 0x00000000,
  1683. 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.)
  1684. NVAPI_ALIAS_SURFACE_FLAG_MASK = 0x00000001
  1685. } NVAPI_ALIAS_SURFACE_FLAG;
  1686. NVAPI_INTERFACE NvAPI_D3D9_AliasSurfaceAsTexture(IDirect3DDevice9* pDev,
  1687. IDirect3DSurface9* pSurface,
  1688. IDirect3DTexture9 **ppTexture,
  1689. DWORD dwFlag);
  1690. ///////////////////////////////////////////////////////////////////////////////
  1691. //
  1692. // FUNCTION NAME: NvAPI_D3D9_StretchRectEx
  1693. //
  1694. // DESCRIPTION: Copy the contents of the source resource to the destination
  1695. // resource. This function can convert
  1696. // between a wider range of surfaces than
  1697. // IDirect3DDevice9::StretchRect. For example, it can copy
  1698. // from a depth/stencil surface to a texture.
  1699. // Note that the source and destination resources *must* be registered
  1700. // with NvAPI before being used with NvAPI_D3D9_StretchRectEx.
  1701. //
  1702. // SUPPORTED OS: Windows XP and higher
  1703. //
  1704. // INPUT: pDevice (IN) The D3D device that owns the objects.
  1705. // pSourceResource(IN) Pointer to the source resource.
  1706. // pSrcRect (IN) Defines the rectangle on the source to copy from. If null, copy from the entire resource.
  1707. // pDestResource (IN) Pointer to the destination resource.
  1708. // pDstRect (IN) Defines the rectangle on the destination to copy to. If null, copy to the entire resource.
  1709. // Filter (IN) Choose a filtering method: D3DTEXF_NONE, D3DTEXF_POINT, D3DTEXF_LINEAR.
  1710. //
  1711. // RETURN STATUS:
  1712. // NVAPI_OK - completed request
  1713. // NVAPI_INVALID_POINTER - An invalid pointer was passed as an argument (probably NULL)
  1714. // NVAPI_INVALID_ARGUMENT - One of the arguments was invalid
  1715. // NVAPI_UNREGISTERED_RESOURCE - a resource was passed in without being registered
  1716. // NVAPI_ERROR - error occurred
  1717. //
  1718. ///////////////////////////////////////////////////////////////////////////////
  1719. NVAPI_INTERFACE NvAPI_D3D9_StretchRectEx(IDirect3DDevice9 * pDevice,
  1720. IDirect3DResource9 * pSourceResource,
  1721. CONST RECT * pSourceRect,
  1722. IDirect3DResource9 * pDestResource,
  1723. CONST RECT * pDestRect,
  1724. D3DTEXTUREFILTERTYPE Filter);
  1725. #endif //if defined(_D3D9_H_)
  1726. ///////////////////////////////////////////////////////////////////////////////
  1727. //
  1728. // FUNCTION NAME: NvAPI_GPU_GetAllOutputs
  1729. //
  1730. // DESCRIPTION: Returns set of all GPU-output identifiers as a bitmask.
  1731. //
  1732. // SUPPORTED OS: Windows XP and higher
  1733. //
  1734. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  1735. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  1736. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1737. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1738. //
  1739. ///////////////////////////////////////////////////////////////////////////////
  1740. NVAPI_INTERFACE NvAPI_GPU_GetAllOutputs(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pOutputsMask);
  1741. ///////////////////////////////////////////////////////////////////////////////
  1742. //
  1743. // FUNCTION NAME: NvAPI_GPU_GetConnectedOutputs
  1744. //
  1745. // DESCRIPTION: Same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU-output
  1746. // identifiers that are connected to display devices.
  1747. //
  1748. // SUPPORTED OS: Windows XP and higher
  1749. //
  1750. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  1751. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  1752. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1753. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1754. //
  1755. ///////////////////////////////////////////////////////////////////////////////
  1756. NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
  1757. ///////////////////////////////////////////////////////////////////////////////
  1758. //
  1759. // FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputs
  1760. //
  1761. // DESCRIPTION: Same as NvAPI_GPU_GetConnectedOutputs but returns only the set of GPU-output
  1762. // identifiers that can be selected in an SLI configuration.
  1763. // NOTE: This function matches NvAPI_GPU_GetConnectedOutputs
  1764. // - On systems which are not SLI capable.
  1765. // - If the queried GPU is not part of a valid SLI group.
  1766. //
  1767. // SUPPORTED OS: Windows XP and higher
  1768. //
  1769. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  1770. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  1771. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1772. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1773. //
  1774. ///////////////////////////////////////////////////////////////////////////////
  1775. NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
  1776. ///////////////////////////////////////////////////////////////////////////////
  1777. //
  1778. // FUNCTION NAME: NvAPI_GPU_GetConnectedOutputsWithLidState
  1779. //
  1780. // DESCRIPTION: Similar to NvAPI_GPU_GetConnectedOutputs this API returns the connected display identifiers that are connected
  1781. // as a output mask but unlike NvAPI_GPU_GetConnectedOutputs this API "always" reflects the Lid State in the output mask.
  1782. // Thus if you expect the LID close state to be available in the connection mask use this API.
  1783. // If LID is closed then this API will remove the LID panel from the connected display identifiers.
  1784. // If LID is open then this API will reflect the LID panel in the connected display identifiers.
  1785. // Note:This API should be used on laptop systems and on systems where LID state is required in the connection output mask.
  1786. // On desktop systems the returned identifiers will match NvAPI_GPU_GetConnectedOutputs.
  1787. //
  1788. // SUPPORTED OS: Windows XP and higher
  1789. //
  1790. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  1791. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  1792. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1793. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1794. //
  1795. ///////////////////////////////////////////////////////////////////////////////
  1796. NVAPI_INTERFACE NvAPI_GPU_GetConnectedOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
  1797. ///////////////////////////////////////////////////////////////////////////////
  1798. //
  1799. // FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputsWithLidState
  1800. //
  1801. // DESCRIPTION: Same as NvAPI_GPU_GetConnectedOutputsWithLidState but returns only the set of GPU-output
  1802. // identifiers that can be selected in an SLI configuration. With SLI disabled
  1803. // this function matches NvAPI_GPU_GetConnectedOutputsWithLidState
  1804. //
  1805. // SUPPORTED OS: Windows XP and higher
  1806. //
  1807. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  1808. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  1809. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1810. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1811. //
  1812. ///////////////////////////////////////////////////////////////////////////////
  1813. NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputsWithLidState(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
  1814. ///////////////////////////////////////////////////////////////////////////////
  1815. //
  1816. // FUNCTION NAME: NvAPI_GPU_GetSystemType
  1817. //
  1818. // DESCRIPTION: Returns information to identify if the GPU type is for a laptop system or a desktop system.
  1819. //
  1820. // SUPPORTED OS: Windows XP and higher
  1821. //
  1822. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  1823. // NVAPI_OK: *pSystemType contains the GPU system type
  1824. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1825. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1826. //
  1827. ///////////////////////////////////////////////////////////////////////////////
  1828. typedef enum
  1829. {
  1830. NV_SYSTEM_TYPE_UNKNOWN = 0,
  1831. NV_SYSTEM_TYPE_LAPTOP = 1,
  1832. NV_SYSTEM_TYPE_DESKTOP = 2,
  1833. } NV_SYSTEM_TYPE;
  1834. NVAPI_INTERFACE NvAPI_GPU_GetSystemType(NvPhysicalGpuHandle hPhysicalGpu, NV_SYSTEM_TYPE *pSystemType);
  1835. ///////////////////////////////////////////////////////////////////////////////
  1836. //
  1837. // FUNCTION NAME: NvAPI_GPU_GetActiveOutputs
  1838. //
  1839. // DESCRIPTION: Same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU-output
  1840. // identifiers that are actively driving display devices.
  1841. //
  1842. // SUPPORTED OS: Windows XP and higher
  1843. //
  1844. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  1845. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  1846. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1847. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1848. //
  1849. ///////////////////////////////////////////////////////////////////////////////
  1850. NVAPI_INTERFACE NvAPI_GPU_GetActiveOutputs(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pOutputsMask);
  1851. ///////////////////////////////////////////////////////////////////////////////
  1852. //
  1853. // FUNCTION NAME: NvAPI_GPU_GetEDID
  1854. //
  1855. // DESCRIPTION: Returns the EDID data for the specified GPU handle and connection bit mask.
  1856. // displayOutputId should have exactly 1 bit set to indicate a single display.
  1857. //
  1858. // SUPPORTED OS: Windows XP and higher
  1859. //
  1860. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pEDID is NULL; displayOutputId has 0 or > 1 bits set.
  1861. // NVAPI_OK: *pEDID contains valid data.
  1862. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found.
  1863. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle.
  1864. // NVAPI_DATA_NOT_FOUND: requested display does not contain an EDID
  1865. //
  1866. ///////////////////////////////////////////////////////////////////////////////
  1867. #define NV_EDID_V1_DATA_SIZE 256
  1868. #define NV_EDID_DATA_SIZE NV_EDID_V1_DATA_SIZE
  1869. typedef struct
  1870. {
  1871. NvU32 version; //structure version
  1872. NvU8 EDID_Data[NV_EDID_DATA_SIZE];
  1873. } NV_EDID_V1;
  1874. typedef struct
  1875. {
  1876. NvU32 version; //structure version
  1877. NvU8 EDID_Data[NV_EDID_DATA_SIZE];
  1878. NvU32 sizeofEDID;
  1879. } NV_EDID_V2;
  1880. typedef struct
  1881. {
  1882. NvU32 version; //structure version
  1883. NvU8 EDID_Data[NV_EDID_DATA_SIZE];
  1884. NvU32 sizeofEDID;
  1885. NvU32 edidId; // edidId is an ID which always returned in a monotonically increasing counter.
  1886. // Across a split-edid read we need to verify that all calls returned the same edidId.
  1887. // This counter is incremented if we get the updated EDID.
  1888. NvU32 offset; // which 256byte page of the EDID we want to read. Start at 0.
  1889. // If the read succeeds with edidSize > NV_EDID_DATA_SIZE
  1890. // call back again with offset+256 until we have read the entire buffer
  1891. } NV_EDID_V3;
  1892. typedef NV_EDID_V3 NV_EDID;
  1893. #define NV_EDID_VER1 MAKE_NVAPI_VERSION(NV_EDID_V1,1)
  1894. #define NV_EDID_VER2 MAKE_NVAPI_VERSION(NV_EDID_V2,2)
  1895. #define NV_EDID_VER3 MAKE_NVAPI_VERSION(NV_EDID_V3,3)
  1896. #define NV_EDID_VER NV_EDID_VER3
  1897. NVAPI_INTERFACE NvAPI_GPU_GetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID);
  1898. ///////////////////////////////////////////////////////////////////////////////
  1899. //
  1900. // FUNCTION NAME: NvAPI_GPU_SetEDID
  1901. //
  1902. // DESCRIPTION: Sets the EDID data for the specified GPU handle and connection bit mask.
  1903. // displayOutputId should have exactly 1 bit set to indicate a single display.
  1904. // Note:The EDID will be cached across boot session and will be enumerated to the OS in this call.
  1905. // To remove the EDID set the sizeofEDID to zero.
  1906. // OS and NVAPI connection status APIs will reflect the newly set or removed EDID dynamically.
  1907. //
  1908. // This feature shall NOT be supported on the following boards:
  1909. // 1. GeForce
  1910. // 2. Quadro VX
  1911. // 3. Tesla
  1912. //
  1913. // SUPPORTED OS: Windows XP and higher
  1914. //
  1915. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pEDID is NULL; displayOutputId has 0 or > 1 bits set
  1916. // NVAPI_OK: *pEDID data was applied to the requested displayOutputId.
  1917. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found.
  1918. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle.
  1919. // NVAPI_NOT_SUPPORTED: for the above mentioned GPUs
  1920. ///////////////////////////////////////////////////////////////////////////////
  1921. NVAPI_INTERFACE NvAPI_GPU_SetEDID(NvPhysicalGpuHandle hPhysicalGpu, NvU32 displayOutputId, NV_EDID *pEDID);
  1922. ///////////////////////////////////////////////////////////////////////////////
  1923. //
  1924. // FUNCTION NAME: NvAPI_GPU_GetOutputType
  1925. //
  1926. // DESCRIPTION: Give a physical GPU handle and a single outputId (exactly 1 bit set), this API
  1927. // returns the output type.
  1928. //
  1929. // SUPPORTED OS: Windows XP and higher
  1930. //
  1931. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu, outputId or pOutputsMask is NULL; or outputId has > 1 bit set
  1932. // NVAPI_OK: *pOutputType contains a NvGpuOutputType value
  1933. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1934. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1935. //
  1936. ///////////////////////////////////////////////////////////////////////////////
  1937. typedef enum _NV_GPU_OUTPUT_TYPE
  1938. {
  1939. NVAPI_GPU_OUTPUT_UNKNOWN = 0,
  1940. NVAPI_GPU_OUTPUT_CRT = 1, // CRT display device
  1941. NVAPI_GPU_OUTPUT_DFP = 2, // Digital Flat Panel display device
  1942. NVAPI_GPU_OUTPUT_TV = 3, // TV display device
  1943. } NV_GPU_OUTPUT_TYPE;
  1944. NVAPI_INTERFACE NvAPI_GPU_GetOutputType(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputId, NV_GPU_OUTPUT_TYPE *pOutputType);
  1945. ///////////////////////////////////////////////////////////////////////////////
  1946. //
  1947. // FUNCTION NAME: NvAPI_GPU_ValidateOutputCombination
  1948. //
  1949. // DESCRIPTION: This call is used to determine if a set of GPU outputs can be active
  1950. // simultaneously. While a GPU may have <n> outputs, they can not typically
  1951. // all be active at the same time due to internal resource sharing.
  1952. //
  1953. // Given a physical GPU handle and a mask of candidate outputs, this call
  1954. // will return NVAPI_OK if all of the specified outputs can be driven
  1955. // simultaneously. It will return NVAPI_INVALID_COMBINATION if they cannot.
  1956. //
  1957. // Use NvAPI_GPU_GetAllOutputs() to determine which outputs are candidates.
  1958. //
  1959. // SUPPORTED OS: Windows XP and higher
  1960. //
  1961. // RETURN STATUS: NVAPI_OK: combination of outputs in outputsMask are valid (can be active simultaneously)
  1962. // NVAPI_INVALID_COMBINATION: combination of outputs in outputsMask are NOT valid
  1963. // NVAPI_INVALID_ARGUMENT: hPhysicalGpu or outputsMask does not have at least 2 bits set
  1964. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1965. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1966. //
  1967. ///////////////////////////////////////////////////////////////////////////////
  1968. NVAPI_INTERFACE NvAPI_GPU_ValidateOutputCombination(NvPhysicalGpuHandle hPhysicalGpu, NvU32 outputsMask);
  1969. typedef enum _NV_GPU_CONNECTOR_TYPE
  1970. {
  1971. NVAPI_GPU_CONNECTOR_VGA_15_PIN = 0x00000000,
  1972. NVAPI_GPU_CONNECTOR_TV_COMPOSITE = 0x00000010,
  1973. NVAPI_GPU_CONNECTOR_TV_SVIDEO = 0x00000011,
  1974. NVAPI_GPU_CONNECTOR_TV_HDTV_COMPONENT = 0x00000013,
  1975. NVAPI_GPU_CONNECTOR_TV_SCART = 0x00000014,
  1976. NVAPI_GPU_CONNECTOR_TV_COMPOSITE_SCART_ON_EIAJ4120 = 0x00000016,
  1977. NVAPI_GPU_CONNECTOR_TV_HDTV_EIAJ4120 = 0x00000017,
  1978. NVAPI_GPU_CONNECTOR_PC_POD_HDTV_YPRPB = 0x00000018,
  1979. NVAPI_GPU_CONNECTOR_PC_POD_SVIDEO = 0x00000019,
  1980. NVAPI_GPU_CONNECTOR_PC_POD_COMPOSITE = 0x0000001A,
  1981. NVAPI_GPU_CONNECTOR_DVI_I_TV_SVIDEO = 0x00000020,
  1982. NVAPI_GPU_CONNECTOR_DVI_I_TV_COMPOSITE = 0x00000021,
  1983. NVAPI_GPU_CONNECTOR_DVI_I = 0x00000030,
  1984. NVAPI_GPU_CONNECTOR_DVI_D = 0x00000031,
  1985. NVAPI_GPU_CONNECTOR_ADC = 0x00000032,
  1986. NVAPI_GPU_CONNECTOR_LFH_DVI_I_1 = 0x00000038,
  1987. NVAPI_GPU_CONNECTOR_LFH_DVI_I_2 = 0x00000039,
  1988. NVAPI_GPU_CONNECTOR_SPWG = 0x00000040,
  1989. NVAPI_GPU_CONNECTOR_OEM = 0x00000041,
  1990. NVAPI_GPU_CONNECTOR_DISPLAYPORT_EXTERNAL = 0x00000046,
  1991. NVAPI_GPU_CONNECTOR_DISPLAYPORT_INTERNAL = 0x00000047,
  1992. NVAPI_GPU_CONNECTOR_DISPLAYPORT_MINI_EXT = 0x00000048,
  1993. NVAPI_GPU_CONNECTOR_HDMI_A = 0x00000061,
  1994. NVAPI_GPU_CONNECTOR_HDMI_C_MINI = 0x00000063,
  1995. NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_1 = 0x00000064,
  1996. NVAPI_GPU_CONNECTOR_LFH_DISPLAYPORT_2 = 0x00000065,
  1997. NVAPI_GPU_CONNECTOR_UNKNOWN = 0xFFFFFFFF,
  1998. } NV_GPU_CONNECTOR_TYPE;
  1999. ///////////////////////////////////////////////////////////////////////////////
  2000. //
  2001. // FUNCTION NAME: NvAPI_GPU_GetFullName
  2002. //
  2003. // DESCRIPTION: Retrieves the full GPU name as an ascii string. Eg: "Quadro FX 1400"
  2004. //
  2005. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2006. //
  2007. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  2008. //
  2009. ///////////////////////////////////////////////////////////////////////////////
  2010. NVAPI_INTERFACE NvAPI_GPU_GetFullName(NvPhysicalGpuHandle hPhysicalGpu, NvAPI_ShortString szName);
  2011. ///////////////////////////////////////////////////////////////////////////////
  2012. //
  2013. // FUNCTION NAME: NvAPI_GPU_GetPCIIdentifiers
  2014. //
  2015. // DESCRIPTION: Returns the PCI identifiers associated with this GPU.
  2016. // DeviceId - the internal PCI device identifier for the GPU.
  2017. // SubSystemId - the internal PCI subsystem identifier for the GPU.
  2018. // RevisionId - the internal PCI device-specific revision identifier for the GPU.
  2019. // ExtDeviceId - the external PCI device identifier for the GPU.
  2020. //
  2021. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2022. //
  2023. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or an argument is NULL
  2024. // NVAPI_OK: arguments are populated with PCI identifiers
  2025. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2026. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2027. //
  2028. ///////////////////////////////////////////////////////////////////////////////
  2029. NVAPI_INTERFACE NvAPI_GPU_GetPCIIdentifiers(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pDeviceId,NvU32 *pSubSystemId,NvU32 *pRevisionId,NvU32 *pExtDeviceId);
  2030. typedef enum _NV_GPU_TYPE
  2031. {
  2032. NV_SYSTEM_TYPE_GPU_UNKNOWN = 0,
  2033. NV_SYSTEM_TYPE_IGPU = 1, //integrated
  2034. NV_SYSTEM_TYPE_DGPU = 2, //discrete
  2035. } NV_GPU_TYPE;
  2036. ///////////////////////////////////////////////////////////////////////////////
  2037. //
  2038. // FUNCTION NAME: NvAPI_GPU_GetGPUType
  2039. //
  2040. // DESCRIPTION: Returns information to identify the GPU type
  2041. //
  2042. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2043. //
  2044. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu
  2045. // NVAPI_OK: *pGpuType contains the GPU type
  2046. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2047. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2048. //
  2049. ///////////////////////////////////////////////////////////////////////////////
  2050. NVAPI_INTERFACE NvAPI_GPU_GetGPUType(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_TYPE *pGpuType);
  2051. typedef enum _NV_GPU_BUS_TYPE
  2052. {
  2053. NVAPI_GPU_BUS_TYPE_UNDEFINED = 0,
  2054. NVAPI_GPU_BUS_TYPE_PCI = 1,
  2055. NVAPI_GPU_BUS_TYPE_AGP = 2,
  2056. NVAPI_GPU_BUS_TYPE_PCI_EXPRESS = 3,
  2057. NVAPI_GPU_BUS_TYPE_FPCI = 4,
  2058. } NV_GPU_BUS_TYPE;
  2059. ///////////////////////////////////////////////////////////////////////////////
  2060. //
  2061. // FUNCTION NAME: NvAPI_GPU_GetBusType
  2062. //
  2063. // DESCRIPTION: Returns the type of bus associated with this GPU.
  2064. //
  2065. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2066. //
  2067. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pBusType is NULL
  2068. // NVAPI_OK: *pBusType contains bus identifier
  2069. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2070. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2071. //
  2072. ///////////////////////////////////////////////////////////////////////////////
  2073. NVAPI_INTERFACE NvAPI_GPU_GetBusType(NvPhysicalGpuHandle hPhysicalGpu,NV_GPU_BUS_TYPE *pBusType);
  2074. ///////////////////////////////////////////////////////////////////////////////
  2075. //
  2076. // FUNCTION NAME: NvAPI_GPU_GetBusId
  2077. //
  2078. // DESCRIPTION: Returns the ID of bus associated with this GPU.
  2079. //
  2080. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2081. //
  2082. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pBusId is NULL
  2083. // NVAPI_OK: *pBusId contains bus id
  2084. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2085. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2086. //
  2087. ///////////////////////////////////////////////////////////////////////////////
  2088. NVAPI_INTERFACE NvAPI_GPU_GetBusId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusId);
  2089. ///////////////////////////////////////////////////////////////////////////////
  2090. //
  2091. // FUNCTION NAME: NvAPI_GPU_GetBusSlotId
  2092. //
  2093. // DESCRIPTION: Returns the ID of bus-slot associated with this GPU.
  2094. //
  2095. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2096. //
  2097. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pBusSlotId is NULL
  2098. // NVAPI_OK: *pBusSlotId contains bus-slot id
  2099. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2100. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2101. //
  2102. ///////////////////////////////////////////////////////////////////////////////
  2103. NVAPI_INTERFACE NvAPI_GPU_GetBusSlotId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBusSlotId);
  2104. ///////////////////////////////////////////////////////////////////////////////
  2105. //
  2106. // FUNCTION NAME: NvAPI_GPU_GetIRQ
  2107. //
  2108. // DESCRIPTION: Returns the interrupt number associated with this GPU.
  2109. //
  2110. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2111. //
  2112. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pIRQ is NULL
  2113. // NVAPI_OK: *pIRQ contains interrupt number
  2114. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2115. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2116. //
  2117. ///////////////////////////////////////////////////////////////////////////////
  2118. NVAPI_INTERFACE NvAPI_GPU_GetIRQ(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pIRQ);
  2119. ///////////////////////////////////////////////////////////////////////////////
  2120. //
  2121. // FUNCTION NAME: NvAPI_GPU_GetVbiosRevision
  2122. //
  2123. // DESCRIPTION: Returns the revision of the video bios associated with this GPU.
  2124. //
  2125. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2126. //
  2127. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pBiosRevision is NULL
  2128. // NVAPI_OK: *pBiosRevision contains revision number
  2129. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2130. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2131. //
  2132. ///////////////////////////////////////////////////////////////////////////////
  2133. NVAPI_INTERFACE NvAPI_GPU_GetVbiosRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pBiosRevision);
  2134. ///////////////////////////////////////////////////////////////////////////////
  2135. //
  2136. // FUNCTION NAME: NvAPI_GPU_GetVbiosOEMRevision
  2137. //
  2138. // DESCRIPTION: Returns the OEM revision of the video bios associated with this GPU.
  2139. //
  2140. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2141. //
  2142. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pBiosRevision is NULL
  2143. // NVAPI_OK: *pBiosRevision contains revision number
  2144. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2145. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2146. //
  2147. ///////////////////////////////////////////////////////////////////////////////
  2148. NVAPI_INTERFACE NvAPI_GPU_GetVbiosOEMRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pBiosRevision);
  2149. ///////////////////////////////////////////////////////////////////////////////
  2150. //
  2151. // FUNCTION NAME: NvAPI_GPU_GetVbiosVersionString
  2152. //
  2153. // DESCRIPTION: Returns the full bios version string in the form of xx.xx.xx.xx.yy where
  2154. // the xx numbers come from NvAPI_GPU_GetVbiosRevision and yy comes from
  2155. // NvAPI_GPU_GetVbiosOEMRevision.
  2156. //
  2157. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2158. //
  2159. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu is NULL
  2160. // NVAPI_OK: szBiosRevision contains version string
  2161. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2162. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2163. //
  2164. ///////////////////////////////////////////////////////////////////////////////
  2165. NVAPI_INTERFACE NvAPI_GPU_GetVbiosVersionString(NvPhysicalGpuHandle hPhysicalGpu,NvAPI_ShortString szBiosRevision);
  2166. ///////////////////////////////////////////////////////////////////////////////
  2167. //
  2168. // FUNCTION NAME: NvAPI_GPU_GetAGPAperture
  2169. //
  2170. // DESCRIPTION: Returns AGP aperture in megabytes
  2171. //
  2172. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2173. //
  2174. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pSize is NULL
  2175. // NVAPI_OK: call successful
  2176. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2177. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2178. //
  2179. ///////////////////////////////////////////////////////////////////////////////
  2180. NVAPI_INTERFACE NvAPI_GPU_GetAGPAperture(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize);
  2181. ///////////////////////////////////////////////////////////////////////////////
  2182. //
  2183. // FUNCTION NAME: NvAPI_GPU_GetCurrentAGPRate
  2184. //
  2185. // DESCRIPTION: Returns the current AGP Rate (1 = 1x, 2=2x etc, 0 = AGP not present)
  2186. //
  2187. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2188. //
  2189. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pRate is NULL
  2190. // NVAPI_OK: call successful
  2191. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2192. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2193. //
  2194. ///////////////////////////////////////////////////////////////////////////////
  2195. NVAPI_INTERFACE NvAPI_GPU_GetCurrentAGPRate(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pRate);
  2196. ///////////////////////////////////////////////////////////////////////////////
  2197. //
  2198. // FUNCTION NAME: NvAPI_GPU_GetCurrentPCIEDownstreamWidth
  2199. //
  2200. // DESCRIPTION: Returns the number of PCIE lanes being used for the PCIE interface
  2201. // downstream from the GPU.
  2202. //
  2203. // On systems that do not support PCIE, the maxspeed for the root link
  2204. // will be zero.
  2205. //
  2206. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2207. //
  2208. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pWidth is NULL
  2209. // NVAPI_OK: call successful
  2210. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2211. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2212. //
  2213. ///////////////////////////////////////////////////////////////////////////////
  2214. NVAPI_INTERFACE NvAPI_GPU_GetCurrentPCIEDownstreamWidth(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pWidth);
  2215. ///////////////////////////////////////////////////////////////////////////////
  2216. //
  2217. // FUNCTION NAME: NvAPI_GPU_GetPhysicalFrameBufferSize
  2218. //
  2219. // DESCRIPTION: Returns the physical size of framebuffer in Kb. This does NOT include any
  2220. // system RAM that may be dedicated for use by the GPU.
  2221. //
  2222. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2223. //
  2224. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pSize is NULL
  2225. // NVAPI_OK: call successful
  2226. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2227. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2228. //
  2229. ///////////////////////////////////////////////////////////////////////////////
  2230. NVAPI_INTERFACE NvAPI_GPU_GetPhysicalFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize);
  2231. ///////////////////////////////////////////////////////////////////////////////
  2232. //
  2233. // FUNCTION NAME: NvAPI_GPU_GetVirtualFrameBufferSize
  2234. //
  2235. // DESCRIPTION: Returns the virtual size of framebuffer in Kb. This includes the physical RAM plus any
  2236. // system RAM that has been dedicated for use by the GPU.
  2237. //
  2238. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2239. //
  2240. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pSize is NULL
  2241. // NVAPI_OK: call successful
  2242. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  2243. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  2244. //
  2245. ///////////////////////////////////////////////////////////////////////////////
  2246. NVAPI_INTERFACE NvAPI_GPU_GetVirtualFrameBufferSize(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pSize);
  2247. typedef struct _NV_BOARD_INFO
  2248. {
  2249. NvU32 version; // structure version
  2250. NvU8 BoardNum[16]; // Board Serial Number
  2251. }NV_BOARD_INFO_V1;
  2252. typedef NV_BOARD_INFO_V1 NV_BOARD_INFO;
  2253. #define NV_BOARD_INFO_VER1 MAKE_NVAPI_VERSION(NV_BOARD_INFO_V1,1)
  2254. #define NV_BOARD_INFO_VER NV_BOARD_INFO_VER1
  2255. // SUPPORTED OS: Windows XP and higher
  2256. ///////////////////////////////////////////////////////////////////////////////
  2257. //
  2258. // FUNCTION NAME: NvAPI_GPU_GetBoardInfo
  2259. //
  2260. // DESCRIPTION: This API Retrieves the Board information (a unique GPU Board Serial Number) stored in the InfoROM.
  2261. //
  2262. // PARAMETERS: hPhysicalGpu(IN) - Physical GPU Handle.
  2263. // NV_BOARD_INFO(IN/OUT) - Board Information.
  2264. //
  2265. // RETURN STATUS:
  2266. // NVAPI_OK - completed request
  2267. // NVAPI_ERROR - miscellaneous error occurred
  2268. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
  2269. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
  2270. // NVAPI_INVALID_POINTER - pBoardInfo is NULL
  2271. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - the version of the INFO struct is not supported
  2272. //
  2273. ///////////////////////////////////////////////////////////////////////////////
  2274. NVAPI_INTERFACE NvAPI_GPU_GetBoardInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_BOARD_INFO *pBoardInfo);
  2275. #define NVAPI_MAX_GPU_UTILIZATIONS 8
  2276. typedef struct
  2277. {
  2278. NvU32 version; // Structure version
  2279. NvU32 flags; // Reserved for future use
  2280. struct
  2281. {
  2282. NvU32 bIsPresent:1; // Set if this utilization domain is present on this GPU
  2283. NvU32 percentage; // Percentage of time where the domain is considered busy in the last 1 second interval
  2284. } utilization[NVAPI_MAX_GPU_UTILIZATIONS];
  2285. } NV_GPU_DYNAMIC_PSTATES_INFO_EX;
  2286. #define NV_GPU_DYNAMIC_PSTATES_INFO_EX_VER MAKE_NVAPI_VERSION(NV_GPU_DYNAMIC_PSTATES_INFO_EX,1)
  2287. ///////////////////////////////////////////////////////////////////////////////
  2288. //
  2289. // FUNCTION NAME: NvAPI_GPU_GetDynamicPstatesInfoEx
  2290. //
  2291. // DESCRIPTION: This retrieves the NV_GPU_DYNAMIC_PSTATES_INFO_EX structure for the specified physical GPU.
  2292. // flags is reserved for future use
  2293. // For each utilization domain:
  2294. // bIsPresent is set for each domain that is present on the GPU
  2295. // percentage is the percentage of time where the domain is considered busy in the last 1 second interval
  2296. //
  2297. // Each domain's info is indexed in the array. For example:
  2298. // pDynamicPstatesInfo->utilization[NVAPI_GPU_UTILIZATION_DOMAIN_GPU] holds the info for the GPU domain
  2299. // There are currently 3 domains, for which GPU utilization and dynamic P-State thresholds can be retrieved
  2300. // graphic engine (GPU), frame buffer (FB), and video engine (VID).
  2301. //
  2302. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2303. //
  2304. // RETURN STATUS:
  2305. // NVAPI_OK - completed request
  2306. // NVAPI_ERROR - miscellaneous error occurred
  2307. // NVAPI_INVALID_ARGUMENT - pDynamicPstatesInfo is NULL
  2308. // NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
  2309. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
  2310. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - the version of the INFO struct is not supported
  2311. //
  2312. ///////////////////////////////////////////////////////////////////////////////
  2313. NVAPI_INTERFACE NvAPI_GPU_GetDynamicPstatesInfoEx(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_DYNAMIC_PSTATES_INFO_EX *pDynamicPstatesInfoEx);
  2314. ///////////////////////////////////////////////////////////////////////////////////
  2315. // Thermal API
  2316. // Provides ability to get temperature levels from the various thermal sensors associated with the GPU
  2317. #define NVAPI_MAX_THERMAL_SENSORS_PER_GPU 3
  2318. typedef enum
  2319. {
  2320. NVAPI_THERMAL_TARGET_NONE = 0,
  2321. NVAPI_THERMAL_TARGET_GPU = 1, //GPU core temperature requires NvPhysicalGpuHandle
  2322. NVAPI_THERMAL_TARGET_MEMORY = 2, //GPU memory temperature requires NvPhysicalGpuHandle
  2323. NVAPI_THERMAL_TARGET_POWER_SUPPLY = 4, //GPU power supply temperature requires NvPhysicalGpuHandle
  2324. NVAPI_THERMAL_TARGET_BOARD = 8, //GPU board ambient temperature requires NvPhysicalGpuHandle
  2325. NVAPI_THERMAL_TARGET_VCD_BOARD = 9, //Visual Computing Device Board temperature requires NvVisualComputingDeviceHandle
  2326. NVAPI_THERMAL_TARGET_VCD_INLET = 10, //Visual Computing Device Inlet temperature requires NvVisualComputingDeviceHandle
  2327. NVAPI_THERMAL_TARGET_VCD_OUTLET = 11, //Visual Computing Device Outlet temperature requires NvVisualComputingDeviceHandle
  2328. NVAPI_THERMAL_TARGET_ALL = 15,
  2329. NVAPI_THERMAL_TARGET_UNKNOWN = -1,
  2330. } NV_THERMAL_TARGET;
  2331. typedef enum
  2332. {
  2333. NVAPI_THERMAL_CONTROLLER_NONE = 0,
  2334. NVAPI_THERMAL_CONTROLLER_GPU_INTERNAL,
  2335. NVAPI_THERMAL_CONTROLLER_ADM1032,
  2336. NVAPI_THERMAL_CONTROLLER_MAX6649,
  2337. NVAPI_THERMAL_CONTROLLER_MAX1617,
  2338. NVAPI_THERMAL_CONTROLLER_LM99,
  2339. NVAPI_THERMAL_CONTROLLER_LM89,
  2340. NVAPI_THERMAL_CONTROLLER_LM64,
  2341. NVAPI_THERMAL_CONTROLLER_ADT7473,
  2342. NVAPI_THERMAL_CONTROLLER_SBMAX6649,
  2343. NVAPI_THERMAL_CONTROLLER_VBIOSEVT,
  2344. NVAPI_THERMAL_CONTROLLER_OS,
  2345. NVAPI_THERMAL_CONTROLLER_UNKNOWN = -1,
  2346. } NV_THERMAL_CONTROLLER;
  2347. typedef struct
  2348. {
  2349. NvU32 version; //structure version
  2350. NvU32 count; //number of associated thermal sensors
  2351. struct
  2352. {
  2353. NV_THERMAL_CONTROLLER controller; //internal, ADM1032, MAX6649...
  2354. NvU32 defaultMinTemp; //the min default temperature value of the thermal sensor in degrees centigrade
  2355. NvU32 defaultMaxTemp; //the max default temperature value of the thermal sensor in degrees centigrade
  2356. NvU32 currentTemp; //the current temperature value of the thermal sensor in degrees centigrade
  2357. NV_THERMAL_TARGET target; //thermal senor targeted @ GPU, memory, chipset, powersupply, Visual Computing Device...
  2358. } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU];
  2359. } NV_GPU_THERMAL_SETTINGS_V1;
  2360. typedef struct
  2361. {
  2362. NvU32 version; //structure version
  2363. NvU32 count; //number of associated thermal sensors
  2364. struct
  2365. {
  2366. NV_THERMAL_CONTROLLER controller; //internal, ADM1032, MAX6649...
  2367. NvS32 defaultMinTemp; //the min default temperature value of the thermal sensor in degrees centigrade
  2368. NvS32 defaultMaxTemp; //the max default temperature value of the thermal sensor in degrees centigrade
  2369. NvS32 currentTemp; //the current temperature value of the thermal sensor in degrees centigrade
  2370. NV_THERMAL_TARGET target; //thermal senor targeted @ GPU, memory, chipset, powersupply, Visual Computing Device...
  2371. } sensor[NVAPI_MAX_THERMAL_SENSORS_PER_GPU];
  2372. } NV_GPU_THERMAL_SETTINGS_V2;
  2373. typedef NV_GPU_THERMAL_SETTINGS_V2 NV_GPU_THERMAL_SETTINGS;
  2374. #define NV_GPU_THERMAL_SETTINGS_VER_1 MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V1,1)
  2375. #define NV_GPU_THERMAL_SETTINGS_VER_2 MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS_V2,2)
  2376. #define NV_GPU_THERMAL_SETTINGS_VER NV_GPU_THERMAL_SETTINGS_VER_2
  2377. ///////////////////////////////////////////////////////////////////////////////
  2378. //
  2379. // FUNCTION NAME: NvAPI_GPU_GetThermalSettings
  2380. //
  2381. // DESCRIPTION: Retrieves the thermal information of all thermal sensors or specific thermal sensor associated with the selected GPU.
  2382. // Thermal sensors are indexed 0 to NVAPI_MAX_THERMAL_SENSORS_PER_GPU-1.
  2383. // To retrieve specific thermal sensor info set the sensorIndex to the required thermal sensor index.
  2384. // To retrieve info for all sensors set sensorIndex to NVAPI_THERMAL_TARGET_ALL.
  2385. //
  2386. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2387. //
  2388. // PARAMETERS : hPhysicalGPU(IN) - GPU selection.
  2389. // sensorIndex(IN) - Explicit thermal sensor index selection.
  2390. // pThermalSettings(OUT) - Array of thermal settings.
  2391. //
  2392. // RETURN STATUS:
  2393. // NVAPI_OK - completed request
  2394. // NVAPI_ERROR - miscellaneous error occurred
  2395. // NVAPI_INVALID_ARGUMENT - pThermalInfo is NULL
  2396. // NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
  2397. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
  2398. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - the version of the INFO struct is not supported
  2399. //
  2400. ///////////////////////////////////////////////////////////////////////////////
  2401. NVAPI_INTERFACE NvAPI_GPU_GetThermalSettings(NvPhysicalGpuHandle hPhysicalGpu, NvU32 sensorIndex, NV_GPU_THERMAL_SETTINGS *pThermalSettings);
  2402. ////////////////////////////////////////////////////////////////////////////////
  2403. //NvAPI_TVOutput Information
  2404. typedef enum _NV_DISPLAY_TV_FORMAT
  2405. {
  2406. NV_DISPLAY_TV_FORMAT_NONE = 0,
  2407. NV_DISPLAY_TV_FORMAT_SD_NTSCM = 0x00000001,
  2408. NV_DISPLAY_TV_FORMAT_SD_NTSCJ = 0x00000002,
  2409. NV_DISPLAY_TV_FORMAT_SD_PALM = 0x00000004,
  2410. NV_DISPLAY_TV_FORMAT_SD_PALBDGH = 0x00000008,
  2411. NV_DISPLAY_TV_FORMAT_SD_PALN = 0x00000010,
  2412. NV_DISPLAY_TV_FORMAT_SD_PALNC = 0x00000020,
  2413. NV_DISPLAY_TV_FORMAT_SD_576i = 0x00000100,
  2414. NV_DISPLAY_TV_FORMAT_SD_480i = 0x00000200,
  2415. NV_DISPLAY_TV_FORMAT_ED_480p = 0x00000400,
  2416. NV_DISPLAY_TV_FORMAT_ED_576p = 0x00000800,
  2417. NV_DISPLAY_TV_FORMAT_HD_720p = 0x00001000,
  2418. NV_DISPLAY_TV_FORMAT_HD_1080i = 0x00002000,
  2419. NV_DISPLAY_TV_FORMAT_HD_1080p = 0x00004000,
  2420. NV_DISPLAY_TV_FORMAT_HD_720p50 = 0x00008000,
  2421. NV_DISPLAY_TV_FORMAT_HD_1080p24 = 0x00010000,
  2422. NV_DISPLAY_TV_FORMAT_HD_1080i50 = 0x00020000,
  2423. NV_DISPLAY_TV_FORMAT_HD_1080p50 = 0x00040000,
  2424. NV_DISPLAY_TV_FORMAT_SD_OTHER = 0x01000000,
  2425. NV_DISPLAY_TV_FORMAT_ED_OTHER = 0x02000000,
  2426. NV_DISPLAY_TV_FORMAT_HD_OTHER = 0x04000000,
  2427. NV_DISPLAY_TV_FORMAT_ANY = 0x80000000,
  2428. } NV_DISPLAY_TV_FORMAT;
  2429. ///////////////////////////////////////////////////////////////////////////////////
  2430. // I2C API
  2431. // Provides ability to read or write data using I2C protocol.
  2432. // These APIs allow I2C access only to DDC monitors.
  2433. #define NVAPI_MAX_SIZEOF_I2C_DATA_BUFFER 4096
  2434. #define NVAPI_MAX_SIZEOF_I2C_REG_ADDRESS 4
  2435. #define NVAPI_DISPLAY_DEVICE_MASK_MAX 24
  2436. typedef struct
  2437. {
  2438. NvU32 version; // The structure version.
  2439. NvU32 displayMask; // The Display Mask of the concerned display.
  2440. NvU8 bIsDDCPort; // This flag indicates either the DDC port (TRUE) or the communication port
  2441. // (FALSE) of the concerned display.
  2442. NvU8 i2cDevAddress; // The address of the I2C slave. The address should be shifted left by one. For
  2443. // example, the I2C address 0x50, often used for reading EDIDs, would be stored
  2444. // here as 0xA0. This matches the position within the byte sent by the master, as
  2445. // the last bit is reserved to specify the read or write direction.
  2446. NvU8* pbI2cRegAddress; // The I2C target register address. May be NULL, which indicates no register
  2447. // address should be sent.
  2448. NvU32 regAddrSize; // The size in bytes of target register address. If pbI2cRegAddress is NULL, this
  2449. // field must be 0.
  2450. NvU8* pbData; // The buffer of data which is to be read or written (depending on the command).
  2451. NvU32 cbSize; // The size of the data buffer, pbData, to be read or written.
  2452. NvU32 i2cSpeed; // The maximum target speed of the transaction in Kpbs. For example, a value of
  2453. // 10 would be interpreted to mean that the driver should attempt to drive the I2C
  2454. // bus at 10 Kpbs, if possible given other speed limitations.
  2455. } NV_I2C_INFO;
  2456. #define NV_I2C_INFO_VER MAKE_NVAPI_VERSION(NV_I2C_INFO,1)
  2457. /***********************************************************************************/
  2458. ///////////////////////////////////////////////////////////////////////////////
  2459. //
  2460. // FUNCTION NAME: NvAPI_I2CRead
  2461. //
  2462. // DESCRIPTION: Read data buffer from I2C port
  2463. //
  2464. // The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1.
  2465. //
  2466. // A data buffer size larger than 16 bytes may be rejected if a register address is specified. In such a case,
  2467. // NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned.
  2468. //
  2469. // If a register address is specified (i.e. regAddrSize is positive), then the transaction will be performed in
  2470. // the combined format described in the I2C specification. The register address will be written, followed by
  2471. // reading into the data buffer.
  2472. //
  2473. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2474. //
  2475. // PARAMETERS: hPhysicalGPU(IN) - GPU selection.
  2476. // NV_I2C_INFO *pI2cInfo - The I2C data input structure.
  2477. //
  2478. // RETURN STATUS:
  2479. // NVAPI_OK - completed request
  2480. // NVAPI_ERROR - miscellaneous error occurred
  2481. // NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
  2482. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
  2483. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - structure version is not supported
  2484. // NVAPI_INVALID_ARGUMENT - argument does not meet specified requirements
  2485. // NVAPI_ARGUMENT_EXCEED_MAX_SIZE - an argument exceeds the maximum
  2486. ///////////////////////////////////////////////////////////////////////////////
  2487. NVAPI_INTERFACE NvAPI_I2CRead(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo);
  2488. ///////////////////////////////////////////////////////////////////////////////
  2489. //
  2490. // FUNCTION NAME: NvAPI_I2CWrite
  2491. //
  2492. // DESCRIPTION: Writes data buffer to I2C port
  2493. //
  2494. // The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1.
  2495. //
  2496. // A data buffer size larger than 16 bytes may be rejected if a register address is specified. In such a case,
  2497. // NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned.
  2498. //
  2499. // If a register address is specified (i.e. regAddrSize is positive), then the register address will be written
  2500. // and the data buffer will immediately follow without a restart.
  2501. //
  2502. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2503. //
  2504. // PARAMETERS: hPhysicalGPU(IN) - GPU selection.
  2505. // NV_I2C_INFO *pI2cInfo -The I2C data input structure.
  2506. //
  2507. // RETURN STATUS:
  2508. // NVAPI_OK - completed request
  2509. // NVAPI_ERROR - miscellaneous error occurred
  2510. // NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
  2511. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
  2512. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - structure version is not supported
  2513. // NVAPI_INVALID_ARGUMENT - argument does not meet specified requirements
  2514. // NVAPI_ARGUMENT_EXCEED_MAX_SIZE - an argument exceeds the maximum
  2515. ///////////////////////////////////////////////////////////////////////////////
  2516. NVAPI_INTERFACE NvAPI_I2CWrite(NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo);
  2517. typedef struct
  2518. {
  2519. NvU32 version; //structure version
  2520. NvU32 vendorId; //vendorId
  2521. NvU32 deviceId; //deviceId
  2522. NvAPI_ShortString szVendorName; //vendor Name
  2523. NvAPI_ShortString szChipsetName; //device Name
  2524. NvU32 flags; //Chipset info flags - obsolete
  2525. NvU32 subSysVendorId; //subsystem vendorId
  2526. NvU32 subSysDeviceId; //subsystem deviceId
  2527. NvAPI_ShortString szSubSysVendorName; //subsystem vendor Name
  2528. } NV_CHIPSET_INFO;
  2529. #define NV_CHIPSET_INFO_VER MAKE_NVAPI_VERSION(NV_CHIPSET_INFO,3)
  2530. typedef enum
  2531. {
  2532. NV_CHIPSET_INFO_HYBRID = 0x00000001,
  2533. } NV_CHIPSET_INFO_FLAGS;
  2534. typedef struct
  2535. {
  2536. NvU32 version; //structure version
  2537. NvU32 vendorId; //vendorId
  2538. NvU32 deviceId; //deviceId
  2539. NvAPI_ShortString szVendorName; //vendor Name
  2540. NvAPI_ShortString szChipsetName; //device Name
  2541. NvU32 flags; //Chipset info flags
  2542. } NV_CHIPSET_INFO_v2;
  2543. #define NV_CHIPSET_INFO_VER_2 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v2,2)
  2544. typedef struct
  2545. {
  2546. NvU32 version; //structure version
  2547. NvU32 vendorId; //vendorId
  2548. NvU32 deviceId; //deviceId
  2549. NvAPI_ShortString szVendorName; //vendor Name
  2550. NvAPI_ShortString szChipsetName; //device Name
  2551. } NV_CHIPSET_INFO_v1;
  2552. #define NV_CHIPSET_INFO_VER_1 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v1,1)
  2553. ///////////////////////////////////////////////////////////////////////////////
  2554. //
  2555. // FUNCTION NAME: NvAPI_SYS_GetChipSetInfo
  2556. //
  2557. // DESCRIPTION: Returns information about the System's ChipSet
  2558. //
  2559. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2560. //
  2561. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pChipSetInfo is NULL
  2562. // NVAPI_OK: *pChipSetInfo is now set
  2563. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - NV_CHIPSET_INFO version not compatible with driver
  2564. //
  2565. ///////////////////////////////////////////////////////////////////////////////
  2566. NVAPI_INTERFACE NvAPI_SYS_GetChipSetInfo(NV_CHIPSET_INFO *pChipSetInfo);
  2567. typedef struct
  2568. {
  2569. NvU32 version; // Structure version, constructed from macro below
  2570. NvU32 currentLidState;
  2571. NvU32 currentDockState;
  2572. NvU32 currentLidPolicy;
  2573. NvU32 currentDockPolicy;
  2574. NvU32 forcedLidMechanismPresent;
  2575. NvU32 forcedDockMechanismPresent;
  2576. }NV_LID_DOCK_PARAMS;
  2577. #define NV_LID_DOCK_PARAMS_VER MAKE_NVAPI_VERSION(NV_LID_DOCK_PARAMS,1)
  2578. ///////////////////////////////////////////////////////////////////////////////
  2579. //
  2580. // FUNCTION NAME: NvAPI_GetLidDockInfo
  2581. //
  2582. // DESCRIPTION: Returns current lid and dock information.
  2583. //
  2584. // SUPPORTED OS: Mac OS X, Windows XP and higher
  2585. //
  2586. // RETURN STATUS: NVAPI_OK: now *pLidAndDock contains the returned lid and dock information.
  2587. // NVAPI_ERROR:If any way call is not success.
  2588. // NVAPI_NOT_SUPPORTED:If any way call is not success.
  2589. // NVAPI_HANDLE_INVALIDATED:If nvapi escape result handle is invalid.
  2590. // NVAPI_API_NOT_INTIALIZED:If NVAPI is not initialized.
  2591. //
  2592. ///////////////////////////////////////////////////////////////////////////////
  2593. NVAPI_INTERFACE NvAPI_SYS_GetLidAndDockInfo(NV_LID_DOCK_PARAMS *pLidAndDock);
  2594. ///////////////////////////////////////////////////////////////////////////////
  2595. //
  2596. // FUNCTION NAME: NvAPI_OGL_ExpertModeSet[Get]
  2597. //
  2598. // DESCRIPTION: Configure OpenGL Expert Mode, an API usage feedback and
  2599. // advice reporting mechanism. The effects of this call are
  2600. // applied only to the current context, and are reset to the
  2601. // defaults when the context is destroyed.
  2602. //
  2603. // Note: This feature is valid at runtime only when GLExpert
  2604. // functionality has been built into the OpenGL driver
  2605. // installed on the system. All Windows Vista OpenGL
  2606. // drivers provided by NVIDIA have this instrumentation
  2607. // included by default. Windows XP, however, requires a
  2608. // special display driver available with the NVIDIA
  2609. // PerfSDK found at developer.nvidia.com.
  2610. //
  2611. // Note: These functions are valid only for the current OpenGL
  2612. // context. Calling these functions prior to creating a
  2613. // context and calling MakeCurrent with it will result
  2614. // in errors and undefined behavior.
  2615. //
  2616. // PARAMETERS: expertDetailMask Mask made up of NVAPI_OGLEXPERT_DETAIL bits,
  2617. // this parameter specifies the detail level in
  2618. // the feedback stream.
  2619. //
  2620. // expertReportMask Mask made up of NVAPI_OGLEXPERT_REPORT bits,
  2621. // this parameter specifies the areas of
  2622. // functional interest.
  2623. //
  2624. // expertOutputMask Mask made up of NVAPI_OGLEXPERT_OUTPUT bits,
  2625. // this parameter specifies the feedback output
  2626. // location.
  2627. //
  2628. // expertCallback Used in conjunction with OUTPUT_TO_CALLBACK,
  2629. // this is a simple callback function the user
  2630. // may use to obtain the feedback stream. The
  2631. // function will be called once per fully
  2632. // qualified feedback stream entry.
  2633. //
  2634. // RETURN STATUS: NVAPI_API_NOT_INTIALIZED : NVAPI not initialized
  2635. // NVAPI_NVIDIA_DEVICE_NOT_FOUND : no NVIDIA GPU found
  2636. // NVAPI_OPENGL_CONTEXT_NOT_CURRENT : no NVIDIA OpenGL context
  2637. // which supports GLExpert
  2638. // has been made current
  2639. // NVAPI_ERROR : OpenGL driver failed to load properly
  2640. // NVAPI_OK : success
  2641. //
  2642. ///////////////////////////////////////////////////////////////////////////////
  2643. #define NVAPI_OGLEXPERT_DETAIL_NONE 0x00000000
  2644. #define NVAPI_OGLEXPERT_DETAIL_ERROR 0x00000001
  2645. #define NVAPI_OGLEXPERT_DETAIL_SWFALLBACK 0x00000002
  2646. #define NVAPI_OGLEXPERT_DETAIL_BASIC_INFO 0x00000004
  2647. #define NVAPI_OGLEXPERT_DETAIL_DETAILED_INFO 0x00000008
  2648. #define NVAPI_OGLEXPERT_DETAIL_PERFORMANCE_WARNING 0x00000010
  2649. #define NVAPI_OGLEXPERT_DETAIL_QUALITY_WARNING 0x00000020
  2650. #define NVAPI_OGLEXPERT_DETAIL_USAGE_WARNING 0x00000040
  2651. #define NVAPI_OGLEXPERT_DETAIL_ALL 0xFFFFFFFF
  2652. #define NVAPI_OGLEXPERT_REPORT_NONE 0x00000000
  2653. #define NVAPI_OGLEXPERT_REPORT_ERROR 0x00000001
  2654. #define NVAPI_OGLEXPERT_REPORT_SWFALLBACK 0x00000002
  2655. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_VERTEX 0x00000004
  2656. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_GEOMETRY 0x00000008
  2657. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_XFB 0x00000010
  2658. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_RASTER 0x00000020
  2659. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAGMENT 0x00000040
  2660. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_ROP 0x00000080
  2661. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAMEBUFFER 0x00000100
  2662. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_PIXEL 0x00000200
  2663. #define NVAPI_OGLEXPERT_REPORT_PIPELINE_TEXTURE 0x00000400
  2664. #define NVAPI_OGLEXPERT_REPORT_OBJECT_BUFFEROBJECT 0x00000800
  2665. #define NVAPI_OGLEXPERT_REPORT_OBJECT_TEXTURE 0x00001000
  2666. #define NVAPI_OGLEXPERT_REPORT_OBJECT_PROGRAM 0x00002000
  2667. #define NVAPI_OGLEXPERT_REPORT_OBJECT_FBO 0x00004000
  2668. #define NVAPI_OGLEXPERT_REPORT_FEATURE_SLI 0x00008000
  2669. #define NVAPI_OGLEXPERT_REPORT_ALL 0xFFFFFFFF
  2670. #define NVAPI_OGLEXPERT_OUTPUT_TO_NONE 0x00000000
  2671. #define NVAPI_OGLEXPERT_OUTPUT_TO_CONSOLE 0x00000001
  2672. #define NVAPI_OGLEXPERT_OUTPUT_TO_DEBUGGER 0x00000004
  2673. #define NVAPI_OGLEXPERT_OUTPUT_TO_CALLBACK 0x00000008
  2674. #define NVAPI_OGLEXPERT_OUTPUT_TO_ALL 0xFFFFFFFF
  2675. ///////////////////////////////////////////////////////////////////////////////
  2676. //
  2677. // FUNCTION TYPE: NVAPI_OGLEXPERT_CALLBACK
  2678. //
  2679. // DESCRIPTION: Used in conjunction with OUTPUT_TO_CALLBACK, this is a simple
  2680. // callback function the user may use to obtain the feedback
  2681. // stream. The function will be called once per fully qualified
  2682. // feedback stream entry.
  2683. //
  2684. // PARAMETERS: categoryId Contains the bit from the NVAPI_OGLEXPERT_REPORT
  2685. // mask that corresponds to the current message
  2686. // messageId Unique Id for the current message
  2687. // detailLevel Contains the bit from the NVAPI_OGLEXPERT_DETAIL
  2688. // mask that corresponds to the current message
  2689. // objectId Unique Id of the object that corresponds to the
  2690. // current message
  2691. // messageStr Text string from the current message
  2692. //
  2693. ///////////////////////////////////////////////////////////////////////////////
  2694. typedef void (* NVAPI_OGLEXPERT_CALLBACK) (unsigned int categoryId, unsigned int messageId, unsigned int detailLevel, int objectId, const char *messageStr);
  2695. // SUPPORTED OS: Windows XP and higher
  2696. NVAPI_INTERFACE NvAPI_OGL_ExpertModeSet(NvU32 expertDetailLevel,
  2697. NvU32 expertReportMask,
  2698. NvU32 expertOutputMask,
  2699. NVAPI_OGLEXPERT_CALLBACK expertCallback);
  2700. // SUPPORTED OS: Windows XP and higher
  2701. NVAPI_INTERFACE NvAPI_OGL_ExpertModeGet(NvU32 *pExpertDetailLevel,
  2702. NvU32 *pExpertReportMask,
  2703. NvU32 *pExpertOutputMask,
  2704. NVAPI_OGLEXPERT_CALLBACK *pExpertCallback);
  2705. ///////////////////////////////////////////////////////////////////////////////
  2706. //
  2707. // FUNCTION NAME: NvAPI_OGL_ExpertModeDefaultsSet[Get]
  2708. //
  2709. // DESCRIPTION: Configure OpenGL Expert Mode global defaults. These settings
  2710. // apply to any OpenGL application which starts up after these
  2711. // values are applied (i.e. these settings *do not* apply to
  2712. // currently running applications).
  2713. //
  2714. // PARAMETERS: expertDetailLevel Value which specifies the detail level in
  2715. // the feedback stream. This is a mask made up
  2716. // of NVAPI_OGLEXPERT_LEVEL bits.
  2717. //
  2718. // expertReportMask Mask made up of NVAPI_OGLEXPERT_REPORT bits,
  2719. // this parameter specifies the areas of
  2720. // functional interest.
  2721. //
  2722. // expertOutputMask Mask made up of NVAPI_OGLEXPERT_OUTPUT bits,
  2723. // this parameter specifies the feedback output
  2724. // location. Note that using OUTPUT_TO_CALLBACK
  2725. // here is meaningless and has no effect, but
  2726. // using it will not cause an error.
  2727. //
  2728. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  2729. //
  2730. ///////////////////////////////////////////////////////////////////////////////
  2731. // SUPPORTED OS: Windows XP and higher
  2732. NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsSet(NvU32 expertDetailLevel,
  2733. NvU32 expertReportMask,
  2734. NvU32 expertOutputMask);
  2735. // SUPPORTED OS: Windows XP and higher
  2736. NVAPI_INTERFACE NvAPI_OGL_ExpertModeDefaultsGet(NvU32 *pExpertDetailLevel,
  2737. NvU32 *pExpertReportMask,
  2738. NvU32 *pExpertOutputMask);
  2739. #define NVAPI_MAX_VIEW_TARGET 2
  2740. #define NVAPI_ADVANCED_MAX_VIEW_TARGET 4
  2741. #ifndef _NV_TARGET_VIEW_MODE_
  2742. #define _NV_TARGET_VIEW_MODE_
  2743. typedef enum _NV_TARGET_VIEW_MODE
  2744. {
  2745. NV_VIEW_MODE_STANDARD = 0,
  2746. NV_VIEW_MODE_CLONE = 1,
  2747. NV_VIEW_MODE_HSPAN = 2,
  2748. NV_VIEW_MODE_VSPAN = 3,
  2749. NV_VIEW_MODE_DUALVIEW = 4,
  2750. NV_VIEW_MODE_MULTIVIEW = 5,
  2751. } NV_TARGET_VIEW_MODE;
  2752. #endif
  2753. // Following definitions are used in NvAPI_SetViewEx.
  2754. // Scaling modes
  2755. typedef enum _NV_SCALING
  2756. {
  2757. NV_SCALING_DEFAULT = 0, // No change
  2758. // New Scaling Declarations
  2759. NV_SCALING_GPU_SCALING_TO_CLOSEST = 1, // Balanced - Full Screen
  2760. NV_SCALING_GPU_SCALING_TO_NATIVE = 2, // Force GPU - Full Screen
  2761. NV_SCALING_GPU_SCANOUT_TO_NATIVE = 3, // Force GPU - Centered\No Scaling
  2762. NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE = 5, // Force GPU - Aspect Ratio
  2763. NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_CLOSEST = 6, // Balanced - Aspect Ratio
  2764. NV_SCALING_GPU_SCANOUT_TO_CLOSEST = 7, // Balanced - Centered\No Scaling
  2765. // Legacy Declarations
  2766. NV_SCALING_MONITOR_SCALING = NV_SCALING_GPU_SCALING_TO_CLOSEST,
  2767. NV_SCALING_ADAPTER_SCALING = NV_SCALING_GPU_SCALING_TO_NATIVE,
  2768. NV_SCALING_CENTERED = NV_SCALING_GPU_SCANOUT_TO_NATIVE,
  2769. NV_SCALING_ASPECT_SCALING = NV_SCALING_GPU_SCALING_TO_ASPECT_SCANOUT_TO_NATIVE,
  2770. NV_SCALING_CUSTOMIZED = 255 // For future use
  2771. } NV_SCALING;
  2772. // Rotate modes
  2773. typedef enum _NV_ROTATE
  2774. {
  2775. NV_ROTATE_0 = 0,
  2776. NV_ROTATE_90 = 1,
  2777. NV_ROTATE_180 = 2,
  2778. NV_ROTATE_270 = 3,
  2779. NV_ROTATE_IGNORED = 4,
  2780. } NV_ROTATE;
  2781. // Color formats
  2782. #define NVFORMAT_MAKEFOURCC(ch0, ch1, ch2, ch3) \
  2783. ((NvU32)(NvU8)(ch0) | ((NvU32)(NvU8)(ch1) << 8) | \
  2784. ((NvU32)(NvU8)(ch2) << 16) | ((NvU32)(NvU8)(ch3) << 24 ))
  2785. typedef enum _NV_FORMAT
  2786. {
  2787. NV_FORMAT_UNKNOWN = 0, // unknown. Driver will choose one as following value.
  2788. NV_FORMAT_P8 = 41, // for 8bpp mode
  2789. NV_FORMAT_R5G6B5 = 23, // for 16bpp mode
  2790. NV_FORMAT_A8R8G8B8 = 21, // for 32bpp mode
  2791. NV_FORMAT_A16B16G16R16F = 113, // for 64bpp(floating point) mode.
  2792. } NV_FORMAT;
  2793. // TV standard
  2794. ///////////////////////////////////////////////////////////////////////////////
  2795. // FUNCTION NAME: NvAPI_SetView
  2796. //
  2797. // DESCRIPTION: This API lets caller to modify target display arrangement for selected source display handle in any of the nview modes.
  2798. // It also allows to modify or extend the source display in dualview mode.
  2799. // Note: Maps the selected source to the associated target Ids.
  2800. // Note: Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API.
  2801. //
  2802. // SUPPORTED OS: Windows Vista and higher
  2803. //
  2804. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. NVAPI_DEFAULT_HANDLE not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
  2805. // pTargetInfo(IN) - Pointer to array of NV_VIEW_TARGET_INFO, specifying device properties in this view.
  2806. // The first device entry in the array is the physical primary.
  2807. // The device entry with the lowest source id is the desktop primary.
  2808. // targetCount(IN) - Count of target devices specified in pTargetInfo.
  2809. // targetView(IN) - Target view selected from NV_TARGET_VIEW_MODE.
  2810. //
  2811. // RETURN STATUS:
  2812. // NVAPI_OK - completed request
  2813. // NVAPI_ERROR - miscellaneous error occurred
  2814. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  2815. //
  2816. ///////////////////////////////////////////////////////////////////////////////
  2817. typedef struct
  2818. {
  2819. NvU32 version; // (IN) structure version
  2820. NvU32 count; // (IN) target count
  2821. struct
  2822. {
  2823. NvU32 deviceMask; // (IN/OUT) device mask
  2824. NvU32 sourceId; // (IN/OUT) Values will be based on the number of heads exposed per GPU(0, 1?).
  2825. NvU32 bPrimary:1; // (OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary.
  2826. // NvAPI_SetView automatically selects the first target in NV_VIEW_TARGET_INFO index 0 as the GPU's primary view.
  2827. NvU32 bInterlaced:1;// (IN/OUT) Indicates if the timing being used on this monitor is interlaced
  2828. NvU32 bGDIPrimary:1;// (IN/OUT) Indicates if this is the desktop GDI primary.
  2829. 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.
  2830. } target[NVAPI_MAX_VIEW_TARGET];
  2831. } NV_VIEW_TARGET_INFO;
  2832. #define NV_VIEW_TARGET_INFO_VER MAKE_NVAPI_VERSION(NV_VIEW_TARGET_INFO,2)
  2833. NVAPI_INTERFACE NvAPI_SetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargetInfo, NV_TARGET_VIEW_MODE targetView);
  2834. ///////////////////////////////////////////////////////////////////////////////
  2835. // FUNCTION NAME: NvAPI_GetView
  2836. //
  2837. // DESCRIPTION: This API lets caller retrieve the target display arrangement for selected source display handle.
  2838. // Note: Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW.
  2839. // Please use NvAPI_SYS_GetDisplayTopologies to query views across GPUs.
  2840. // SUPPORTED OS: Windows Vista and higher
  2841. //
  2842. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. NVAPI_DEFAULT_HANDLE not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
  2843. // pTargetInfo(OUT) - User allocated storage to retrieve an array of NV_VIEW_TARGET_INFO. Can be NULL to retrieve the targetCount.
  2844. // targetMaskCount(IN/OUT) - Count of target device mask specified in pTargetMask.
  2845. // targetView(OUT) - Target view selected from NV_TARGET_VIEW_MODE.
  2846. //
  2847. // RETURN STATUS:
  2848. // NVAPI_OK - completed request
  2849. // NVAPI_ERROR - miscellaneous error occurred
  2850. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  2851. //
  2852. ///////////////////////////////////////////////////////////////////////////////
  2853. NVAPI_INTERFACE NvAPI_GetView(NvDisplayHandle hNvDisplay, NV_VIEW_TARGET_INFO *pTargets, NvU32 *pTargetMaskCount, NV_TARGET_VIEW_MODE *pTargetView);
  2854. ///////////////////////////////////////////////////////////////////////////////
  2855. // FUNCTION NAME: NvAPI_SetViewEx
  2856. //
  2857. // DESCRIPTION: This API lets caller to modify the display arrangement for selected source display handle in any of the nview modes.
  2858. // It also allows to modify or extend the source display in dualview mode.
  2859. // Note: Maps the selected source to the associated target Ids.
  2860. // Note: Display PATH with this API is limited to single GPU. DUALVIEW across GPUs cannot be enabled with this API.
  2861. //
  2862. // SUPPORTED OS: Windows Vista and higher
  2863. //
  2864. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. NVAPI_DEFAULT_HANDLE not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
  2865. // pPathInfo(IN) - Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view.
  2866. // The first device entry in the array is the physical primary.
  2867. // The device entry with the lowest source id is the desktop primary.
  2868. // pathCount(IN) - Count of paths specified in pPathInfo.
  2869. // displayView(IN)- Display view selected from NV_TARGET_VIEW_MODE.
  2870. //
  2871. // RETURN STATUS:
  2872. // NVAPI_OK - completed request
  2873. // NVAPI_ERROR - miscellaneous error occurred
  2874. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  2875. //
  2876. ///////////////////////////////////////////////////////////////////////////////
  2877. #define NVAPI_MAX_DISPLAY_PATH NVAPI_MAX_VIEW_TARGET
  2878. #define NVAPI_ADVANCED_MAX_DISPLAY_PATH NVAPI_ADVANCED_MAX_VIEW_TARGET
  2879. typedef struct
  2880. {
  2881. NvU32 deviceMask; // (IN) device mask
  2882. NvU32 sourceId; // (IN) Values will be based on the number of heads exposed per GPU(0, 1?)
  2883. NvU32 bPrimary:1; // (IN/OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary.
  2884. // NvAPI_SetViewEx automatically selects the first target in NV_DISPLAY_PATH_INFO index 0 as the GPU's primary view.
  2885. NV_GPU_CONNECTOR_TYPE connector; // (IN) Specify connector type. For TV only.
  2886. // source mode information
  2887. NvU32 width; // (IN) width of the mode
  2888. NvU32 height; // (IN) height of the mode
  2889. NvU32 depth; // (IN) depth of the mode
  2890. NV_FORMAT colorFormat; // color format if needs to specify. Not used now.
  2891. //rotation setting of the mode
  2892. NV_ROTATE rotation; // (IN) rotation setting.
  2893. // the scaling mode
  2894. NV_SCALING scaling; // (IN) scaling setting
  2895. // Timing info
  2896. NvU32 refreshRate; // (IN) refresh rate of the mode
  2897. NvU32 interlaced:1; // (IN) interlaced mode flag
  2898. NV_DISPLAY_TV_FORMAT tvFormat; // (IN) to choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE
  2899. // Windows desktop position
  2900. NvU32 posx; // (IN/OUT) x offset of this display on the Windows desktop
  2901. NvU32 posy; // (IN/OUT) y offset of this display on the Windows desktop
  2902. NvU32 bGDIPrimary:1; // (IN/OUT) Indicates if this is the desktop GDI primary.
  2903. 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.
  2904. NvU32 bFocusDisplay:1;// (IN) If set, this display path should have the focus after the GPU topology change
  2905. 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)
  2906. } NV_DISPLAY_PATH;
  2907. typedef struct
  2908. {
  2909. NvU32 version; // (IN) structure version
  2910. NvU32 count; // (IN) path count
  2911. NV_DISPLAY_PATH path[NVAPI_MAX_DISPLAY_PATH];
  2912. } NV_DISPLAY_PATH_INFO;
  2913. #define NV_DISPLAY_PATH_INFO_VER NV_DISPLAY_PATH_INFO_VER3
  2914. #define NV_DISPLAY_PATH_INFO_VER3 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,3)
  2915. #define NV_DISPLAY_PATH_INFO_VER2 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,2)
  2916. #define NV_DISPLAY_PATH_INFO_VER1 MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,1)
  2917. NVAPI_INTERFACE NvAPI_SetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NV_TARGET_VIEW_MODE displayView);
  2918. ///////////////////////////////////////////////////////////////////////////////
  2919. // FUNCTION NAME: NvAPI_GetViewEx
  2920. //
  2921. // DESCRIPTION: This API lets caller retrieve the target display arrangement for selected source display handle.
  2922. // Note: Display PATH with this API is limited to single GPU. DUALVIEW across GPUs will be returned as STANDARD VIEW.
  2923. // Please use NvAPI_SYS_GetDisplayTopologies to query views across GPUs.
  2924. //
  2925. // SUPPORTED OS: Windows Vista and higher
  2926. //
  2927. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. NVAPI_DEFAULT_HANDLE not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
  2928. // pPathInfo(IN/OUT) - count field should be set to NVAPI_MAX_DISPLAY_PATH. Can be NULL to retrieve just the pathCount.
  2929. // pPathCount(IN/OUT) - Number of elements in array pPathInfo->path.
  2930. // pTargetViewMode(OUT)- Display view selected from NV_TARGET_VIEW_MODE.
  2931. //
  2932. // RETURN STATUS:
  2933. // NVAPI_OK - completed request
  2934. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
  2935. // NVAPI_ERROR - miscellaneous error occurred
  2936. // NVAPI_INVALID_ARGUMENT - Invalid input parameter.
  2937. // NVAPI_EXPECTED_DISPLAY_HANDLE - hNvDisplay is not a valid display handle.
  2938. //
  2939. ///////////////////////////////////////////////////////////////////////////////
  2940. NVAPI_INTERFACE NvAPI_GetViewEx(NvDisplayHandle hNvDisplay, NV_DISPLAY_PATH_INFO *pPathInfo, NvU32 *pPathCount, NV_TARGET_VIEW_MODE *pTargetViewMode);
  2941. ///////////////////////////////////////////////////////////////////////////////
  2942. // FUNCTION NAME: NvAPI_GetSupportedViews
  2943. //
  2944. // DESCRIPTION: This API lets caller enumerate all the supported NVIDIA display views - nview and dualview modes.
  2945. //
  2946. // SUPPORTED OS: Windows XP and higher
  2947. //
  2948. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  2949. // pTargetViews(OUT) - Array of supported views. Can be NULL to retrieve the pViewCount first.
  2950. // pViewCount(IN/OUT) - Count of supported views.
  2951. //
  2952. // RETURN STATUS:
  2953. // NVAPI_OK - completed request
  2954. // NVAPI_ERROR - miscellaneous error occurred
  2955. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  2956. //
  2957. ///////////////////////////////////////////////////////////////////////////////
  2958. NVAPI_INTERFACE NvAPI_GetSupportedViews(NvDisplayHandle hNvDisplay, NV_TARGET_VIEW_MODE *pTargetViews, NvU32 *pViewCount);
  2959. ////////////////////////////////////////////////////////////////////////////////////////
  2960. //
  2961. // MOSAIC allows a multi display target output scanout on a single source.
  2962. //
  2963. // SAMPLE of MOSAIC 1x4 topo with 8 pixel horizontal overlap
  2964. //
  2965. //+-------------------------++-------------------------++-------------------------++-------------------------+
  2966. //| || || || |
  2967. //| || || || |
  2968. //| || || || |
  2969. //| DVI1 || DVI2 || DVI3 || DVI4 |
  2970. //| || || || |
  2971. //| || || || |
  2972. //| || || || |
  2973. //| || || || |
  2974. //+-------------------------++-------------------------++-------------------------++-------------------------+
  2975. #define NVAPI_MAX_MOSAIC_DISPLAY_ROWS 8
  2976. #define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS 8
  2977. #define NV_MOSAIC_MAX_DISPLAYS (64)
  2978. //
  2979. // These bits are used to describe the validity of a topo.
  2980. //
  2981. #define NV_MOSAIC_TOPO_VALIDITY_VALID 0x00000000 // The topo is valid
  2982. #define NV_MOSAIC_TOPO_VALIDITY_MISSING_GPU 0x00000001 // Not enough SLI GPUs were found to fill the entire
  2983. // topo. hPhysicalGPU will be 0 for these.
  2984. #define NV_MOSAIC_TOPO_VALIDITY_MISSING_DISPLAY 0x00000002 // Not enough displays were found to fill the entire
  2985. // topo. displayOutputId will be 0 for these.
  2986. #define NV_MOSAIC_TOPO_VALIDITY_MIXED_DISPLAY_TYPES 0x00000004 // Topo is only possible with displays of the same
  2987. // NV_GPU_OUTPUT_TYPE. Check displayOutputIds to make
  2988. // sure they are all CRT, or all DFP.
  2989. //
  2990. // This structure defines the details of a topo.
  2991. //
  2992. typedef struct
  2993. {
  2994. NvU32 version; // version of this structure
  2995. NvLogicalGpuHandle hLogicalGPU; // logical gpu this topo is for
  2996. NvU32 validityMask; // 0 means topo is valid with current hardware.
  2997. // If not 0, inspect bits against NV_MOSAIC_TOPO_VALIDITY_*.
  2998. NvU32 rowCount; // number of displays in a row
  2999. NvU32 colCount; // number of displays in a column
  3000. struct
  3001. {
  3002. NvPhysicalGpuHandle hPhysicalGPU; // physical gpu to be used in the topo (0 if GPU missing)
  3003. NvU32 displayOutputId; // connected display target (0 if no display connected)
  3004. NvS32 overlapX; // pixels of overlap on left of target: (+overlap, -gap)
  3005. NvS32 overlapY; // pixels of overlap on top of target: (+overlap, -gap)
  3006. } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS];
  3007. } NV_MOSAIC_TOPO_DETAILS;
  3008. #define NVAPI_MOSAIC_TOPO_DETAILS_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_DETAILS,1)
  3009. //
  3010. // These values refer to the different types of Mosaic topos that are possible. When
  3011. // getting the supported Mosaic topos, you can specify one of these types to narrow down
  3012. // the returned list to only those that match the given type.
  3013. //
  3014. typedef enum
  3015. {
  3016. NV_MOSAIC_TOPO_TYPE_ALL, // All mosaic topos
  3017. NV_MOSAIC_TOPO_TYPE_BASIC, // Basic Mosaic topos
  3018. NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO, // Passive Stereo topos
  3019. NV_MOSAIC_TOPO_TYPE_SCALED_CLONE, // Not supported at this time
  3020. NV_MOSAIC_TOPO_TYPE_PASSIVE_STEREO_SCALED_CLONE, // Not supported at this time
  3021. NV_MOSAIC_TOPO_TYPE_MAX, // Always leave this at end of enum
  3022. } NV_MOSAIC_TOPO_TYPE;
  3023. //
  3024. // The complete list of supported Mosaic topos.
  3025. //
  3026. // NOTE: common\inc\nvEscDef.h shadows a couple PASSIVE_STEREO enums. If this
  3027. // enum list changes and effects the value of NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO
  3028. // please update the corresponding value in nvEscDef.h
  3029. //
  3030. typedef enum
  3031. {
  3032. NV_MOSAIC_TOPO_NONE,
  3033. // 'BASIC' topos start here
  3034. //
  3035. // The result of using one of these Mosaic topos is that multiple monitors
  3036. // will combine to create a single desktop.
  3037. //
  3038. NV_MOSAIC_TOPO_BEGIN_BASIC,
  3039. NV_MOSAIC_TOPO_1x2_BASIC = NV_MOSAIC_TOPO_BEGIN_BASIC,
  3040. NV_MOSAIC_TOPO_2x1_BASIC,
  3041. NV_MOSAIC_TOPO_1x3_BASIC,
  3042. NV_MOSAIC_TOPO_3x1_BASIC,
  3043. NV_MOSAIC_TOPO_1x4_BASIC,
  3044. NV_MOSAIC_TOPO_4x1_BASIC,
  3045. NV_MOSAIC_TOPO_2x2_BASIC,
  3046. NV_MOSAIC_TOPO_2x3_BASIC,
  3047. NV_MOSAIC_TOPO_2x4_BASIC,
  3048. NV_MOSAIC_TOPO_3x2_BASIC,
  3049. NV_MOSAIC_TOPO_4x2_BASIC,
  3050. NV_MOSAIC_TOPO_1x5_BASIC,
  3051. NV_MOSAIC_TOPO_1x6_BASIC,
  3052. NV_MOSAIC_TOPO_7x1_BASIC,
  3053. // Add padding for 10 more entries. 6 will be enough room to specify every
  3054. // possible topology with 8 or fewer displays, so this gives us a little
  3055. // extra should we need it.
  3056. NV_MOSAIC_TOPO_END_BASIC = NV_MOSAIC_TOPO_7x1_BASIC + 9,
  3057. // 'PASSIVE_STEREO' topos start here
  3058. //
  3059. // The result of using one of these Mosaic topos is that multiple monitors
  3060. // will combine to create a single PASSIVE STEREO desktop. What this means is
  3061. // that there will be two topos that combine to create the overall desktop.
  3062. // One topo will be used for the left eye, and the other topo (of the
  3063. // same rows x cols), will be used for the right eye. The difference between
  3064. // the two topos is that different GPUs and displays will be used.
  3065. //
  3066. NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO, // value shadowed in nvEscDef.h
  3067. NV_MOSAIC_TOPO_1x2_PASSIVE_STEREO = NV_MOSAIC_TOPO_BEGIN_PASSIVE_STEREO,
  3068. NV_MOSAIC_TOPO_2x1_PASSIVE_STEREO,
  3069. NV_MOSAIC_TOPO_1x3_PASSIVE_STEREO,
  3070. NV_MOSAIC_TOPO_3x1_PASSIVE_STEREO,
  3071. NV_MOSAIC_TOPO_1x4_PASSIVE_STEREO,
  3072. NV_MOSAIC_TOPO_4x1_PASSIVE_STEREO,
  3073. NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO,
  3074. NV_MOSAIC_TOPO_END_PASSIVE_STEREO = NV_MOSAIC_TOPO_2x2_PASSIVE_STEREO + 4,
  3075. //
  3076. // Total number of topos. Always leave this at the end of the enumeration.
  3077. //
  3078. NV_MOSAIC_TOPO_MAX
  3079. } NV_MOSAIC_TOPO;
  3080. //
  3081. // This is a topo brief structure. It tells you what you need to know about
  3082. // a topo at a high level. A list of these is returned when you query for the
  3083. // supported Mosaic information.
  3084. //
  3085. // If you need more detailed information about the topo, call
  3086. // NvAPI_Mosaic_GetTopoGroup() with the topo value from this structure.
  3087. //
  3088. typedef struct
  3089. {
  3090. NvU32 version; // version of this structure
  3091. NV_MOSAIC_TOPO topo; // the topo
  3092. NvU32 enabled; // 1 if topo is enabled, else 0
  3093. NvU32 isPossible; // 1 if topo *can* be enabled, else 0
  3094. } NV_MOSAIC_TOPO_BRIEF;
  3095. #define NVAPI_MOSAIC_TOPO_BRIEF_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_BRIEF,1)
  3096. //
  3097. // Basic per display settings that are used in setting/getting the Mosaic mode
  3098. //
  3099. typedef struct
  3100. {
  3101. NvU32 version; // version of this structure
  3102. NvU32 width; // per display width
  3103. NvU32 height; // per display height
  3104. NvU32 bpp; // bits per pixel
  3105. NvU32 freq; // display frequency
  3106. } NV_MOSAIC_DISPLAY_SETTING;
  3107. #define NVAPI_MOSAIC_DISPLAY_SETTING_VER MAKE_NVAPI_VERSION(NV_MOSAIC_DISPLAY_SETTING,1)
  3108. //
  3109. // Set a reasonable max number of display settings to support
  3110. // so arrays are bound.
  3111. //
  3112. #define NV_MOSAIC_DISPLAY_SETTINGS_MAX 40
  3113. //
  3114. // This structure is used to contain a list of supported Mosaic topos
  3115. // along with the display settings that can be used.
  3116. //
  3117. typedef struct
  3118. {
  3119. NvU32 version; // version of this structure
  3120. NvU32 topoBriefsCount; // number of topos in below array
  3121. NV_MOSAIC_TOPO_BRIEF topoBriefs[NV_MOSAIC_TOPO_MAX]; // list of supported topos with only brief details
  3122. NvU32 displaySettingsCount; // number of display settings in below array
  3123. NV_MOSAIC_DISPLAY_SETTING displaySettings[NV_MOSAIC_DISPLAY_SETTINGS_MAX]; // list of per display settings possible
  3124. } NV_MOSAIC_SUPPORTED_TOPO_INFO;
  3125. #define NVAPI_MOSAIC_SUPPORTED_TOPO_INFO_VER MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPO_INFO,1)
  3126. //
  3127. // Indexes to use to access the topos array within the mosaic topo
  3128. //
  3129. #define NV_MOSAIC_TOPO_IDX_DEFAULT 0
  3130. #define NV_MOSAIC_TOPO_IDX_LEFT_EYE 0
  3131. #define NV_MOSAIC_TOPO_IDX_RIGHT_EYE 1
  3132. #define NV_MOSAIC_TOPO_NUM_EYES 2
  3133. //
  3134. // This defines the maximum number of topos that can be in a topo group.
  3135. // At this time, it is set to 2 because our largest topo group (passive
  3136. // stereo) only needs 2 topos (left eye and right eye).
  3137. //
  3138. // If a new topo group with more than 2 topos is added above, then this
  3139. // number will also have to be incremented.
  3140. //
  3141. #define NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP 2
  3142. //
  3143. // This structure defines a group of topos that work together to create one
  3144. // overall layout. All of the supported topos are represented with this
  3145. // structure.
  3146. //
  3147. // For example, a 'Passive Stereo' topo would be represented with this
  3148. // structure, and would have separate topo details for the left and right eyes.
  3149. // The count would be 2. A 'Basic' topo is also represented by this structure,
  3150. // with a count of 1.
  3151. //
  3152. // The structure is primarily used internally, but is exposed to applications in a
  3153. // read only fashion because there are some details in it that might be useful
  3154. // (like the number of rows/cols, or connected display information). A user can
  3155. // get the filled in structure by calling NvAPI_Mosaic_GetTopoGroup().
  3156. //
  3157. // You can then look at the detailed values within the structure. There are no
  3158. // entrypoints which take this structure as input (effectively making it read only).
  3159. //
  3160. typedef struct
  3161. {
  3162. NvU32 version; // version of this structure
  3163. NV_MOSAIC_TOPO_BRIEF brief; // the brief details of this topo
  3164. NvU32 count; // number of topos in array below
  3165. NV_MOSAIC_TOPO_DETAILS topos[NV_MOSAIC_MAX_TOPO_PER_TOPO_GROUP];
  3166. } NV_MOSAIC_TOPO_GROUP;
  3167. #define NVAPI_MOSAIC_TOPO_GROUP_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPO_GROUP,1)
  3168. // SUPPORTED OS: Windows XP and higher
  3169. ///////////////////////////////////////////////////////////////////////////////
  3170. //
  3171. // FUNCTION NAME: NvAPI_Mosaic_GetSupportedTopoInfo
  3172. //
  3173. // DESCRIPTION: This API returns information on the topos and display resolutions
  3174. // supported by Mosaic.
  3175. //
  3176. // NOTE: Not all topos returned can be immediately set.
  3177. // See 'OUT' Notes below.
  3178. //
  3179. // Once you get the list of supported topos, you can call
  3180. // NvAPI_Mosaic_GetTopoGroup() with a Mosaic topo if you need
  3181. // more information about that topo.
  3182. //
  3183. // PARAMETERS: pSupportedTopoInfo(IN/OUT): Information about what topos and display resolutions
  3184. // are supported for Mosaic.
  3185. // type(IN): The type of topos the caller is interested in
  3186. // getting. See NV_MOSAIC_TOPO_TYPE for possible
  3187. // values.
  3188. //
  3189. // 'IN' Notes: pSupportedTopoInfo->version must be set before calling this function.
  3190. // If the specified version is not supported by this implementation,
  3191. // an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION).
  3192. //
  3193. // 'OUT' Notes: Some of the topos returned might not be valid for one reason or
  3194. // another. It could be due to mismatched or missing displays. It
  3195. // could also be because the required number of GPUs is not found.
  3196. // At a high level, you can see if the topo is valid and can be enabled
  3197. // by looking at the pSupportedTopoInfo->topoBriefs[xxx].isPossible flag.
  3198. // If this is true, the topo can be enabled. Otherwise, if it
  3199. // is false, you can find out why it cannot be enabled by getting the
  3200. // details of the topo via NvAPI_Mosaic_GetTopoGroup(). From there,
  3201. // look at the validityMask of the individual topos. The bits can
  3202. // be tested against the NV_MOSAIC_TOPO_VALIDITY_* bits.
  3203. //
  3204. // It is possible for this function to return NVAPI_OK with no topos
  3205. // listed in the return structure. If this is the case, it means that
  3206. // the current hardware DOES support Mosaic, but with the given configuration
  3207. // no valid topos were found. This most likely means that SLI was not
  3208. // enabled for the hardware. Once enabled, you should see valid topos
  3209. // returned from this function.
  3210. //
  3211. // RETURN STATUS NVAPI_OK: No errors in returning supported topos
  3212. // NVAPI_NOT_SUPPORTED: Mosaic is not supported with the existing hardware
  3213. // NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid
  3214. // NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first
  3215. // NVAPI_NO_IMPLEMENTATION: This entrypoint not available
  3216. // NVAPI_INCOMPATIBLE_STRUCT_VERSION: The version of the structure passed in is not
  3217. // compatible with this entrypoint
  3218. // NVAPI_ERROR: Miscellaneous error occurred
  3219. //
  3220. ///////////////////////////////////////////////////////////////////////////////
  3221. NVAPI_INTERFACE NvAPI_Mosaic_GetSupportedTopoInfo(NV_MOSAIC_SUPPORTED_TOPO_INFO *pSupportedTopoInfo, NV_MOSAIC_TOPO_TYPE type);
  3222. // SUPPORTED OS: Windows XP and higher
  3223. ///////////////////////////////////////////////////////////////////////////////
  3224. //
  3225. // FUNCTION NAME: NvAPI_Mosaic_GetTopoGroup
  3226. //
  3227. // DESCRIPTION: This API returns a structure filled with the topo details
  3228. // for the given Mosaic topo.
  3229. //
  3230. // If the pTopoBrief passed in matches the topo which is
  3231. // current, then information in the brief and group structures
  3232. // will reflect what is current. Thus the brief would have
  3233. // the current 'enable' status, and the group would have the
  3234. // current overlap values. If there is no match, then the
  3235. // returned brief has an 'enable' status of FALSE (since it
  3236. // is obviously not enabled), and the overlap values will be 0.
  3237. //
  3238. // PARAMETERS: pTopoBrief(IN): The topo to get details for.
  3239. // This must be one of the topo briefs
  3240. // returned from NvAPI_Mosaic_GetSupportedTopoInfo().
  3241. // pTopoGroup(IN/OUT): The topo details matching the brief.
  3242. //
  3243. // 'IN' Notes: pTopoGroup->version must be set before calling this function.
  3244. // If the specified version is not supported by this implementation,
  3245. // an error will be returned (NVAPI_INCOMPATIBLE_STRUCT_VERSION).
  3246. //
  3247. // RETURN STATUS NVAPI_OK: Details were retrieved successfully
  3248. // NVAPI_NOT_SUPPORTED: Mosaic is not supported with the existing hardware
  3249. // NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid.
  3250. // NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first
  3251. // NVAPI_NO_IMPLEMENTATION: This entrypoint not available
  3252. // NVAPI_INCOMPATIBLE_STRUCT_VERSION: The version of the structure passed in is not
  3253. // compatible with this entrypoint
  3254. // NVAPI_ERROR: Miscellaneous error occurred
  3255. //
  3256. ///////////////////////////////////////////////////////////////////////////////
  3257. NVAPI_INTERFACE NvAPI_Mosaic_GetTopoGroup(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_TOPO_GROUP *pTopoGroup);
  3258. // SUPPORTED OS: Windows XP and higher
  3259. ///////////////////////////////////////////////////////////////////////////////
  3260. //
  3261. // FUNCTION NAME: NvAPI_Mosaic_GetOverlapLimits
  3262. //
  3263. // DESCRIPTION: This API returns the X and Y overlap limits required if
  3264. // the given Mosaic topo and display settings are to be used.
  3265. //
  3266. // PARAMETERS: pTopoBrief(IN): The topo to get limits for.
  3267. // This must be one of the topo briefs
  3268. // returned from NvAPI_Mosaic_GetSupportedTopoInfo().
  3269. // pDisplaySetting(IN): The display settings to get limits for.
  3270. // This must be one of the settings
  3271. // returned from NvAPI_Mosaic_GetSupportedTopoInfo().
  3272. // pMinOverlapX(OUT): X overlap minimum
  3273. // pMaxOverlapX(OUT): X overlap maximum
  3274. // pMinOverlapY(OUT): Y overlap minimum
  3275. // pMaxOverlapY(OUT): Y overlap maximum
  3276. //
  3277. //
  3278. //
  3279. // RETURN STATUS NVAPI_OK: Details were retrieved successfully
  3280. // NVAPI_NOT_SUPPORTED: Mosaic is not supported with the existing hardware
  3281. // NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid.
  3282. // NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first
  3283. // NVAPI_NO_IMPLEMENTATION: This entrypoint not available
  3284. // NVAPI_INCOMPATIBLE_STRUCT_VERSION: The version of the structure passed in is not
  3285. // compatible with this entrypoint
  3286. // NVAPI_ERROR: Miscellaneous error occurred
  3287. //
  3288. ///////////////////////////////////////////////////////////////////////////////
  3289. NVAPI_INTERFACE NvAPI_Mosaic_GetOverlapLimits(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pMinOverlapX, NvS32 *pMaxOverlapX, NvS32 *pMinOverlapY, NvS32 *pMaxOverlapY);
  3290. // SUPPORTED OS: Windows XP and higher
  3291. ///////////////////////////////////////////////////////////////////////////////
  3292. //
  3293. // FUNCTION NAME: NvAPI_Mosaic_SetCurrentTopo
  3294. //
  3295. // DESCRIPTION: This API sets the Mosaic topo and does a mode change
  3296. // using the given display settings.
  3297. //
  3298. // If NVAPI_OK is returned, the current Mosaic topo was set
  3299. // correctly. Any other status returned means the
  3300. // topo was not set, and remains what it was before this
  3301. // function was called.
  3302. //
  3303. //
  3304. //
  3305. // PARAMETERS: pTopoBrief(IN): The topo to set.
  3306. // This must be one of the topos
  3307. // returned from NvAPI_Mosaic_GetSupportedTopoInfo(),
  3308. // and it must have an isPossible value of 1.
  3309. // pDisplaySetting(IN): The per display settings to be used in the
  3310. // setting of Mosaic mode.
  3311. // This must be one of the settings
  3312. // returned from NvAPI_Mosaic_GetSupportedTopoInfo().
  3313. // overlapX(IN): The pixel overlap to use between horizontal
  3314. // displays (use positive a number for overlap,
  3315. // or a negative number to create a gap.)
  3316. // If the overlap is out of bounds for what is
  3317. // possible given the topo and display setting,
  3318. // the overlap will be clamped.
  3319. // overlapY(IN): The pixel overlap to use between vertical
  3320. // displays (use positive a number for overlap,
  3321. // or a negative number to create a gap.)
  3322. // If the overlap is out of bounds for what is
  3323. // possible given the topo and display setting,
  3324. // the overlap will be clamped.
  3325. // enable(IN): If 1, the topo being set will also be enabled,
  3326. // meaning that the mode set will occur.
  3327. // Passing a 0 means you don't want to be in
  3328. // Mosaic mode right now, but want to set the current
  3329. // Mosaic topo so you can enable it later with
  3330. // NvAPI_Mosaic_EnableCurrentTopo().
  3331. //
  3332. // RETURN STATUS NVAPI_OK: Mosaic topo was set
  3333. // NVAPI_NOT_SUPPORTED: Mosaic is not supported with the existing hardware
  3334. // NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid.
  3335. // NVAPI_TOPO_NOT_POSSIBLE: The topo passed in is not currently possible
  3336. // NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first
  3337. // NVAPI_NO_IMPLEMENTATION: This entrypoint not available
  3338. // NVAPI_INCOMPATIBLE_STRUCT_VERSION: The version of the structure passed in is not
  3339. // compatible with this entrypoint
  3340. // NVAPI_MODE_CHANGE_FAILED: There was an error changing the display mode
  3341. // NVAPI_ERROR: Miscellaneous error occurred
  3342. //
  3343. ///////////////////////////////////////////////////////////////////////////////
  3344. NVAPI_INTERFACE NvAPI_Mosaic_SetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 overlapX, NvS32 overlapY, NvU32 enable);
  3345. // SUPPORTED OS: Windows XP and higher
  3346. ///////////////////////////////////////////////////////////////////////////////
  3347. //
  3348. // FUNCTION NAME: NvAPI_Mosaic_GetCurrentTopo
  3349. //
  3350. // DESCRIPTION: This API returns information for the current Mosaic topo.
  3351. // This includes topo, display settings, and overlap values.
  3352. //
  3353. // You can call NvAPI_Mosaic_GetTopoGroup() with the topo
  3354. // if you require more information on the topo.
  3355. //
  3356. // If there isn't a current topo, then pTopoBrief->topo will
  3357. // be NV_MOSAIC_TOPO_NONE.
  3358. //
  3359. // PARAMETERS: pTopoBrief(OUT): The current Mosaic topo
  3360. // pDisplaySetting(OUT): The current per display settings
  3361. // pOverlapX(OUT): The pixel overlap between horizontal displays
  3362. // pOverlapY(OUT): The pixel overlap between vertical displays
  3363. //
  3364. //
  3365. // RETURN STATUS NVAPI_OK: Success getting current info
  3366. // NVAPI_NOT_SUPPORTED: Mosaic is not supported with the existing hardware
  3367. // NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid
  3368. // NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first
  3369. // NVAPI_NO_IMPLEMENTATION: This entrypoint not available
  3370. // NVAPI_ERROR: Miscellaneous error occurred
  3371. //
  3372. ///////////////////////////////////////////////////////////////////////////////
  3373. NVAPI_INTERFACE NvAPI_Mosaic_GetCurrentTopo(NV_MOSAIC_TOPO_BRIEF *pTopoBrief, NV_MOSAIC_DISPLAY_SETTING *pDisplaySetting, NvS32 *pOverlapX, NvS32 *pOverlapY);
  3374. // SUPPORTED OS: Windows XP and higher
  3375. ///////////////////////////////////////////////////////////////////////////////
  3376. //
  3377. // FUNCTION NAME: NvAPI_Mosaic_EnableCurrentTopo
  3378. //
  3379. // DESCRIPTION: This API enables or disables the current Mosaic topo
  3380. // based on the setting of the incoming 'enable' parameter.
  3381. //
  3382. // When enabling, this will enable the current Mosaic topo
  3383. // that was previously set. Note that when the current Mosaic
  3384. // topo is retrieved, it must have an isPossible value of 1 or
  3385. // an error will occur.
  3386. //
  3387. // When disabling, the current Mosaic topo is disabled.
  3388. // The topo information will persist, even across reboots.
  3389. // To re-enable the Mosaic topo, simply call this function
  3390. // again with the enable parameter set to 1.
  3391. //
  3392. // PARAMETERS: enable(IN): 1 to enable the current Mosaic topo, 0 to disable it.
  3393. //
  3394. //
  3395. // RETURN STATUS NVAPI_OK: The Mosaic topo was enabled/disabled
  3396. // NVAPI_NOT_SUPPORTED: Mosaic is not supported with the existing hardware
  3397. // NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid
  3398. // NVAPI_TOPO_NOT_POSSIBLE: The current topo is not currently possible
  3399. // NVAPI_MODE_CHANGE_FAILED: There was an error changing the display mode
  3400. // NVAPI_ERROR: Miscellaneous error occurred
  3401. //
  3402. ///////////////////////////////////////////////////////////////////////////////
  3403. NVAPI_INTERFACE NvAPI_Mosaic_EnableCurrentTopo(NvU32 enable);
  3404. // SUPPORTED OS: Windows Vista and higher
  3405. ///////////////////////////////////////////////////////////////////////////////
  3406. //
  3407. // FUNCTION NAME: NvAPI_Mosaic_GetDisplayViewportsByResolution
  3408. //
  3409. // DESCRIPTION: This API returns the viewports which would be applied on
  3410. // the requested display.
  3411. //
  3412. // PARAMETERS: displayId(IN): Display ID of a single display in the active
  3413. // mosaic topology to query.
  3414. // srcWidth(IN): Width of full display topology. If both
  3415. // width and height are 0, the current
  3416. // resolution is used.
  3417. // srcHeight(IN): Height of full display topology. If both
  3418. // width and height are 0, the current
  3419. // resolution is used.
  3420. // viewports (OUT): Array of NV_RECT viewports which represent
  3421. // the displays as identified in
  3422. // NvAPI_Mosaic_EnumGridTopologies. If the
  3423. // requested resolution is a single-wide
  3424. // resolution, only viewports[0] will
  3425. // contain the viewport details, regardless
  3426. // of which display is driving the display.
  3427. // bezelCorrected(OUT): Returns 1 if the requested resolution is
  3428. // bezel corrected. May be NULL.
  3429. //
  3430. // RETURN STATUS NVAPI_OK: Capabilties have been returned.
  3431. // NVAPI_INVALID_ARGUMENT: One or more args passed in are invalid.
  3432. // NVAPI_API_NOT_INTIALIZED: The NvAPI API needs to be initialized first
  3433. // NVAPI_MOSAIC_NOT_ACTIVE: The display does not belong to an active Mosaic Topology
  3434. // NVAPI_NO_IMPLEMENTATION: This entrypoint not available
  3435. // NVAPI_ERROR: Miscellaneous error occurred
  3436. //
  3437. ///////////////////////////////////////////////////////////////////////////////
  3438. NVAPI_INTERFACE NvAPI_Mosaic_GetDisplayViewportsByResolution(NvU32 displayId, NvU32 srcWidth, NvU32 srcHeight, NV_RECT viewports[NV_MOSAIC_MAX_DISPLAYS], NvU8* bezelCorrected);
  3439. ////////////////////////////////////////////////////////////////////////////////////////
  3440. //
  3441. // ###########################################################################
  3442. // DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS
  3443. //
  3444. // Below is the Phase 1 Mosaic stuff, the Phase 2 stuff above is what will remain
  3445. // once Phase 2 is complete. For a small amount of time, the two will co-exist. As
  3446. // soon as apps (nvapichk, NvAPITestMosaic, and CPL) are updated to use the Phase 2
  3447. // entrypoints, the code below will be deleted.
  3448. //
  3449. // DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS - DELME_RUSS
  3450. // ###########################################################################
  3451. //
  3452. //
  3453. // Supported topos 1x4, 4x1 and 2x2 to start with.
  3454. //
  3455. // Selected scanout targets can be one per GPU or more than one on the same GPU.
  3456. //
  3457. // SAMPLE of MOSAIC 1x4 SCAN OUT TOPO with 8 pixel horizontal overlap
  3458. //
  3459. //+-------------------------++-------------------------++-------------------------++-------------------------+
  3460. //| || || || |
  3461. //| || || || |
  3462. //| || || || |
  3463. //| DVI1 || DVI2 || DVI3 || DVI4 |
  3464. //| || || || |
  3465. //| || || || |
  3466. //| || || || |
  3467. //| || || || |
  3468. //+-------------------------++-------------------------++-------------------------++-------------------------+
  3469. #define NVAPI_MAX_MOSAIC_DISPLAY_ROWS 8
  3470. #define NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS 8
  3471. #define NVAPI_MAX_MOSAIC_TOPOS 16
  3472. typedef struct
  3473. {
  3474. NvU32 version; // version number of mosaic topology
  3475. NvU32 rowCount; // horizontal display count
  3476. NvU32 colCount; // vertical display count
  3477. struct
  3478. {
  3479. NvPhysicalGpuHandle hPhysicalGPU; // physical gpu to be used in the topology
  3480. NvU32 displayOutputId; // connected display target
  3481. NvS32 overlapX; // pixels of overlap on left of target: (+overlap, -gap)
  3482. NvS32 overlapY; // pixels of overlap on top of target: (+overlap, -gap)
  3483. } gpuLayout[NVAPI_MAX_MOSAIC_DISPLAY_ROWS][NVAPI_MAX_MOSAIC_DISPLAY_COLUMNS];
  3484. } NV_MOSAIC_TOPOLOGY;
  3485. #define NVAPI_MOSAIC_TOPOLOGY_VER MAKE_NVAPI_VERSION(NV_MOSAIC_TOPOLOGY,1)
  3486. typedef struct
  3487. {
  3488. NvU32 version;
  3489. NvU32 totalCount; //count of valid topologies
  3490. NV_MOSAIC_TOPOLOGY topos[NVAPI_MAX_MOSAIC_TOPOS]; //max topologies
  3491. } NV_MOSAIC_SUPPORTED_TOPOLOGIES;
  3492. #define NVAPI_MOSAIC_SUPPORTED_TOPOLOGIES_VER MAKE_NVAPI_VERSION(NV_MOSAIC_SUPPORTED_TOPOLOGIES,1)
  3493. ///////////////////////////////////////////////////////////////////////////////
  3494. //
  3495. // FUNCTION NAME: NvAPI_GetSupportedMosaicTopologies
  3496. //
  3497. // DESCRIPTION: This API returns all valid Mosaic topologies
  3498. //
  3499. // SUPPORTED OS: Windows XP
  3500. //
  3501. // PARAMETERS: pMosaicTopos(OUT): An array of valid Mosaic topologies.
  3502. //
  3503. // RETURN STATUS NVAPI_OK: Call succeeded; 1 or more topologies were returned
  3504. // NVAPI_INVALID_ARGUMENT: one or more args are invalid
  3505. // NVAPI_MIXED_TARGET_TYPES: Mosaic topology is only possible with all targets of the same NV_GPU_OUTPUT_TYPE.
  3506. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  3507. // NVAPI_NOT_SUPPORTED: Mosaic is not supported with GPUs on this system.
  3508. // NVAPI_NO_ACTIVE_SLI_TOPOLOGY: SLI is not enabled, yet needs to be, in order for this function to succeed.
  3509. //
  3510. ///////////////////////////////////////////////////////////////////////////////
  3511. NVAPI_INTERFACE NvAPI_GetSupportedMosaicTopologies(NV_MOSAIC_SUPPORTED_TOPOLOGIES *pMosaicTopos);
  3512. ///////////////////////////////////////////////////////////////////////////////
  3513. //
  3514. // FUNCTION NAME: NvAPI_GetCurrentMosaicTopology
  3515. //
  3516. // DESCRIPTION: This API gets the current Mosaic topology
  3517. //
  3518. // SUPPORTED OS: Windows XP
  3519. //
  3520. // PARAMETERS: pMosaicTopo(OUT): The current Mosaic topology
  3521. // pEnabled(OUT): TRUE if returned topology is currently enabled, else FALSE
  3522. //
  3523. // RETURN STATUS NVAPI_OK: Call succeeded.
  3524. // NVAPI_INVALID_ARGUMENT: one or more args are invalid
  3525. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  3526. // NVAPI_NOT_SUPPORTED: Mosaic is not supported with GPUs on this system.
  3527. // NVAPI_NO_ACTIVE_SLI_TOPOLOGY: SLI is not enabled, yet needs to be, in order for this function to succeed.
  3528. //
  3529. ///////////////////////////////////////////////////////////////////////////////
  3530. NVAPI_INTERFACE NvAPI_GetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo, NvU32 *pEnabled);
  3531. ///////////////////////////////////////////////////////////////////////////////
  3532. //
  3533. // FUNCTION NAME: NvAPI_SetCurrentMosaicTopology
  3534. //
  3535. // DESCRIPTION: This API sets the Mosaic topology, and will enable it so the
  3536. // Mosaic display settings will be enumerated upon request.
  3537. //
  3538. // SUPPORTED OS: Windows XP
  3539. //
  3540. // PARAMETERS: pMosaicTopo(IN): A valid Mosaic topology
  3541. //
  3542. // RETURN STATUS NVAPI_OK: Call succeeded
  3543. // NVAPI_INVALID_ARGUMENT: One or more args are invalid
  3544. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: No NVIDIA GPU driving a display was found
  3545. // NVAPI_NOT_SUPPORTED: Mosaic mode could not be set
  3546. // NVAPI_NO_ACTIVE_SLI_TOPOLOGY: SLI is not enabled, yet needs to be, in order for this function to succeed.
  3547. //
  3548. ///////////////////////////////////////////////////////////////////////////////
  3549. NVAPI_INTERFACE NvAPI_SetCurrentMosaicTopology(NV_MOSAIC_TOPOLOGY *pMosaicTopo);
  3550. ///////////////////////////////////////////////////////////////////////////////
  3551. //
  3552. // FUNCTION NAME: NvAPI_EnableCurrentMosaicTopology
  3553. //
  3554. // DESCRIPTION: This API enables or disables the current Mosaic topology.
  3555. // When enabling, this will use the last Mosaic topology that was set.
  3556. // If enabled, enumeration of display settings will include valid
  3557. // Mosaic resolutions. If disabled, enumeration of display settings
  3558. // will not include Mosaic resolutions.
  3559. //
  3560. // SUPPORTED OS: Windows XP
  3561. //
  3562. // PARAMETERS: enable(IN): TRUE to enable the Mosaic Topology, FALSE to disable it.
  3563. //
  3564. // RETURN STATUS NVAPI_OK: Call succeeded
  3565. // NVAPI_INVALID_ARGUMENT: One or more args are invalid
  3566. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: No NVIDIA GPU driving a display was found
  3567. // NVAPI_NOT_SUPPORTED: Mosaic mode could not be enabled/disabled
  3568. // NVAPI_NO_ACTIVE_SLI_TOPOLOGY: SLI is not enabled, yet needs to be, in order for this function to succeed.
  3569. //
  3570. ///////////////////////////////////////////////////////////////////////////////
  3571. NVAPI_INTERFACE NvAPI_EnableCurrentMosaicTopology(NvU32 enable);
  3572. ///////////////////////////////////////////////////////////////////////////////
  3573. //
  3574. // FUNCTION NAME: NvAPI_GPU_GetHDCPSupportStatus
  3575. //
  3576. // DESCRIPTION: Returns information on a GPU's HDCP support status
  3577. //
  3578. // SUPPORTED OS: Mac OS X, Windows XP and higher
  3579. //
  3580. // RETURN STATUS:
  3581. // NVAPI_OK - completed request
  3582. // NVAPI_ERROR - miscellaneous error occurred
  3583. // NVAPI_INVALID_ARGUMENT - pGetGpuHdcpSupportStatus is NULL
  3584. // NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
  3585. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
  3586. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - the version of the INFO struct is not supported
  3587. //
  3588. ///////////////////////////////////////////////////////////////////////////////
  3589. typedef enum _NV_GPU_HDCP_FUSE_STATE
  3590. {
  3591. NV_GPU_HDCP_FUSE_STATE_UNKNOWN = 0,
  3592. NV_GPU_HDCP_FUSE_STATE_DISABLED = 1,
  3593. NV_GPU_HDCP_FUSE_STATE_ENABLED = 2,
  3594. } NV_GPU_HDCP_FUSE_STATE;
  3595. typedef enum _NV_GPU_HDCP_KEY_SOURCE
  3596. {
  3597. NV_GPU_HDCP_KEY_SOURCE_UNKNOWN = 0,
  3598. NV_GPU_HDCP_KEY_SOURCE_NONE = 1,
  3599. NV_GPU_HDCP_KEY_SOURCE_CRYPTO_ROM = 2,
  3600. NV_GPU_HDCP_KEY_SOURCE_SBIOS = 3,
  3601. NV_GPU_HDCP_KEY_SOURCE_I2C_ROM = 4,
  3602. NV_GPU_HDCP_KEY_SOURCE_FUSES = 5,
  3603. } NV_GPU_HDCP_KEY_SOURCE;
  3604. typedef enum _NV_GPU_HDCP_KEY_SOURCE_STATE
  3605. {
  3606. NV_GPU_HDCP_KEY_SOURCE_STATE_UNKNOWN = 0,
  3607. NV_GPU_HDCP_KEY_SOURCE_STATE_ABSENT = 1,
  3608. NV_GPU_HDCP_KEY_SOURCE_STATE_PRESENT = 2,
  3609. } NV_GPU_HDCP_KEY_SOURCE_STATE;
  3610. typedef struct
  3611. {
  3612. NvU32 version; // Structure version
  3613. NV_GPU_HDCP_FUSE_STATE hdcpFuseState; // GPU's HDCP fuse state
  3614. NV_GPU_HDCP_KEY_SOURCE hdcpKeySource; // GPU's HDCP key source
  3615. NV_GPU_HDCP_KEY_SOURCE_STATE hdcpKeySourceState; // GPU's HDCP key source state
  3616. } NV_GPU_GET_HDCP_SUPPORT_STATUS;
  3617. #define NV_GPU_GET_HDCP_SUPPORT_STATUS_VER MAKE_NVAPI_VERSION(NV_GPU_GET_HDCP_SUPPORT_STATUS,1)
  3618. NVAPI_INTERFACE NvAPI_GPU_GetHDCPSupportStatus(NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_GET_HDCP_SUPPORT_STATUS *pGetHDCPSupportStatus);
  3619. ///////////////////////////////////////////////////////////////////////////////
  3620. //
  3621. // FUNCTION NAME: NvAPI_Stereo_CreateConfigurationProfileRegistryKey
  3622. //
  3623. // SUPPORTED OS: Windows Vista and higher
  3624. //
  3625. // DESCRIPTION: Creates new configuration registry key for current application.
  3626. //
  3627. // If there was no configuration profile prior to the function call,
  3628. // tries to create brand new configuration profile registry key
  3629. // for a given application and fill it with default values.
  3630. // If an application already had a configuration profile registry key, does nothing.
  3631. // Name of the key is automatically determined as the name of the executable that calls this function.
  3632. // Because of this, application executable should have distinct and unique name.
  3633. // If the application is using only one version of DirectX, than the default profile type will be appropriate.
  3634. // If the application is using more than one version of DirectX from same executable,
  3635. // it should use appropriate profile type for each configuration profile.
  3636. //
  3637. // PARAMETERS: registryProfileType(IN) - Type of profile that application wants to create.
  3638. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  3639. // Any other value will cause function to do nothing and return NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  3640. //
  3641. // HOW TO USE: When there is a need for an application to have default stereo parameter values,
  3642. // use this function to create a key where they will be stored.
  3643. //
  3644. // RETURN STATUS:
  3645. // NVAPI_OK - Key exists in the registry.
  3646. // NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED - This profile type is not supported.
  3647. // NVAPI_STEREO_REGISTRY_ACCESS_FAILED - Access to registry failed.
  3648. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3649. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3650. // NVAPI_ERROR - Something is wrong (generic error).
  3651. //
  3652. ///////////////////////////////////////////////////////////////////////////////
  3653. typedef enum _NV_StereoRegistryProfileType
  3654. {
  3655. NVAPI_STEREO_DEFAULT_REGISTRY_PROFILE, // Default registry configuration profile.
  3656. NVAPI_STEREO_DX9_REGISTRY_PROFILE, // Separate registry configuration profile for DX9 executable.
  3657. NVAPI_STEREO_DX10_REGISTRY_PROFILE // Separate registry configuration profile for DX10 executable.
  3658. } NV_STEREO_REGISTRY_PROFILE_TYPE;
  3659. NVAPI_INTERFACE NvAPI_Stereo_CreateConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType);
  3660. ///////////////////////////////////////////////////////////////////////////////
  3661. //
  3662. // FUNCTION NAME: NvAPI_Stereo_DeleteConfigurationProfileRegistryKey
  3663. //
  3664. // SUPPORTED OS: Windows Vista and higher
  3665. //
  3666. // DESCRIPTION: Removes configuration registry key for current application.
  3667. //
  3668. // If an application already had a configuration profile prior to the function call,
  3669. // this function will try to remove application's configuration profile registry key from the registry.
  3670. // If there was no configuration profile registry key prior to the function call,
  3671. // the function will do nothing and will not report an error.
  3672. //
  3673. // PARAMETERS: registryProfileType(IN) - Type of profile that application wants to delete.
  3674. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  3675. // Any other value will cause function to do nothing and return NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  3676. //
  3677. // RETURN STATUS:
  3678. // NVAPI_OK - Key does not exist in the registry any more.
  3679. // NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED - This profile type is not supported.
  3680. // NVAPI_STEREO_REGISTRY_ACCESS_FAILED - Access to registry failed.
  3681. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3682. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3683. // NVAPI_ERROR - Something is wrong (generic error).
  3684. //
  3685. ///////////////////////////////////////////////////////////////////////////////
  3686. NVAPI_INTERFACE NvAPI_Stereo_DeleteConfigurationProfileRegistryKey(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType);
  3687. ///////////////////////////////////////////////////////////////////////////////
  3688. //
  3689. // FUNCTION NAME: NvAPI_Stereo_SetConfigurationProfileValue
  3690. //
  3691. // PARAMETERS: registryProfileType(IN) - Type of profile that application wants to access.
  3692. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  3693. // Any other value will cause function to do nothing and return NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  3694. // valueRegistryID(IN) - ID of the value that is being set.
  3695. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  3696. // Any other value will cause function to do nothing and return NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED.
  3697. // pValue(IN) - Address of the value that is being set.
  3698. // Should be either address of a DWORD or of a float,
  3699. // dependent on the type of the stereo parameter whose value is being set.
  3700. // The API will then cast that address to DWORD*
  3701. // and write whatever is in those 4 bytes as a DWORD to the registry.
  3702. //
  3703. // SUPPORTED OS: Windows Vista and higher
  3704. //
  3705. // DESCRIPTION: Sets given parameter value under the application's registry key.
  3706. //
  3707. // If the value does not exist under the application's registry key,
  3708. // the value will be created under the key.
  3709. //
  3710. // RETURN STATUS:
  3711. // NVAPI_OK - Value is written to registry.
  3712. // NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED - This profile type is not supported.
  3713. // NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED - This value is not supported.
  3714. // NVAPI_STEREO_REGISTRY_ACCESS_FAILED - Access to registry failed.
  3715. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3716. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3717. // NVAPI_ERROR - Something is wrong (generic error).
  3718. //
  3719. ///////////////////////////////////////////////////////////////////////////////
  3720. typedef enum _NV_StereoRegistryID
  3721. {
  3722. NVAPI_CONVERGENCE_ID, // Symbolic constant for convergence registry ID.
  3723. NVAPI_FRUSTUM_ADJUST_MODE_ID, // Symbolic constant for frustum adjust mode registry ID.
  3724. } NV_STEREO_REGISTRY_ID;
  3725. NVAPI_INTERFACE NvAPI_Stereo_SetConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID, void *pValue);
  3726. ///////////////////////////////////////////////////////////////////////////////
  3727. //
  3728. // FUNCTION NAME: NvAPI_Stereo_DeleteConfigurationProfileValue
  3729. //
  3730. // PARAMETERS: registryProfileType(IN) - Type of profile that application wants to access.
  3731. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  3732. // Any other value will cause function to do nothing and return NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  3733. // valueRegistryID(IN) - ID of the value that is being deleted.
  3734. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  3735. // Any other value will cause function to do nothing and return NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED.
  3736. //
  3737. // SUPPORTED OS: Windows Vista and higher
  3738. //
  3739. // DESCRIPTION: Removes given value from application's configuration profile registry key.
  3740. //
  3741. // If there is no such value, the function will do nothing and will not report an error.
  3742. //
  3743. // RETURN STATUS:
  3744. // NVAPI_OK - Value does not exist in registry any more.
  3745. // NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED - This profile type is not supported.
  3746. // NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED - This value is not supported.
  3747. // NVAPI_STEREO_REGISTRY_ACCESS_FAILED - Access to registry failed.
  3748. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3749. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3750. // NVAPI_ERROR - Something is wrong (generic error).
  3751. //
  3752. ///////////////////////////////////////////////////////////////////////////////
  3753. NVAPI_INTERFACE NvAPI_Stereo_DeleteConfigurationProfileValue(NV_STEREO_REGISTRY_PROFILE_TYPE registryProfileType, NV_STEREO_REGISTRY_ID valueRegistryID);
  3754. ///////////////////////////////////////////////////////////////////////////////
  3755. //
  3756. // FUNCTION NAME: NvAPI_Stereo_Enable
  3757. //
  3758. // SUPPORTED OS: Windows Vista and higher
  3759. //
  3760. // DESCRIPTION: Enables stereo mode in the registry.
  3761. // Call to this function affects entire system.
  3762. // Calls to functions that require stereo enabled with stereo disabled will have no effect,
  3763. // and will return apropriate error code.
  3764. //
  3765. // RETURN STATUS:
  3766. // NVAPI_OK - Stereo is now enabled.
  3767. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3768. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3769. // NVAPI_ERROR - Something is wrong (generic error).
  3770. //
  3771. ///////////////////////////////////////////////////////////////////////////////
  3772. NVAPI_INTERFACE NvAPI_Stereo_Enable(void);
  3773. ///////////////////////////////////////////////////////////////////////////////
  3774. //
  3775. // FUNCTION NAME: NvAPI_Stereo_Disable
  3776. //
  3777. // SUPPORTED OS: Windows Vista and higher
  3778. //
  3779. // DESCRIPTION: Disables stereo mode in the registry.
  3780. // Call to this function affects entire system.
  3781. // Calls to functions that require stereo enabled with stereo disabled will have no effect,
  3782. // and will return apropriate error code.
  3783. //
  3784. // RETURN STATUS:
  3785. // NVAPI_OK - Stereo is now disabled.
  3786. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3787. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3788. // NVAPI_ERROR - Something is wrong (generic error).
  3789. //
  3790. ///////////////////////////////////////////////////////////////////////////////
  3791. NVAPI_INTERFACE NvAPI_Stereo_Disable(void);
  3792. ///////////////////////////////////////////////////////////////////////////////
  3793. //
  3794. // FUNCTION NAME: NvAPI_Stereo_IsEnabled
  3795. //
  3796. // PARAMETERS: pIsStereoEnabled(OUT) - Address where result of the inquiry will be placed.
  3797. //
  3798. // SUPPORTED OS: Windows Vista and higher
  3799. //
  3800. // DESCRIPTION: Checks if stereo mode is enabled in the registry.
  3801. //
  3802. // RETURN STATUS:
  3803. // NVAPI_OK - Check was sucessfully completed and result reflects current state of stereo availability.
  3804. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3805. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3806. // NVAPI_ERROR - Something is wrong (generic error).
  3807. //
  3808. ///////////////////////////////////////////////////////////////////////////////
  3809. NVAPI_INTERFACE NvAPI_Stereo_IsEnabled(NvU8 *pIsStereoEnabled);
  3810. #if defined(_D3D9_H_) || defined(__d3d10_h__) || defined(__d3d11_h__)
  3811. ///////////////////////////////////////////////////////////////////////////////
  3812. //
  3813. // FUNCTION NAME: NvAPI_Stereo_CreateHandleFromIUnknown
  3814. //
  3815. // PARAMETERS: pDevice(IN) - Pointer to IUnknown interface that is IDirect3DDevice9*, ID3D10Device* or ID3D11Device.
  3816. // pStereoHandle(OUT) - Pointer to newly created stereo handle.
  3817. //
  3818. // SUPPORTED OS: Windows Vista and higher
  3819. //
  3820. // DESCRIPTION: Creates stereo handle, that is used in subsequent calls related to given device interface.
  3821. // This must be called before any other NvAPI_Stereo_ function for that handle.
  3822. // Multiple devices can be used at one time using multiple calls to this function (one per each device).
  3823. //
  3824. // HOW TO USE: After the Direct3D device is created, create stereo handle.
  3825. // On call success:
  3826. // Use all other NvAPI_Stereo_ functions that have stereo handle as first parameter.
  3827. // After the device interface correspondent to the stereo handle is destroyed,
  3828. // application should call NvAPI_DestroyStereoHandle for that stereo handle.
  3829. //
  3830. // RETURN STATUS:
  3831. // NVAPI_OK - Stereo handle is created for given device interface.
  3832. // NVAPI_INVALID_ARGUMENT - Provided device interface is invalid.
  3833. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3834. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3835. // NVAPI_ERROR - Something is wrong (generic error).
  3836. //
  3837. ///////////////////////////////////////////////////////////////////////////////
  3838. NVAPI_INTERFACE NvAPI_Stereo_CreateHandleFromIUnknown(IUnknown *pDevice, StereoHandle *pStereoHandle);
  3839. #endif // defined(_D3D9_H_) || defined(__d3d10_h__)
  3840. ///////////////////////////////////////////////////////////////////////////////
  3841. //
  3842. // FUNCTION NAME: NvAPI_Stereo_DestroyHandle
  3843. //
  3844. // PARAMETERS: stereoHandle(IN) - Stereo handle that is to be destroyed.
  3845. //
  3846. // SUPPORTED OS: Windows Vista and higher
  3847. //
  3848. // DESCRIPTION: Destroys stereo handle created with one of NvAPI_Stereo_CreateHandleFrom functions.
  3849. // This should be called after device corresponding to the handle has been destroyed.
  3850. //
  3851. // RETURN STATUS:
  3852. // NVAPI_OK - Stereo handle is destroyed.
  3853. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3854. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3855. // NVAPI_ERROR - Something is wrong (generic error).
  3856. //
  3857. ///////////////////////////////////////////////////////////////////////////////
  3858. NVAPI_INTERFACE NvAPI_Stereo_DestroyHandle(StereoHandle stereoHandle);
  3859. ///////////////////////////////////////////////////////////////////////////////
  3860. //
  3861. // FUNCTION NAME: NvAPI_Stereo_Activate
  3862. //
  3863. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  3864. //
  3865. // SUPPORTED OS: Windows Vista and higher
  3866. //
  3867. // DESCRIPTION: Activates stereo for device interface correspondent to given stereo handle.
  3868. // Activating stereo will be possible only if stereo was enabled previously in the registry.
  3869. // Calls to all functions that require stereo activated
  3870. // with stereo deactivated will have no effect and will return appropriate error code.
  3871. //
  3872. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  3873. //
  3874. // RETURN STATUS:
  3875. // NVAPI_OK - Stereo is turned on.
  3876. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  3877. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3878. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3879. // NVAPI_ERROR - Something is wrong (generic error).
  3880. //
  3881. ///////////////////////////////////////////////////////////////////////////////
  3882. NVAPI_INTERFACE NvAPI_Stereo_Activate(StereoHandle stereoHandle);
  3883. ///////////////////////////////////////////////////////////////////////////////
  3884. //
  3885. // FUNCTION NAME: NvAPI_Stereo_Deactivate
  3886. //
  3887. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  3888. //
  3889. // SUPPORTED OS: Windows Vista and higher
  3890. //
  3891. // DESCRIPTION: Deactivates stereo for given device interface.
  3892. // Calls to all functions that require stereo activated
  3893. // with stereo deactivated will have no effect and will return appropriate error code.
  3894. //
  3895. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  3896. //
  3897. // RETURN STATUS:
  3898. // NVAPI_OK - Stereo is turned off.
  3899. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  3900. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3901. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3902. // NVAPI_ERROR - Something is wrong (generic error).
  3903. //
  3904. ///////////////////////////////////////////////////////////////////////////////
  3905. NVAPI_INTERFACE NvAPI_Stereo_Deactivate(StereoHandle stereoHandle);
  3906. ///////////////////////////////////////////////////////////////////////////////
  3907. //
  3908. // FUNCTION NAME: NvAPI_Stereo_IsActivated
  3909. //
  3910. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  3911. // pIsStereoOn(IN) - Address where result of the inquiry will be placed.
  3912. //
  3913. // SUPPORTED OS: Windows Vista and higher
  3914. //
  3915. // DESCRIPTION: Checks if stereo is activated for given device interface.
  3916. //
  3917. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  3918. //
  3919. // RETURN STATUS:
  3920. // NVAPI_OK - Check was sucessfully completed and result reflects current state of stereo (on/off).
  3921. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  3922. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3923. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3924. // NVAPI_ERROR - Something is wrong (generic error).
  3925. //
  3926. ///////////////////////////////////////////////////////////////////////////////
  3927. NVAPI_INTERFACE NvAPI_Stereo_IsActivated(StereoHandle stereoHandle, NvU8 *pIsStereoOn);
  3928. ///////////////////////////////////////////////////////////////////////////////
  3929. //
  3930. // FUNCTION NAME: NvAPI_Stereo_GetSeparation
  3931. //
  3932. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  3933. // pSeparationPercentage(OUT) - Address of @c float type variable to store current separation percentage in.
  3934. //
  3935. // SUPPORTED OS: Windows Vista and higher
  3936. //
  3937. // DESCRIPTION: Gets current separation value (in percents).
  3938. //
  3939. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  3940. //
  3941. // RETURN STATUS:
  3942. // NVAPI_OK - Retrieval of separation percentage was successfull.
  3943. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  3944. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3945. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3946. // NVAPI_ERROR - Something is wrong (generic error).
  3947. //
  3948. ///////////////////////////////////////////////////////////////////////////////
  3949. NVAPI_INTERFACE NvAPI_Stereo_GetSeparation(StereoHandle stereoHandle, float *pSeparationPercentage);
  3950. ///////////////////////////////////////////////////////////////////////////////
  3951. //
  3952. // FUNCTION NAME: NvAPI_Stereo_SetSeparation
  3953. //
  3954. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  3955. // newSeparationPercentage(IN) - New value for separation percentage.
  3956. //
  3957. // SUPPORTED OS: Windows Vista and higher
  3958. //
  3959. // DESCRIPTION: Sets separation to given percentage.
  3960. //
  3961. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  3962. //
  3963. // RETURN STATUS:
  3964. // NVAPI_OK - Setting of separation percentage was successfull.
  3965. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  3966. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3967. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3968. // NVAPI_STEREO_PARAMETER_OUT_OF_RANGE - Given separation percentage is out of [0..100] range.
  3969. // NVAPI_ERROR - Something is wrong (generic error).
  3970. //
  3971. ///////////////////////////////////////////////////////////////////////////////
  3972. NVAPI_INTERFACE NvAPI_Stereo_SetSeparation(StereoHandle stereoHandle, float newSeparationPercentage);
  3973. ///////////////////////////////////////////////////////////////////////////////
  3974. //
  3975. // FUNCTION NAME: NvAPI_Stereo_DecreaseSeparation
  3976. //
  3977. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  3978. //
  3979. // SUPPORTED OS: Windows Vista and higher
  3980. //
  3981. // DESCRIPTION: Decreases separation for given device interface (same like Ctrl+F3 hotkey).
  3982. //
  3983. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  3984. //
  3985. // RETURN STATUS:
  3986. // NVAPI_OK - Decrease of separation percentage was successfull.
  3987. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  3988. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  3989. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  3990. // NVAPI_ERROR - Something is wrong (generic error).
  3991. //
  3992. ///////////////////////////////////////////////////////////////////////////////
  3993. NVAPI_INTERFACE NvAPI_Stereo_DecreaseSeparation(StereoHandle stereoHandle);
  3994. ///////////////////////////////////////////////////////////////////////////////
  3995. //
  3996. // FUNCTION NAME: NvAPI_Stereo_IncreaseSeparation
  3997. //
  3998. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  3999. //
  4000. // SUPPORTED OS: Windows Vista and higher
  4001. //
  4002. // DESCRIPTION: Increases separation for given device interface (same like Ctrl+F4 hotkey).
  4003. //
  4004. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  4005. //
  4006. // RETURN STATUS:
  4007. // NVAPI_OK - Increase of separation percentage was successfull.
  4008. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  4009. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  4010. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  4011. // NVAPI_ERROR - Something is wrong (generic error).
  4012. //
  4013. ///////////////////////////////////////////////////////////////////////////////
  4014. NVAPI_INTERFACE NvAPI_Stereo_IncreaseSeparation(StereoHandle stereoHandle);
  4015. ///////////////////////////////////////////////////////////////////////////////
  4016. //
  4017. // FUNCTION NAME: NvAPI_Stereo_GetConvergence
  4018. //
  4019. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  4020. // pConvergence(OUT) - Address of @c float type variable to store current convergence value in.
  4021. //
  4022. // SUPPORTED OS: Windows Vista and higher
  4023. //
  4024. // DESCRIPTION: Gets current convergence value.
  4025. //
  4026. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  4027. //
  4028. // RETURN STATUS:
  4029. // NVAPI_OK - Retrieval of convergence value was successfull.
  4030. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  4031. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  4032. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  4033. // NVAPI_ERROR - Something is wrong (generic error).
  4034. //
  4035. ///////////////////////////////////////////////////////////////////////////////
  4036. NVAPI_INTERFACE NvAPI_Stereo_GetConvergence(StereoHandle stereoHandle, float *pConvergence);
  4037. ///////////////////////////////////////////////////////////////////////////////
  4038. //
  4039. // FUNCTION NAME: NvAPI_Stereo_SetConvergence
  4040. //
  4041. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  4042. // newConvergencePercentage(IN) - New value for convergence.
  4043. //
  4044. // SUPPORTED OS: Windows Vista and higher
  4045. //
  4046. // DESCRIPTION: Sets convergence to given value.
  4047. //
  4048. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  4049. //
  4050. // RETURN STATUS:
  4051. // NVAPI_OK - Setting of convergence value was successfull.
  4052. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  4053. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  4054. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  4055. // NVAPI_ERROR - Something is wrong (generic error).
  4056. //
  4057. ///////////////////////////////////////////////////////////////////////////////
  4058. NVAPI_INTERFACE NvAPI_Stereo_SetConvergence(StereoHandle stereoHandle, float newConvergencePercentage);