igt/kms_atomic: Match CRTC harder for special planes

Our heuristic for finding planes was previously matching the type, and
ensuring that the plane was valid for that CRTC. However, VC4 now has
primary/cursor planes which can wander multiple CRTCs, so we could pick
a PRIMARY plane which was not the kernel's idea of crtc->primary,
causing plane_primary_legacy to fail; ditto for cursor.

Make find_plane try harder, by preferring to return planes which are
already on the requested CRTC.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
1 file changed