kmsdrm: Support sorting displays via the priority hint

Use the connector name for displays and sort them according to priority, if the hint is set.
This commit is contained in:
Frank Praznik 2024-10-18 11:25:10 -04:00
parent a6e5ab437f
commit 0faf9dc4a4
3 changed files with 65 additions and 2 deletions

View file

@ -3149,13 +3149,14 @@ extern "C" {
* prioritized in the list of displays, as exposed by calling
* SDL_GetDisplays(), with the first listed becoming the primary display. The
* naming convention can vary depending on the environment, but it is usually
* a connector name (e.g. 'DP-1', 'DP-2', 'HDMI-1', etc...).
* a connector name (e.g. 'DP-1', 'DP-2', 'HDMI-A-1',etc...).
*
* On X11 and Wayland desktops, the connector names associated with displays
* On Wayland and X11 desktops, the connector names associated with displays
* can typically be found by using the `xrandr` utility.
*
* This hint is currently supported on the following drivers:
*
* - KMSDRM (kmsdrm)
* - Wayland (wayland)
*
* This hint should be set before SDL is initialized.