Go to file
Mathias Agopian 1ffdccc46e SF could get stuck waiting for vsync when turning the screen off
When turning the screen off we could have 2 waiters on the
vsync condition: The main vsync waiter as well as one in
onScreenReleased(). We were only signaling the condition though,
so it it would be possible to wake onScreenReleased() without waking
the main vsync thread which would then be stuck in .wait().

We fix this by just using broadcast() when receiving a vsync event.

We also add a broadcast() to signal when the state of
mUseSoftwareVSync changes.  This is important particularly for
the transition from hardware to software vsync because the main
vsync waiter might have observed mUseSoftwareVSync == false
and decided to block indefinitely pending a hardware vsync
signal that will never arrive.

Removed a potentially deadlocking wait for a signal in
onScreenReleased().  The function was trying to wait for the last
vsync event from the hardware to be delivered to clients but there
was no guarantee that another thread would signal it to wake up
again afterwards.  (As far as I can tell, the only other other
thread that might wake it up at this point would be a client
application issuing a vsync request.)  We don't really need to wait
here anyhow.  It's enough to set the mUseSoftwareVSync flag,
wake up the thread loop and go.  If there was a pending vsync
timestamp from the hardware, then the thread loop will grab
it and use it then start software vsync on the next iteration.

Bug: 6672102
Change-Id: I7c6abc23bb021d1dfc94f101bd3ce18e3a81a73e
2012-06-15 16:17:06 -07:00
build I am having second thoughts about 512m for the large heap size. 2012-06-08 13:02:09 -07:00
cmds Include stack traces for certain native processes in bugreport. 2012-06-08 11:45:00 -07:00
data/etc Move com.nxp.mifare to frameworks/native. 2012-04-12 21:24:08 -07:00
include Merge "Support looper callbacks based on smart pointers." into jb-dev 2012-05-31 18:39:13 -07:00
libs Merge "Support looper callbacks based on smart pointers." into jb-dev 2012-05-31 18:39:13 -07:00
opengl reduce PB size from 2MB to 512KB 2012-06-05 21:44:43 -07:00
services SF could get stuck waiting for vsync when turning the screen off 2012-06-15 16:17:06 -07:00
MODULE_LICENSE_APACHE2
NOTICE