drmmode: use one cursor per crtc

This is a pretty beefy patch, that completely refactors how the cursor
planes are chosen, initialized, and assigned to a crtc.

This patch paves the way for improved drm plane support in the exynos drm
kernel driver by adding format and possible_crtc checking and assigning
one cursor/plane per crtc.

Essentially nothing changes though.

The only side effect will be a subtle fix for the observation in
crosbug.com/p/26514#16, that if the X server was closed while the internal
crtc was off, then the cursor overlay was left on (and hence a little
cursor would still be visible on the internal monitor if one did 'stop ui'
in docked mode, and then opened the lid).

BUG=chrome-os-partner:26514, chromium:370411
TEST=sanity check ui w/ and w/ external monitor.
TEST=powerd_dbus_suspend w/ cursor visible & not visible
TEST=See crosbug.com/p/26514#16
   => No cursor visible on internal display after step (10)

Change-Id: I3f0911c10892ad83b653e1dd82b16e3a8704bc6f
Reviewed-on: https://chromium-review.googlesource.com/198391
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
3 files changed