replicant-frameworks_native/services/surfaceflinger
Mathias Agopian 7d88647473 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 14:59:31 -07:00
..
DisplayHardware don't actuate vsync hint when not needed 2012-04-27 13:55:05 -07:00
tests remove libandroid.so from targets that don't need it 2012-03-27 13:57:43 -07:00
Android.mk set vsync power hint 2012-04-26 19:52:22 -07:00
Barrier.h move native services under services/ 2010-07-22 15:28:19 -07:00
clz.cpp move native services under services/ 2010-07-22 15:28:19 -07:00
clz.h implement: "Add an ANativeWindow API for SurfaceFlinger to suggest an optimal buffer orientation" 2011-07-19 15:24:46 -07:00
DdmConnection.cpp as a debug option SrufaceFlinger can now connect to DDMS 2011-08-15 20:44:40 -07:00
DdmConnection.h as a debug option SrufaceFlinger can now connect to DDMS 2011-08-15 20:44:40 -07:00
EventThread.cpp SF could get stuck waiting for vsync when turning the screen off 2012-06-15 14:59:31 -07:00
EventThread.h make sure to disable VSYNC while screen is off 2012-04-11 15:31:40 -07:00
GLExtensions.cpp add support for [1974164] Be able to take a screen shot on the device 2010-09-24 14:56:39 -07:00
GLExtensions.h add support for [1974164] Be able to take a screen shot on the device 2010-09-24 14:56:39 -07:00
Layer.cpp sometimes we would incorrectly scale the content of a surface 2012-06-07 17:12:20 -07:00
Layer.h SurfaceFlinger: add a crop to the layer state 2012-05-11 03:16:02 -07:00
LayerBase.cpp improve resize transactions 2012-05-23 18:01:24 -07:00
LayerBase.h improve resize transactions 2012-05-23 18:01:24 -07:00
LayerDim.cpp don't attempt to clip layers anymore using glScissor 2012-04-16 03:19:15 -07:00
LayerDim.h unify SurfaceTexture and Surface 2011-06-13 15:51:35 -07:00
LayerScreenshot.cpp don't attempt to clip layers anymore using glScissor 2012-04-16 03:19:15 -07:00
LayerScreenshot.h Fix rotation displays frame N-1 briefly while rotating 2011-11-04 15:15:32 -07:00
MessageQueue.cpp Revert "handle surfaces posts independently from composition" 2012-04-11 20:43:40 -07:00
MessageQueue.h separate transactions from updates 2012-02-01 20:43:06 -08:00
MODULE_LICENSE_APACHE2 move native services under services/ 2010-07-22 15:28:19 -07:00
SurfaceFlinger.cpp SurfaceFlinger: remove all GLES scissor calls. 2012-06-05 19:14:44 -07:00
SurfaceFlinger.h make sure to clear the framebuffer when using overlays 2012-04-18 02:28:45 -07:00
SurfaceTextureLayer.cpp update the binder protocol for connect to match that of queueBuffer 2012-04-23 20:06:02 -07:00
SurfaceTextureLayer.h update the binder protocol for connect to match that of queueBuffer 2012-04-23 20:06:02 -07:00
Transform.cpp Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE 2012-01-03 22:38:27 +00:00
Transform.h SurfaceFlinger: SCALING_MODE_FREEZE cropping support 2012-05-09 12:53:13 -07:00