modesetting: Consider RandR primary output for selectioh of sync crtc.

The "sync crtc" is the crtc used to drive the display timing of a
drawable under DRI2 and DRI3/Present. If a drawable intersects
multiple video outputs, then normally the crtc is chosen which has
the largest intersection area with the drawable.

If multiple outputs / crtc's have exacty the same intersection
area then the crtc chosen was simply the first one with maximum
intersection. Iow. the choice was random, depending on plugging
order of displays.

This adds the ability to choose a preferred output in such a tie
situation. The RandR output marked as "primary output" is chosen
on such a tie.

This new behaviour and its implementation is consistent with other
video ddx drivers. See amdgpu-ddx, ati-ddx and nouveau-ddx for
reference. This commit is a straightforward port from amdgpu-ddx.

Signed-off-by: Mario Kleiner <>
5 jobs for vrrfixformodesetting in 6 minutes and 33 seconds
Status Name Job ID Coverage
  Docker Image
passed debian-buster #14527916


  Build And Test
passed autotools #14527917


passed meson #14527918


passed meson-noglamor #14527919


passed mingw-cross-build #14527920