replicant-frameworks_native/services/surfaceflinger
Mathias Agopian d1a99ec6b2 fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE)
Generally we never want to lock a buffer for write access if it is at
the "head" on the surfaceflinger side. The only exception (1) is when
the buffer is not currently in use AND there is at least one queued
buffer -- in which case, SurfaceFlinger will never use said buffer
anymore, because on the next composition around, it will be able to
retire the first queued buffer.

The logic above relies on SurfaceFlinger always retiring
and locking a buffer before composition -- unfortunately this
didn't happen during a screenshot.

This could leave us in a situation where a buffer is locked by the
application for write, and used by SurfaceFlinger for texturing,
causing a hang.

Here, we fix this issue by never assuming the exception (1), it was
intended as an optimization allowing ANativeWindow::lockBuffer() to
return sooner and was justified when most of SF composition was
done in software. The actual buffer locking is now ensured by
gralloc. We could have handled screenshots in a similar way to
a regular composition, but it could have caused glitches on screen,
essentially, taking a screenshot could cause to skip a frame.

now that we removed the notion of a "inUse" buffer in surfaceflinger
a lot of code can be simplified / removed.

noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete"
is also gone.
2011-01-25 14:19:13 -08:00
..
DisplayHardware [3171580] SurfaceFlinger Bypass mode. (DO NOT MERGE) 2010-12-03 17:35:07 -08:00
tests fix [3118445] Transform * Transform does not work as expected 2010-10-24 14:53:05 -07:00
Android.mk minor clean-up. SurfaceFlinger doesn't need libpixelflinger.so. (DO NOT MERGE) 2011-01-25 14:18:15 -08:00
Barrier.h move native services under services/ 2010-07-14 17:59:35 -07:00
BlurFilter.cpp move native services under services/ 2010-07-14 17:59:35 -07:00
BlurFilter.h move native services under services/ 2010-07-14 17:59:35 -07:00
clz.cpp move native services under services/ 2010-07-14 17:59:35 -07:00
clz.h move native services under services/ 2010-07-14 17:59:35 -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 fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE) 2011-01-25 14:19:13 -08:00
Layer.h fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE) 2011-01-25 14:19:13 -08:00
LayerBase.cpp fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE) 2011-01-25 14:19:13 -08:00
LayerBase.h fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE) 2011-01-25 14:19:13 -08:00
LayerBlur.cpp surfaceflinger / GL extensions cleanup 2010-09-15 17:15:31 -07:00
LayerBlur.h move native services under services/ 2010-07-14 17:59:35 -07:00
LayerBuffer.cpp really fix [3118445] Transform * Transform does not work as expected 2010-10-27 18:04:11 -07:00
LayerBuffer.h fix [3123221] Video sticks playing back upside down following orientation switch 2010-10-24 19:03:58 -07:00
LayerDim.cpp surfaceflinger / GL extensions cleanup 2010-09-15 17:15:31 -07:00
LayerDim.h move native services under services/ 2010-07-14 17:59:35 -07:00
MessageQueue.cpp deliver invalidate messages AFTER other messages 2010-10-11 14:11:15 -07:00
MessageQueue.h move native services under services/ 2010-07-14 17:59:35 -07:00
MODULE_LICENSE_APACHE2 move native services under services/ 2010-07-14 17:59:35 -07:00
SurfaceFlinger.cpp fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE) 2011-01-25 14:19:13 -08:00
SurfaceFlinger.h fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE) 2011-01-25 14:19:13 -08:00
TextureManager.cpp surfaceflinger / GL extensions cleanup 2010-09-15 17:15:31 -07:00
TextureManager.h fix [2931513] Add support for setting the orientation of an ANativeWindow 2010-08-24 15:40:50 -07:00
Transform.cpp really fix [3118445] Transform * Transform does not work as expected 2010-10-27 18:04:11 -07:00
Transform.h fix [3118445] Transform * Transform does not work as expected 2010-10-24 14:53:05 -07:00