winft / disman

Qt/C++ display management library
GNU Lesser General Public License v2.1
2 stars 1 forks source link

Improve output identification in edge cases #38

Open romangg opened 3 years ago

romangg commented 3 years ago

This is an overview task

This is a continuation of #20. The goal is to improve the output identification logic such that all thinkable use/edge cases are covered.

Some of the that needs to be fixed in Wayland compositors so this is an overview task listing the issues with some general information.

Output numbering for multi-GPU systems

Wayland (DRM)

KWinFT and wlroots are using at the moment the connector name + connector_type_id.

This can potentially be not unique and even different after a reboot in a multi-GPU system: Both drivers initialize the ids at the same time. That means the same display at the same connector can get a different type_id.

Instead one should use the index into the KMS resource struct. This struct is created for each GPU (retrieved on opening the DRM device) so additionally a device identifier is required. So use together:

Using this together would be also be more in line with the wording of the xdg-output protocol as it states that "names will remain consistent across sessions with the same hardware and software configuration".

Xserver

Xfree86 uses connector_type_id and a GPU offset. That might still be different each run since as mentioned before the connector_type_ids are initialized in parallel into a single global.

Multi-Stream Transport (MST)

Display Port MST allows connecting several displays at a single DP connector by daisy chaining them.

PATH property

Identification of displays in an MST setup is provided by the MST connector PATH property. Different displays may have different display properties and settings and the windowing system and Disman need therefore to exchange settings according to that path.

It is not clear if it makes a difference if an output is at first, second or later position in the chain in regards to the settings available. If not the full path would not need to be saved but only an arbitrarily sorted listing of the ouput's make, manufacturer and serial. For simplification it would still be advisable to just save the path.

Wayland

The path needs to go into the xdg-output name property. Compositors doing this already:

XServer

Xfree86 has support for MST paths.

link-status

An MST combination might get non-functional if the chosen modes are too big for the available bandwidth. In this case the kernel removes the current mode (Question: of which of the connected displays?), sets the link-status property to failed and fires a hotplug event.

Note: The link-status property is not only available for DP but also other connector types like HDMI.

Wayland

Compositors need to listen to the link-status property change and resend the configuration with the hotplug event to Disman. Compositors already doing this:

XServer

Xfree86 handles link-status. See this comment for more information.