-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathNvAPI.pas
3038 lines (2801 loc) · 146 KB
/
NvAPI.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(*****************************************************************************
|* *|
|* Copyright 2005-2008 NVIDIA Corporation. All rights reserved. *|
|* *|
|* NOTICE TO USER: *|
|* *|
|* This source code is subject to NVIDIA ownership rights under U.S. *|
|* and international Copyright laws. Users and possessors of this *|
|* source code are hereby granted a nonexclusive, royalty-free *|
|* license to use this code in individual and commercial software. *|
|* *|
|* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE *|
|* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR *|
|* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH *|
|* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF *|
|* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR *|
|* PURPOSE. IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, *|
|* INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES *|
|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN *|
|* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *|
|* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE *|
|* CODE. *|
|* *|
|* U.S. Government End Users. This source code is a "commercial item" *|
|* as that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting *|
|* of "commercial computer software" and "commercial computer software *|
|* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) *|
|* and is provided to the U.S. Government only as a commercial end item. *|
|* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through *|
|* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the *|
|* source code with only those rights set forth herein. *|
|* *|
|* Any use of this source code in individual and commercial software must *|
|* include, in the user documentation and internal comments to the code, *|
|* the above Disclaimer and U.S. Government End Users Notice. *|
|* *|
|* *|
*****************************************************************************)
{ Header translation by (2008) Andreas Hausladen (Andreas DOTT Hausladen ATT gmx DOTT de) }
{ Header update }
{ * added stereoscopic API }
{ * changed NVHandle usage }
{ * ported for FPC }
{ by (2010) Dmitry Boyarintsev (skalogryz DOTT lists ATT gail DOTT com) }
///////////////////////////////////////////////////////////////////////////////
//
// Date: Aug 24, 2008
// File: nvapi.h
//
// NvAPI provides an interface to NVIDIA devices. This file contains the
// interface constants, structure definitions and function prototypes.
//
// Target Profile: developer
// Target OS-Arch: windows
//
///////////////////////////////////////////////////////////////////////////////
unit nvapi;
{$ifndef FPC}
{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N-,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$minenumsize 4}
{$else}
{$mode delphi}
{$packenum 4}
{$packrecords c}
{$NOTES OFF}
{$endif}
interface
uses
Windows;
// ====================================================
// Universal NvAPI Definitions
// ====================================================
{ 64-bit types for compilers that support them, plus some obsolete variants }
type
{$IF declared(UInt64)}
NvU64 = UInt64; { 0 to 18446744073709551615 }
{$ELSE}
NvU64 = Int64; { 0 to 18446744073709551615 }
{$IFEND}
// mac os 32-bit still needs this
NvS32 = Longint; { -2147483648 to 2147483647 }
NvU32 = LongWord;
NvU16 = Word;
NvU8 = Byte;
PNvU8 = ^NvU8;
// NVAPI Handles - These handles are retrieved from various calls and passed in to others in NvAPI
// These are meant to be opaque types. Do not assume they correspond to indices, HDCs,
// display indexes or anything else.
//
// Most handles remain valid until a display re-configuration (display mode set) or GPU
// reconfiguration (going into or out of SLI modes) occurs. If NVAPI_HANDLE_INVALIDATED
// is received by an app, it should discard all handles, and re-enumerate them.
//
{$ifndef FPC}
NvHandle = LongWord;
{$else}
NvHandle = PtrUInt;
{$endif}
// Display Device driven by NVIDIA GPU(s) (an attached display)
NvDisplayHandle = NvHandle;
// Unattached Display Device driven by NVIDIA GPU(s)
NvUnAttachedDisplayHandle = NvHandle;
// One or more physical GPUs acting in concert (SLI)
NvLogicalGpuHandle = NvHandle;
// A single physical GPU
NvPhysicalGpuHandle = NvHandle;
// A handle to an event registration instance
NvEventHandle = NvHandle;
const
NVAPI_DEFAULT_HANDLE = 0;
NVAPI_GENERIC_STRING_MAX = 4096;
NVAPI_LONG_STRING_MAX = 256;
NVAPI_SHORT_STRING_MAX = 64;
type
NvSBox = record
sX: NvS32;
sY: NvS32;
sWidth: NvS32;
sHeight: NvS32;
end;
const
NVAPI_MAX_PHYSICAL_GPUS = 64;
NVAPI_MAX_LOGICAL_GPUS = 64;
NVAPI_MAX_AVAILABLE_GPU_TOPOLOGIES = 256;
NVAPI_MAX_GPU_TOPOLOGIES = NVAPI_MAX_PHYSICAL_GPUS;
NVAPI_MAX_GPU_PER_TOPOLOGY = 8;
NVAPI_MAX_DISPLAY_HEADS = 2;
NVAPI_MAX_DISPLAYS = NVAPI_MAX_PHYSICAL_GPUS * NVAPI_MAX_DISPLAY_HEADS;
NV_MAX_HEADS = 4; // Maximum heads, each with NVAPI_DESKTOP_RES resolution
NV_MAX_VID_STREAMS = 4; // Maximum input video streams, each with a NVAPI_VIDEO_SRC_INFO
NV_MAX_VID_PROFILES = 4; // Maximum output video profiles supported
type
NvAPI_String = array[0..NVAPI_GENERIC_STRING_MAX - 1] of AnsiChar;
NvAPI_LongString = array[0..NVAPI_LONG_STRING_MAX - 1] of AnsiChar;
NvAPI_ShortString = array[0..NVAPI_SHORT_STRING_MAX - 1] of AnsiChar;
type
TNvPhysicalGpuHandleArray = array[0..NVAPI_MAX_PHYSICAL_GPUS - 1] of NvPhysicalGpuHandle;
TNvLogicalGpuHandleArray = array[0..NVAPI_MAX_LOGICAL_GPUS - 1] of NvLogicalGpuHandle;
// =========================================================================================
// NvAPI Version Definition
// Maintain per structure specific version define using the MAKE_NVAPI_VERSION macro.
// Usage: #define NV_GENLOCK_STATUS_VER MAKE_NVAPI_VERSION(NV_GENLOCK_STATUS, 1)
// =========================================================================================
//#define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16))
//#define GET_NVAPI_VERSION(ver) (NvU32)((ver)>>16)
//#define GET_NVAPI_SIZE(ver) (NvU32)((ver) & 0xffff)
{$ifndef FPC}
{$IF CompilerVersion >= 18.0} {$define USEINLINE} {$ifend}
{$else}
{$define USEINLINE}
{$endif}
function GetNvAPIVersion(Ver: NvU32): NvU32; {$ifdef USEINLINE} inline; {$endif}
function GetNvAPISize(Ver: NvU32): NvU32; {$ifdef USEINLINE} inline; {$endif}
// ====================================================
// NvAPI Status Values
// All NvAPI functions return one of these codes.
// ====================================================
type
NvAPI_Status = (
NVAPI_OK = 0, // Success
NVAPI_ERROR = -1, // Generic error
NVAPI_LIBRARY_NOT_FOUND = -2, // nvapi.dll can not be loaded
NVAPI_NO_IMPLEMENTATION = -3, // not implemented in current driver installation
NVAPI_API_NOT_INTIALIZED = -4, // NvAPI_Initialize has not been called (successfully)
NVAPI_INVALID_ARGUMENT = -5, // invalid argument
NVAPI_NVIDIA_DEVICE_NOT_FOUND = -6, // no NVIDIA display driver was found
NVAPI_END_ENUMERATION = -7, // no more to enum
NVAPI_INVALID_HANDLE = -8, // invalid handle
NVAPI_INCOMPATIBLE_STRUCT_VERSION = -9, // an argument's structure version is not supported
NVAPI_HANDLE_INVALIDATED = -10, // handle is no longer valid (likely due to GPU or display re-configuration)
NVAPI_OPENGL_CONTEXT_NOT_CURRENT = -11, // no NVIDIA OpenGL context is current (but needs to be)
NVAPI_NO_GL_EXPERT = -12, // OpenGL Expert is not supported by the current drivers
NVAPI_INSTRUMENTATION_DISABLED = -13, // OpenGL Expert is supported, but driver instrumentation is currently disabled
NVAPI_EXPECTED_LOGICAL_GPU_HANDLE = -100, // expected a logical GPU handle for one or more parameters
NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE = -101, // expected a physical GPU handle for one or more parameters
NVAPI_EXPECTED_DISPLAY_HANDLE = -102, // expected an NV display handle for one or more parameters
NVAPI_INVALID_COMBINATION = -103, // used in some commands to indicate that the combination of parameters is not valid
NVAPI_NOT_SUPPORTED = -104, // Requested feature not supported in the selected GPU
NVAPI_PORTID_NOT_FOUND = -105, // NO port ID found for I2C transaction
NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106, // expected an unattached display handle as one of the input param
NVAPI_INVALID_PERF_LEVEL = -107, // invalid perf level
NVAPI_DEVICE_BUSY = -108, // device is busy, request not fulfilled
NVAPI_NV_PERSIST_FILE_NOT_FOUND = -109, // NV persist file is not found
NVAPI_PERSIST_DATA_NOT_FOUND = -110, // NV persist data is not found
NVAPI_EXPECTED_TV_DISPLAY = -111, // expected TV output display
NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112, // expected TV output on D Connector - HDTV_EIAJ4120.
NVAPI_NO_ACTIVE_SLI_TOPOLOGY = -113, // SLI is not active on this device
NVAPI_SLI_RENDERING_MODE_NOTALLOWED = -114, // setup of SLI rendering mode is not possible right now
NVAPI_EXPECTED_DIGITAL_FLAT_PANEL = -115, // expected digital flat panel
NVAPI_ARGUMENT_EXCEED_MAX_SIZE = -116, // argument exceeds expected size
NVAPI_DEVICE_SWITCHING_NOT_ALLOWED = -117, // inhibit ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI Active
NVAPI_TESTING_CLOCKS_NOT_SUPPORTED = -118, // testing clocks not supported
NVAPI_UNKNOWN_UNDERSCAN_CONFIG = -119, // the specified underscan config is from an unknown source (e.g. INF)
NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO = -120, // timeout while reconfiguring GPUs
NVAPI_DATA_NOT_FOUND = -121, // Requested data was not found
NVAPI_EXPECTED_ANALOG_DISPLAY = -122, // expected analog display
NVAPI_NO_VIDLINK = -123, // No SLI video bridge present
NVAPI_REQUIRES_REBOOT = -124, // NVAPI requires reboot for its settings to take effect
NVAPI_INVALID_HYBRID_MODE = -125, // the function is not supported with the current hybrid mode.
NVAPI_MIXED_TARGET_TYPES = -126, // The target types are not all the same
NVAPI_SYSWOW64_NOT_SUPPORTED = -127, // the function is not supported from 32-bit on a 64-bit system
NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128, //there is any implicit GPU topo active. Use NVAPI_SetHybridMode to change topology.
NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129, //Prompt the user to close all non-migratable apps.
NVAPI_OUT_OF_MEMORY = -130, // Could not allocate sufficient memory to complete the call
NVAPI_WAS_STILL_DRAWING = -131, // The previous operation that is transferring information to or from this surface is incomplete
NVAPI_FILE_NOT_FOUND = -132, // The file was not found
NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS = -133, // There are too many unique instances of a particular type of state object
NVAPI_INVALID_CALL = -134, // The method call is invalid. For example, a method's parameter may not be a valid pointer
NVAPI_D3D10_1_LIBRARY_NOT_FOUND = -135, // d3d10_1.dll can not be loaded
NVAPI_FUNCTION_NOT_FOUND = -136 // Couldn't find the function in loaded dll library
);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_Initialize
//
// DESCRIPTION: Initializes NVAPI library. This must be called before any
// other NvAPI_ function.
//
// SUPPORTED OS: Mac OS X, Windows XP and higher
//
// RETURN STATUS: NVAPI_ERROR Something is wrong during the initialization process (generic error)
// NVAPI_LIBRARYNOTFOUND Can not load nvapi.dll
// NVAPI_OK Initialized
//
///////////////////////////////////////////////////////////////////////////////
function NvAPI_Initialize(): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetErrorMessage
//
// DESCRIPTION: converts an NvAPI error code into a null terminated string
//
// SUPPORTED OS: Mac OS X, Windows XP and higher
//
// RETURN STATUS: null terminated string (always, never NULL)
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetErrorMessage: function(nr: NvAPI_Status; var szDesc: NvAPI_ShortString): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetInterfaceVersionString
//
// DESCRIPTION: Returns a string describing the version of the NvAPI library.
// Contents of the string are human readable. Do not assume a fixed
// format.
//
// SUPPORTED OS: Mac OS X, Windows XP and higher
//
// RETURN STATUS: User readable string giving info on NvAPI's version
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetInterfaceVersionString: function(var szDesc: NvAPI_ShortString): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetDisplayDriverVersion
//
// DESCRIPTION: Returns a struct that describes aspects of the display driver
// build.
//
// SUPPORTED OS: Mac OS X, Windows XP and higher
//
// RETURN STATUS: NVAPI_ERROR or NVAPI_OK
//
///////////////////////////////////////////////////////////////////////////////
type
NV_DISPLAY_DRIVER_VERSION = record
version: NvU32; // Structure version
drvVersion: NvU32;
bldChangeListNum: NvU32;
szBuildBranchString: NvAPI_ShortString;
szAdapterString: NvAPI_ShortString;
end;
TNvDisplayDriverVersion = NV_DISPLAY_DRIVER_VERSION;
PNvDisplayDriverVersion = ^TNvDisplayDriverVersion;
const
//#define NV_DISPLAY_DRIVER_VERSION_VER MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_VERSION,1)
NV_DISPLAY_DRIVER_VERSION_VER = NvU32(SizeOf(NV_DISPLAY_DRIVER_VERSION) or (1 shl 16));
var
NvAPI_GetDisplayDriverVersion: function(hNvDisplay: NvDisplayHandle; pVersion: PNvDisplayDriverVersion): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_EnumNvidiaDisplayHandle
//
// DESCRIPTION: Returns the handle of the NVIDIA display specified by the enum
// index (thisEnum). The client should keep enumerating until it
// returns NVAPI_END_ENUMERATION.
//
// Note: Display handles can get invalidated on a modeset, so the calling applications need to
// renum the handles after every modeset.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: either the handle pointer is NULL or enum index too big
// NVAPI_OK: return a valid NvDisplayHandle based on the enum index
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device found in the system
// NVAPI_END_ENUMERATION: no more display device to enumerate.
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_EnumNvidiaDisplayHandle: function(thisEnum: NvU32; var NvDispHandle: NvDisplayHandle): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_EnumNvidiaUnAttachedDisplayHandle
//
// DESCRIPTION: Returns the handle of the NVIDIA UnAttached display specified by the enum
// index (thisEnum). The client should keep enumerating till it
// return error.
//
// Note: Display handles can get invalidated on a modeset, so the calling applications need to
// renum the handles after every modeset.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: either the handle pointer is NULL or enum index too big
// NVAPI_OK: return a valid NvDisplayHandle based on the enum index
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device found in the system
// NVAPI_END_ENUMERATION: no more display device to enumerate.
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_EnumNvidiaUnAttachedDisplayHandle: function(thisEnum: NvU32; var NvUnAttachedDispHandle: NvUnAttachedDisplayHandle): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_EnumPhysicalGPUs
//
// DESCRIPTION: Returns an array of physical GPU handles.
//
// Each handle represents a physical GPU present in the system.
// That GPU may be part of a SLI configuration, or not be visible to the OS directly.
//
// At least 1 GPU must be present in the system and running an NV display driver.
//
// The array nvGPUHandle will be filled with physical GPU handle values. The returned
// gpuCount determines how many entries in the array are valid.
//
// Note: In drivers older than 105.00, all physical GPU handles get invalidated on a modeset. So the calling applications
// need to renum the handles after every modeset.
// With drivers 105.00 and up all physical GPU handles are constant.
// Physical GPU handles are constant as long as the GPUs are not physically moved and the SBIOS VGA order is unchanged.
//
// SUPPORTED OS: Mac OS X, Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: nvGPUHandle or pGpuCount is NULL
// NVAPI_OK: one or more handles were returned
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_EnumPhysicalGPUs: function(var nvGPUHandle: TNvPhysicalGpuHandleArray; var pGpuCount: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_EnumLogicalGPUs
//
// DESCRIPTION: Returns an array of logical GPU handles.
//
// Each handle represents one or more GPUs acting in concert as a single graphics device.
//
// At least 1 GPU must be present in the system and running an NV display driver.
//
// The array nvGPUHandle will be filled with logical GPU handle values. The returned
// gpuCount determines how many entries in the array are valid.
//
// Note: All logical GPUs handles get invalidated on a GPU topology change, so the calling application is required to
// renum the logical GPU handles to get latest physical handle mapping after every GPU topology change activated
// by a call to NvAPI_SetGpuTopologies.
//
// To detect if SLI rendering is enabled please use NvAPI_D3D_GetCurrentSLIState
//
// SUPPORTED OS: Mac OS X, Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: nvGPUHandle or pGpuCount is NULL
// NVAPI_OK: one or more handles were returned
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_EnumLogicalGPUs: function(var nvGPUHandle: TNvLogicalGpuHandleArray; var pGpuCount: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetPhysicalGPUsFromDisplay
//
// DESCRIPTION: Returns an array of physical GPU handles associated with the specified display.
//
// At least 1 GPU must be present in the system and running an NV display driver.
//
// The array nvGPUHandle will be filled with physical GPU handle values. The returned
// gpuCount determines how many entries in the array are valid.
//
// If the display corresponds to more than one physical GPU, the first GPU returned
// is the one with the attached active output.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvDisp is not valid; nvGPUHandle or pGpuCount is NULL
// NVAPI_OK: one or more handles were returned
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetPhysicalGPUsFromDisplay: function(hNvDisp: NvDisplayHandle; var nvGPUHandle: TNvPhysicalGpuHandleArray; var pGpuCount: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetPhysicalGPUFromUnAttachedDisplay
//
// DESCRIPTION: Returns a physical GPU handle associated with the specified unattached display.
//
// At least 1 GPU must be present in the system and running an NV display driver.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvUnAttachedDisp is not valid or pPhysicalGpu is NULL.
// NVAPI_OK: one or more handles were returned
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetPhysicalGPUFromUnAttachedDisplay: function(hNvUnAttachedDisp: NvUnAttachedDisplayHandle; var PhysicalGpu: NvPhysicalGpuHandle): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_CreateDisplayFromUnAttachedDisplay
//
// DESCRIPTION: The unattached display handle is converted to a active attached display handle.
//
// At least 1 GPU must be present in the system and running an NV display driver.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvUnAttachedDisp is not valid or pNvDisplay is NULL.
// NVAPI_OK: one or more handles were returned
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_CreateDisplayFromUnAttachedDisplay: function(hNvUnAttachedDisp: NvUnAttachedDisplayHandle; var NvDisplay: NvDisplayHandle): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetLogicalGPUFromDisplay
//
// DESCRIPTION: Returns the logical GPU handle associated with the specified display.
//
// At least 1 GPU must be present in the system and running an NV display driver.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvDisp is not valid; pLogicalGPU is NULL
// NVAPI_OK: one or more handles were returned
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetLogicalGPUFromDisplay: function(hNvDisp: NvDisplayHandle; var LogicalGPU: NvLogicalGpuHandle): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetLogicalGPUFromPhysicalGPU
//
// DESCRIPTION: Returns the logical GPU handle associated with specified physical GPU handle.
//
// At least 1 GPU must be present in the system and running an NV display driver.
//
// SUPPORTED OS: Mac OS X, Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGPU is not valid; pLogicalGPU is NULL
// NVAPI_OK: one or more handles were returned
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetLogicalGPUFromPhysicalGPU: function(hPhysicalGPU: NvPhysicalGpuHandle; var LogicalGPU: NvLogicalGpuHandle): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetPhysicalGPUsFromLogicalGPU
//
// DESCRIPTION: Returns the physical GPU handles associated with the specified logical GPU handle.
//
// At least 1 GPU must be present in the system and running an NV display driver.
//
// The array hPhysicalGPU will be filled with physical GPU handle values. The returned
// gpuCount determines how many entries in the array are valid.
//
// SUPPORTED OS: Mac OS X, Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hLogicalGPU is not valid; hPhysicalGPU is NULL
// NVAPI_OK: one or more handles were returned
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
// NVAPI_EXPECTED_LOGICAL_GPU_HANDLE: hLogicalGPU was not a logical GPU handle
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetPhysicalGPUsFromLogicalGPU: function(hLogicalGPU: NvLogicalGpuHandle; var hPhysicalGPU: TNvPhysicalGpuHandleArray; var pGpuCount: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetAssociatedNvidiaDisplayHandle
//
// DESCRIPTION: Returns the handle of the NVIDIA display that is associated
// with the display name given. Eg: "\\DISPLAY1"
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: either argument is NULL
// NVAPI_OK: *pNvDispHandle is now valid
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device maps to that display name
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetAssociatedNvidiaDisplayHandle: function(const szDisplayName: PAnsiChar; var NvDispHandle: NvDisplayHandle): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetAssociatedNvidiaDisplayName
//
// DESCRIPTION: Returns the display name given. Eg: "\\DISPLAY1" using the NVIDIA display handle
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: either argument is NULL
// NVAPI_OK: *pNvDispHandle is now valid
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device maps to that display name
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetAssociatedNvidiaDisplayName: function(NvDispHandle: NvDisplayHandle; var szDisplayName: NvAPI_ShortString): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetUnAttachedAssociatedDisplayName
//
// DESCRIPTION: Returns the display name given. Eg: "\\DISPLAY1" using the NVIDIA unattached display handle
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: either argument is NULL
// NVAPI_OK: *pNvDispHandle is now valid
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device maps to that display name
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetUnAttachedAssociatedDisplayName: function(hNvUnAttachedDisp: NvUnAttachedDisplayHandle; var szDisplayName: NvAPI_ShortString): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_EnableHWCursor
//
// DESCRIPTION: Enable hardware cursor support
//
// SUPPORTED OS: Windows XP
//
// RETURN STATUS: NVAPI_ERROR or NVAPI_OK
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_EnableHWCursor: function(hNvDisplay: NvDisplayHandle): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_DisableHWCursor
//
// DESCRIPTION: Disable hardware cursor support
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_ERROR or NVAPI_OK
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_DisableHWCursor: function(hNvDisplay: NvDisplayHandle): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetVBlankCounter
//
// DESCRIPTION: get vblank counter
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_ERROR or NVAPI_OK
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetVBlankCounter: function(hNvDisplay: NvDisplayHandle; var pCounter: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
// FUNCTION NAME: NvAPI_SetRefreshRateOverride
// DESCRIPTION: Override the refresh rate on the given display/outputsMask.
// The new refresh rate can be applied right away in this API call or deferred to happen with the
// next OS modeset. The override is only good for one modeset (doesn't matter it's deferred or immediate).
//
// SUPPORTED OS: Windows XP
//
//
// INPUT: hNvDisplay - the NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle
// enumerated from NvAPI_EnumNVidiaDisplayHandle().
//
// outputsMask - a set of bits that identify all target outputs which are associated with the NVIDIA
// display handle to apply the refresh rate override. Note when SLI is enabled, the
// outputsMask only applies to the GPU that is driving the display output.
//
// refreshRate - the override value. "0.0" means cancel the override.
//
//
// bSetDeferred - "0": apply the refresh rate override immediately in this API call.
// "1": apply refresh rate at the next OS modeset.
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvDisplay or outputsMask is invalid
// NVAPI_OK: the refresh rate override is correct set
// NVAPI_ERROR: the operation failed
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_SetRefreshRateOverride: function(hNvDisplay: NvDisplayHandle; outputMask: NvU32; refreshRate: Double; bSetDeferred: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GetAssociatedDisplayOutputId
//
// DESCRIPTION: Gets the active outputId associated with the display handle.
//
// SUPPORTED OS: Windows XP and higher
//
// PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
// outputId(OUT) - The active display output id associated with the selected display handle hNvDisplay.
// The outputid will have only one bit set. In case of clone or span this will indicate the display
// outputId of the primary display that the GPU is driving.
// RETURN STATUS: NVAPI_OK: call successful.
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found.
// NVAPI_EXPECTED_DISPLAY_HANDLE: hNvDisplay is not a valid display handle.
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GetAssociatedDisplayOutputId: function(hNvDisplay: NvDisplayHandle; var pOutputId: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
// FUNCTION NAME: NvAPI_GetDisplayPortInfo
//
// DESCRIPTION: This API returns the current DP related into on the specified device(monitor)
//
// SUPPORTED OS: Windows XP and higher
//
// PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
// outputId(IN) - The display output id. If it's "0" then the default outputId from NvAPI_GetAssociatedDisplayOutputId() will be used.
// pInfo(OUT) - The display port info
//
// RETURN STATUS:
// NVAPI_OK - completed request
// NVAPI_ERROR - miscellaneous error occurred
// NVAPI_INVALID_ARGUMENT: Invalid input parameter.
//
///////////////////////////////////////////////////////////////////////////////
type
NV_DP_LINK_RATE = (
NV_DP_1_62GBPS = 6,
NV_DP_2_70GBPS = $A
);
NV_DP_LANE_COUNT = (
NV_DP_1_LANE = 1,
NV_DP_2_LANE = 2,
NV_DP_4_LANE = 4
);
NV_DP_COLOR_FORMAT = (
NV_DP_COLOR_FORMAT_RGB = 0,
NV_DP_COLOR_FORMAT_YCbCr422,
NV_DP_COLOR_FORMAT_YCbCr444
);
NV_DP_COLORIMETRY = (
NV_DP_COLORIMETRY_RGB = 0,
NV_DP_COLORIMETRY_YCbCr_ITU601,
NV_DP_COLORIMETRY_YCbCr_ITU709
);
NV_DP_DYNAMIC_RANGE = (
NV_DP_DYNAMIC_RANGE_VESA = 0,
NV_DP_DYNAMIC_RANGE_CEA
);
NV_DP_BPC = (
NV_DP_BPC_DEFAULT = 0,
NV_DP_BPC_6,
NV_DP_BPC_8,
NV_DP_BPC_10,
NV_DP_BPC_12,
NV_DP_BPC_16
);
TTNvDisplayPortInfoFlags = (
isDp, isInternalDp, isColorCtrlSupported, is6BPCSupported, is8BPCSupported, is10BPCSupported,
is12BPCSupported, is16BPCSupported
);
NV_DISPLAY_PORT_INFO = record
version: NvU32; // structure version
dpcd_ver: NvU32; // the DPCD version of the monitor
maxLinkRate: NV_DP_LINK_RATE; // the max supported link rate
maxLaneCount: NV_DP_LANE_COUNT; // the max supported lane count
curLinkRate: NV_DP_LINK_RATE; // the current link rate
curLaneCount: NV_DP_LANE_COUNT; // the current lane count
colorFormat: NV_DP_COLOR_FORMAT; // the current color format
dynamicRange: NV_DP_DYNAMIC_RANGE; // the dynamic range
colorimetry: NV_DP_COLORIMETRY; // ignored in RGB space
bpc: NV_DP_BPC; // the current bit-per-component;
Flags: TTNvDisplayPortInfoFlags;
{isDp: NvU32 : 1; // if the monitor is driven by display port
isInternalDp: NvU32 : 1; // if the monitor is driven by NV Dp transmitter
isColorCtrlSupported: NvU32 : 1; // if the color format change is supported
is6BPCSupported: NvU32 : 1; // if 6 bpc is supported
is8BPCSupported: NvU32 : 1; // if 8 bpc is supported
is10BPCSupported: NvU32 : 1; // if 10 bpc is supported
is12BPCSupported: NvU32 : 1; // if 12 bpc is supported
is16BPCSupported: NvU32 : 1; // if 16 bpc is supported}
end;
TNvDisplayPortInfo = NV_DISPLAY_PORT_INFO;
const
//#define NV_DISPLAY_PORT_INFO_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO,1)
NV_DISPLAY_PORT_INFO_VER = NvU32(SizeOf(NV_DISPLAY_PORT_INFO) or (1 shl 16));
var
NvAPI_GetDisplayPortInfo: function(hNvDisplay: NvDisplayHandle; outputId: NvU32; var pInfo: TNvDisplayPortInfo): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
// FUNCTION NAME: NvAPI_SetDisplayPort
//
// DESCRIPTION: This API is used to setup DP related configurations.
//
// SUPPORTED OS: Windows XP and higher
//
// PARAMETERS: hNvDisplay(IN) - NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
// outputId(IN) - This display output ID, when it's "0" it means the default outputId generated from the return of NvAPI_GetAssociatedDisplayOutputId().
// pCfg(IN) - The display port config structure. If pCfg is NULL, it means to use the driver's default value to setup.
//
// RETURN STATUS:
// NVAPI_OK - completed request
// NVAPI_ERROR - miscellaneous error occurred
// NVAPI_INVALID_ARGUMENT: Invalid input parameter.
///////////////////////////////////////////////////////////////////////////////
type
TNvDisplayPortConfigFlags = (isHPD, isSetDeferred, isChromaLpfOff, isDitherOff);
NV_DISPLAY_PORT_CONFIG = record
version: NvU32; // structure version - 2 is latest
linkRate: NV_DP_LINK_RATE; // the link rate
laneCount: NV_DP_LANE_COUNT; // the lane count
colorFormat: NV_DP_COLOR_FORMAT; // the color format to set
dynamicRange: NV_DP_DYNAMIC_RANGE; // the dynamic range
colorimetry: NV_DP_COLORIMETRY; // ignored in RGB space
bpc: NV_DP_BPC; // the current bit-per-component;
Flags: TNvDisplayPortConfigFlags;
{isHPD: NvU32 : 1; // if CPL is making this call due to HPD
isSetDeferred: NvU32 : 1; // requires an OS modeset to finalize the setup if set
isChromaLpfOff: NvU32 : 1; // force the chroma low_pass_filter to be off
isDitherOff: NvU32 : 1; // force to turn off dither}
end;
TNvDisplayPortConfig = NV_DISPLAY_PORT_CONFIG;
const
//#define NV_DISPLAY_PORT_CONFIG_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2)
//#define NV_DISPLAY_PORT_CONFIG_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,1)
//#define NV_DISPLAY_PORT_CONFIG_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2)
NV_DISPLAY_PORT_CONFIG_VER = NvU32(SizeOf(NV_DISPLAY_PORT_CONFIG) or (2 shl 16));
NV_DISPLAY_PORT_CONFIG_VER_1 = NvU32(SizeOf(NV_DISPLAY_PORT_CONFIG) or (1 shl 16));
NV_DISPLAY_PORT_CONFIG_VER_2 = NvU32(SizeOf(NV_DISPLAY_PORT_CONFIG) or (2 shl 16));
var
NvAPI_SetDisplayPort: function(hNvDisplay: NvDisplayHandle; outputId: NvU32; var pCfg: TNvDisplayPortConfig): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
// FUNCTION NAME: NvAPI_GetHDMISupportInfo
//
// DESCRIPTION: This API returns the current infoframe data on the specified device(monitor)
//
// SUPPORTED OS: Windows Vista and higher
//
// PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
// outputId(IN) - The display output id. If it's "0" then the default outputId from NvAPI_GetAssociatedDisplayOutputId() will be used.
// pInfo(OUT) - The monitor and GPU's HDMI support info
//
// RETURN STATUS:
// NVAPI_OK - completed request
// NVAPI_ERROR - miscellaneous error occurred
// NVAPI_INVALID_ARGUMENT: Invalid input parameter.
//
///////////////////////////////////////////////////////////////////////////////
type
TNvHDMISupportInfoFlags = (
isGpuHDMICapable, isMonUnderscanCapable, isMonBasicAudioCapable, isMonYCbCr444Capable,
isMonYCbCr422Capable, isMonxvYCC601Capable, isMonxvYCC709Capable, isMonHDMI
);
NV_HDMI_SUPPORT_INFO = record
version: NvU32; // structure version
flags: TNvHDMISupportInfoFlags;
{isGpuHDMICapable: NvU32 : 1; // if the GPU can handle HDMI
isMonUnderscanCapable: NvU32 : 1; // if the monitor supports underscan
isMonBasicAudioCapable: NvU32 : 1; // if the monitor supports basic audio
isMonYCbCr444Capable: NvU32 : 1; // if YCbCr 4:4:4 is supported
isMonYCbCr422Capable: NvU32 : 1; // if YCbCr 4:2:2 is supported
isMonxvYCC601Capable: NvU32 : 1; // if xvYCC 601 is supported
isMonxvYCC709Capable: NvU32 : 1; // if xvYCC 709 is supported
isMonHDMI: NvU32 : 1; // if the monitor is HDMI (with IEEE's HDMI registry ID)}
EDID861ExtRev: NvU32; // the revision number of the EDID 861 extension
end;
TNvHDMISupportInfo = NV_HDMI_SUPPORT_INFO;
const
//#define NV_HDMI_SUPPORT_INFO_VER MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO,1)
NV_HDMI_SUPPORT_INFO_VER = NvU32(SizeOf(NV_HDMI_SUPPORT_INFO) or (1 shl 16));
var
NvAPI_GetHDMISupportInfo: function(hNvDisplay: NvDisplayHandle; outputId: NvU32; var pInfo: TNvHDMISupportInfo): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GPU_GetAllOutputs
//
// DESCRIPTION: Returns set of all GPU-output identifiers as a bitmask.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
// NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
// NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GPU_GetAllOutputs: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GPU_GetConnectedOutputs
//
// DESCRIPTION: Same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU-output
// identifiers that are connected to display devices.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
// NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
// NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GPU_GetConnectedOutputs: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputs
//
// DESCRIPTION: Same as NvAPI_GPU_GetConnectedOutputs but returns only the set of GPU-output
// identifiers that can be selected in an SLI configuration. With SLI disabled
// this function matches NvAPI_GPU_GetConnectedOutputs
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
// NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
// NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GPU_GetConnectedSLIOutputs: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GPU_GetConnectedOutputsWithLidState
//
// DESCRIPTION: Similar to NvAPI_GPU_GetConnectedOutputs this API returns the connected display identifiers that are connected
// as a output mask but unlike NvAPI_GPU_GetConnectedOutputs this API "always" reflects the Lid State in the output mask.
// Thus if you expect the LID close state to be available in the connection mask use this API.
// If LID is closed then this API will remove the LID panel from the connected display identifiers.
// If LID is open then this API will reflect the LID panel in the connected display identifiers.
// Note:This API should be used on laptop systems and on systems where LID state is required in the connection output mask.
// On desktop systems the returned identifiers will match NvAPI_GPU_GetConnectedOutputs.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
// NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
// NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GPU_GetConnectedOutputsWithLidState: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputsWithLidState
//
// DESCRIPTION: Same as NvAPI_GPU_GetConnectedOutputsWithLidState but returns only the set of GPU-output
// identifiers that can be selected in an SLI configuration. With SLI disabled
// this function matches NvAPI_GPU_GetConnectedOutputsWithLidState
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
// NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
// NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GPU_GetConnectedSLIOutputsWithLidState: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GPU_GetSystemType
//
// DESCRIPTION: Returns information to identify if the GPU type is for a laptop system or a desktop system.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
// NVAPI_OK: *pSystemType contains the GPU system type
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
// NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
//
///////////////////////////////////////////////////////////////////////////////
type
NV_SYSTEM_TYPE = (
NV_SYSTEM_TYPE_UNKNOWN = 0,
NV_SYSTEM_TYPE_LAPTOP = 1,
NV_SYSTEM_TYPE_DESKTOP = 2
);
var
NvAPI_GPU_GetSystemType: function(hPhysicalGpu: NvPhysicalGpuHandle; var pSystemType: NV_SYSTEM_TYPE): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION NAME: NvAPI_GPU_GetActiveOutputs
//
// DESCRIPTION: Same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU-output
// identifiers that are actively driving display devices.
//
// SUPPORTED OS: Windows XP and higher
//
// RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
// NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
// NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
// NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
//
///////////////////////////////////////////////////////////////////////////////
var
NvAPI_GPU_GetActiveOutputs: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
///////////////////////////////////////////////////////////////////////////////
//