modesetting: Fix ms_covering_crtc() segfault with non-modesetting slave

ms_covering_crtc() uses RRFirstOutput() to determine a primary output to fall
back to if a drawable is overlapping a slave output.

If the primary output is a slave output, RRFirstOutput() will return a slave
output even if passed a master ScreenPtr. ms_covering_crtc() dereferences the
output's devPrivate, which is invalid for non-modesetting outputs, and can
crash.

Changing RRFirstOutput() could have unintended side effects for other callers,
so this change replaces the call to RRFirstOutput() with ms_first_output().
ms_first_output() ignores the primary output if it doesn't match the given
ScreenPtr, choosing the first connected output instead.

Signed-off-by: Alex Goins <agoins@nvidia.com>
3 jobs for agoins-covering-crtc-segv-fix in 8 minutes and 33 seconds (queued for 4 minutes and 5 seconds)
latest
Status Job ID Name Coverage
  Docker Image
passed #551966
debian-testing

00:00:31

 
  Build And Test
passed #551967
autotools-build-and-test

00:06:04

passed #551968
meson-build-and-test

00:01:56