summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/SurfaceFlingerConsumer.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix PTS handling for buffer replacementDan Stoza2015-05-121-5/+4
| | | | | | | | | | | This changes the way that SurfaceFlinger's shadow buffer management works such that instead of tracking the size of the shadow queue in the BufferQueue, SF tracks the last frame number it has seen, and passes that into the acquireBuffer call. BufferQueueConsumer then ensures that it never returns a buffer newer than that frame number, even if that means that it must return PRESENT_LATER for an otherwise valid buffer. Change-Id: I3fcb45f683ed660c3f18a8b85ae1f8a962ba6f0e
* SurfaceFlinger: Fix PTS on stale buffersDan Stoza2015-05-011-0/+5
| | | | | | | | | | | | | | | | | | | | | SurfaceFlinger's (Layer's) shadow copy of the BufferQueue queue was getting out of sync for a few reasons. This change fixes these by doing the following: - Adds a check to re-synchronize the shadow copy every time we successfully acquire a buffer by first dropping stale buffers before removing the current buffer. - Avoids trying to perform updates for buffers which have been rejected (for incorrect dimensions) by SurfaceFlinger. - Adds IGraphicBufferConsumer::setShadowQueueSize, which allows the consumer to notify the BufferQueue that it is maintaining a shadow copy of the queue and prevents it from dropping so many buffers during acquireBuffer that it ends up returning a buffer for which the consumer has not yet received an onFrameAvailable call. Bug: 20096136 Change-Id: I78d0738428005fc19b3be85cc8f1db498043612f (cherry picked from commit 2e36f2283f48ab764b496490c73a132acf21df3a)
* SurfaceFlinger: Pass surface damage to HWCDan Stoza2015-04-151-1/+5
| | | | | | | | | Passes the surface damage from the incoming SurfaceFlingerConsumer BufferQueue down to the hardware composer HAL interface, if the HWC version number is 1.5 or greater. Bug: 11239309 Change-Id: Ic4305210593874a8d6deba3319055b2b8c57e926
* DO NOT MERGE SurfaceFlinger: Stop using IGBC::BufferItemDan Stoza2015-03-191-2/+2
| | | | | | | | | | Switches all uses of IGraphicBufferConsumer::BufferItem (and BufferQueue::BufferItem) to the BufferItem in libgui. Depends on frameworks/native I699ed0a6837076867ca756b28d1ffb2238f7a0d9. Cherry pick of I187b3a7d05196b6289596afac8fb9a9d4aebff76 Change-Id: I5bc79fb96b6cba6021af64b20890967aa3b7fcbf
* SurfaceFlinger: Do less work when using PTSDan Stoza2014-11-171-1/+1
| | | | | | | | | | | | | | | | Currently, SurfaceFlinger is very dumb about how it handles buffer updates at less than 60fps. If there is a new frame pending, but its timestamp says not to present it until later SurfaceFlinger will wake up every vsync until it is time to present it. Even worse, if SurfaceFlinger has woken up but nothing has changed, it still goes through the entire composition process. This change (mostly) fixes that inefficiency. SurfaceFlinger will still wake up every refresh period while there is a new frame pending, but if there is no work to do, it will almost immediately go back to sleep. Bug: 18111837 Change-Id: I7825bacd37f40bf26edcc6a5e0f051dce45291fb
* GLConsumer: Stop using default constructor paramsDan Stoza2014-06-241-1/+1
| | | | | | | | Removes the dependency on default constructor parameters for GLConsumer so that a different constructor prototype can safely be added. Change-Id: I0da924bbd4c141edbf305598c1be8bc575654680
* Improve SurfaceFlinger PTS estimationAndy McFadden2014-05-021-3/+5
| | | | | | | Get the next refresh time from DispSync instead of guessing based on the current time. Change-Id: I8dc72a3217bfd4e9b4c905034194d1a298cad69a
* Remove deprecated BufferQueue constructorDan Stoza2014-03-181-2/+3
| | | | | Bug: 13415624 Change-Id: I9fe15e45daa7351f1db34ee75bfee6f19cb347d3
* Add sideband streams to BufferQueue and related classesJesse Hall2014-03-111-0/+14
| | | | | | | | | | | | Sideband streams are essentially a device-specific buffer queue that bypasses the BufferQueue system. They can be used for situations with hard real-time requirements like high-quality TV and video playback with A/V sync. A handle to the stream is provided by the source HAL, and attached to a BufferQueue. The sink HAL can read buffers via the stream handle rather than acquiring individual buffers from the BufferQueue. Change-Id: Ib3f262eddfc520f4bbe3d9b91753ed7dd09d3a9b
* fix camera API 2.0 orientationMathias Agopian2013-09-171-0/+10
| | | | | | | | | we add a flag to ANativeWindow::setBufferTransform that means "apply the inverse rotation of the display this buffer is displayed onto to". Bug: 10804238 Change-Id: Id2447676271950463e8dbcef1b95935c5c3f32b2
* SurfaceFlinger now uses GLES 2.x when availableMathias Agopian2013-08-131-4/+2
| | | | | | Bug: 8679321 Change-Id: I2b152d01fb4e2de2ea9fe87f1ddbd6826d7520d7
* All consumers now take an IGraphicBufferConsumer instead of a BufferQueueMathias Agopian2013-08-061-1/+1
| | | | | | | | | | this means they only have access to the consumer end of the interface. we had a lot of code that assumed consumers where holding a BufferQueue (i.e.: both ends), so most of this change is untangling in fix that Bug: 9265647 Change-Id: Ic2e2596ee14c7535f51bf26d9a897a0fc036d22c
* always pass the BufferQueue explicitely to consumersMathias Agopian2013-07-121-5/+4
| | | | Change-Id: I883b0a7b19d8e722f9ab714ba6f49e658b02ca86
* Pay attention to buffer timestampsAndy McFadden2013-07-101-0/+3
| | | | | | | | | | | | | | When acquiring a buffer, SurfaceFlinger now computes the expected presentation time and passes it to the BufferQueue acquireBuffer() method. If it's not yet time to display the buffer, acquireBuffer() returns PRESENT_LATER instead of a buffer. The current implementation of the expected-present-time computation uses approximations and guesswork. Bug 7900302 Change-Id: If9345611c5983a11a811935aaf27d6388a5036f1
* Rename ISurfaceTexture and SurfaceTextureAndy McFadden2012-12-181-6/+6
| | | | | | | | | | The C++ class names don't match what the classes do, so rename ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to GLConsumer. Bug 7736700 Change-Id: Ia03e468888025b5cae3c0ee1995434515dbea387
* Avoid unnecessary texture bindAndy McFadden2012-12-111-2/+2
| | | | | | | In SurfaceFlingerConsumer, check to see if native fence sync is enabled. If so, defer the texture binding step to Layer::onDraw. Change-Id: I7d4034a31c0143207eea2509dfa13ef3820f9b8c
* Refactor SurfaceTexture a bit.Andy McFadden2012-12-111-0/+59
Rearranges updateTexImage() so that the SurfaceFlinger-specific behavior is in a new SurfaceFlingerConsumer subclass. SurfaceTexture behavior should not be altered. Instead of acquire-bind-release we now do acquire-release-bind, but since it's all done with the lock held there shouldn't be any externally-visible change. Change-Id: Ia566e4727945e2cfb9359fc6d2a8f8af64d7b7b7