About version 331.38 deprecations


From the release notes of version 331.38 one can read:

  • Deprecated display mask related configuration of display devices via NV-CONTROL and nvidia-settings. Display target specifications should be used instead - A display target is one of the display's valid names, with an optional GPU or X screen qualifier.
  • Deprecated the following NV-CONTROL attributes: NV_CTRL_CONNECTED_DISPLAYS, NV_CTRL_ENABLED_DISPLAYS, ...

I’m particularly worried because I rely on the NV_CTRL_ENABLED_DISPLAYS mask to create a mapping between X screens and physical outputs, the purpose being multiple video playback control.

The scenario is simple: I have a NVS 510 card with four mini-DP outputs which may not be all connected. Then I launch an Xorg server with four independent screens. The screens are sequentially assigned to the outputs that have something plugged in. Therefore, I need to query through NV-CTRL to find out the correspondence between X screen and physical output.

I managed to get this working by looking at the nv-control-dpy.c file in the samples directory of the nvidia-settings source package. As none of the sample programs have been updated between 331.20 and 331.38, could anyone elaborate on how to proceed to avoid this deprecation?

Thanks in advance.

Hi iSac,

The display masks were replaced with a new display device target type, since it’s now possible to have a large number of display devices connected. You can query the list of display devices physically connected to a GPU by querying the NV_CTRL_BINARY_DATA_DISPLAYS_CONNECTED_TO_GPU binary attribute. If you want to know which displays are available on a given X screen, use the NV_CTRL_BINARY_DATA_DISPLAYS_ASSIGNED_TO_XSCREEN attribute. There’s also a NV_CTRL_BINARY_DATA_DISPLAYS_ENABLED_ON_XSCREEN, but it returns the list of display devices that are actually lit up at that particular moment, which may or may not be what you need.

Please note that the complete list of display targets might change dynamically as DisplayPort 1.2 multistream devices are added and removed. If you want your application to be able to handle that sort of change, you’ll want to watch for attribute changed events on the NV_CTRL_BINARY_DATA_DISPLAY_TARGETS attribute.

I filed NVIDIA bug 1443837 to track getting the sample code updated.

Thank you very much, I’ll take an in-depth look.

FYI, the updated versions of the samples are available now in the 337.12 release: https://github.com/NVIDIA/nvidia-settings/commit/9cd9e9b40bacf743a206d3a7803f5e3a96cdb59c#diff-2