Reload hardware cursor after mode setting if it is initialized.

If the X server tries to load the cursor image while a crtc is disabled
(eg during DPMS Off), it will silently fail.  Later, if the pointer is
moved, the cursor will be displayed as some uninitialized memory pattern.

The recommended way to deal with this is to call xf86_reload_cursors()
whenever the screen is reconfigured (e.g., in set_mode_major), which will
force a reload of cursor images, if necessary.  This is what
xf86-video-intel does, for example.

Note: xf86_reload_cursors has long been fixed to handle NULL pScreen and
sw cursor.  It is safe to call it unconditionally.

Note: this patch is nearly identical to the following linaro patch, but
with a slightly different comment, fixed up formatting, plus the plumbing
to get at drmmode within set_mode_major.

(cherry picked from commit af046151a16e9d6096b29562c5f3b0e357f68f56)
From linaro: git://git.linaro.org/arm/xorg/driver/xf86-video-armsoc.git

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>

BUG=chromium:222117
TEST=1) Attach HDMI cable
     2) reboot
     3) DO NOT TOUCH the touchpad/mouse - in other words, do not make the cursor appear
     4) set_short_powerd_timeouts
     5) wait for displays to power off
     6) wake up with keyboard
       => cursor is a pointer, not a color blob

Change-Id: Iad4d010e5a0b4ca8d80e1b68f003e91e748770c7
Previous-Reviewed-on: https://chromium-review.googlesource.com/168747
(cherry picked from commit 999cb5470f02ca0d2fa67424c5ab170e63fdea5c)
Reviewed-on: https://chromium-review.googlesource.com/169641
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
1 file changed