Hi,
After multiple tests on Optimus laptops and dGPU desktop PCs, it seems the NvAPI_DISP_GetDisplayConfig function only returns PathInfo objects for the display targets connected to the NVIDIA card itself. It won’t return any other display targets plugged in to non-NVIDIA GPU video adapaters . Can you please confirm this is supposed to happen?
What this means is that if I capture the NvAPI_DISP_GetDisplayConfig PathInfos array, then attempt to use that same array as an input to NvAPI_DISP_SetDisplayConfig, NvAPI_DISP_SetDisplayConfig fails with a NV_STATUS of -5 (Invalid arguments).
During my testing, if I have test on a desktop PC with the displays only connected to a NVIDIA dGPU, then putting the PathInfo output of the NvAPI_DISP_GetDisplayConfig function into NvAPI_DISP_SetDisplayConfig works perfectly. The screen layout is updated as it should be. But if there is any non-NVIDIA display connected to a PC then NvAPI_DISP_SetDisplayConfig fails with a NV_STATUS of -5 (Invalid arguments).
I have tried this with a tweaked version of DisplayConfiguration.cpp sample code from your NvAPI driver pack, as well as some custom C# code that I have developed here and I get the same problems in both versions, so I know its not a problem with my code: NVIDIAInfo/NVIDIAInfo/NVIDIALibrary.cs at feature-revamp-displayconfig · terrymacdonald/NVIDIAInfo · GitHub
My guess is that the NvAPI_DISP_GetDisplayConfig function is only returning NVIDIA connected displays instead of returning all connected displays. I expect that this is causing issues when I then use that same PathInfo array in NvAPI_DISP_SetDisplayConfig, as it is expecting a pathinfo array containing all connected displays (when it only contains NVIDIA connected displays). NvAPI_DISP_SetDisplayConfig is then returning an error as the PathInfo array is ‘incorrect’.
Can you please confirm that NvAPI_DISP_GetDisplayConfig is supposed to only return the displaytargets connected to the NVIDIA GPUs in the PC?
Thanks
Terry