Skip to content

backends: Implement score mechanism to assign the most relevant output

Carlos Garnacho requested to merge wip/carlosg/device-mapper-scores into master

We used to pick the "best" output for each builtin/size/edid categories, and then pick the "best" (in that order) of those for each input device. This is most often enough, but is prone to wrong results in some corner cases (eg. 2 outputs with the exact same dimensions).

Change this to a score mechanism that doesn't leave outputs out. The weights are the same, but the score is accumulated if an output matches multiple categories. All outputs are evaluated and sorted by score, and input devices with the best matches are applied first (as they already did).

This should break the tie if eg. there's 2 outputs with similar dimensions, but one of them has some EDID match in addition. The output with multiple matches will score higher up, while it might have been entirely discarded with the previous implementation.

Closes: #1175 (closed)

Merge request reports