sr: Improve display support

 * As we start using this recovery code on new devices, various
   display quirks are showing up. Let's do it right.
 * Previously we used a single ION buffer and just altered the
   offset when pageflipping. Some older versions of MDSS (kernel)
   don't properly crop the destination rect (hammerhead), so
   let's allocate two buffers and flip between them with the offset
   always at zero.
 * Some display hardware and MDSS kernel versions don't like us
   just shoving buffers down it's throat without vsync running.
   Implemented a simple vsync loop which enables the interrupt
   on-demand and uses a simple signal mechanism to notify waiters.
   The display loop will wait for a vsync before committing
   the current buffer to MDP, and the interrupt will be disabled
   automatically when drawing is done.
 * This also smooths out some of the jank when selecting options
   using the touch UI.

Change-Id: If140b78acf6eaf6d3927cda9f83ac4aee3a64bad
sr: Fix the progress bar

 * The progress thread is running all the time, which causes the device
   to heat up while in recovery. Start this thread only when the
   progress mode is set to something other than EMPTY, and add a
   terminating condition so that it exits when finished.
 * Incorporate Tom's patch to keep it updated when visible, since
   both are needed to get working progress indications without
   killing batteries.

Change-Id: Ib70d2cb25f01d9920ffb698b5b5b47af827ef483