Skip to content

backends/drm: make finding connector<->crtc combinations more efficient

Xaver Hugl requested to merge work/connector-crtc-combos into master

Commit 1: Encoders are not really relevant for the test result, except that one of the encoders for the connector must be compatible with the crtc. The kernel usually exposes only a single encoder per connector for this reason, but if a driver exposes multiple then that means KWin will do a lot more tests than is necessary. In order to prevent that from happening, do fewer syscalls and simplify code, only check supported encoders once per connector. This is inspired by https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/221, we could later switch to use that function in libdrm, too.

Commit 2: don't sort the crtc vector but instead explicitly try the current crtc. This removes sorting (obviously) and prevents one detachment from happening

For configurations where KWin actually has to search for matching combinations this might boost startup speed a little bit.

Edited by Xaver Hugl

Merge request reports

Loading