summaryrefslogtreecommitdiffstats
path: root/libs/gui/BufferQueue.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix argument types in IGraphicBufferProducer methodsJesse Hall2013-03-181-3/+3
| | | | | Bug: 8384764 Change-Id: I7a3f1e1a0584a70af04f9eafef900505389d2202
* workaround a deadlock when taking screenshots into a surfaceMathias Agopian2013-03-111-2/+2
| | | | | | | | | | When disconnecting from BufferQueue, we now drain the queue except the head (which means in the screenshot case we won't have to block, but we might not have a buffer to show, this will appear as an error in the log). Bug: 8362363 Change-Id: If80989aac3c917beea2ebddf3cbb502849d394da
* libgui: disallow NULL Fence pointersJamie Gennis2013-02-121-9/+14
| | | | | | | | | This change eliminates the uses of a NULL sp<Fence> indicating that no waiting is required. Instead we use a non-NULL but invalid Fence object for which the wait methods will return immediately. Bug: 7892871 Change-Id: I5360aebe3090422ef6920d56c99fc4eedc642e48
* Rename ISurfaceTexture and SurfaceTextureAndy McFadden2012-12-181-10/+10
| | | | | | | | | | 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
* Refactor SurfaceTexture a bit.Andy McFadden2012-12-111-1/+0
| | | | | | | | | | | | 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
* fix typo that broke all the buildsMathias Agopian2012-11-191-6/+3
| | | | | | | cherry pick into master since auto-merger is blocked Bug: 7584338 Change-Id: Ie7d7c238de1fd224b3b0bae9669a8dcb2f700a79
* fix an out-of-bounds memory accessMathias Agopian2012-11-151-4/+6
| | | | | | | | in this particular case, this OOB is always harmless (and that's why it didn't get fixed from MR1), however, it interfers with valgrind debugging. Change-Id: Ic977e03287e59c4b124a89146c9023bd0cb540a8
* BufferQueue: alloc without holding the lockJamie Gennis2012-10-111-11/+25
| | | | | | | | | | This change makes BufferQueue::dequeueBuffer release its mutex before allocating new buffers. This should alleviate lock contention in SurfaceFlinger where SF's main thread can get blocked waiting for an allocation operation to complete. Bug: 7335075 Change-Id: I1b000539cc616a695afab2e9c68507db69e57b13
* libgui: fix up compile optionsJamie Gennis2012-10-031-35/+10
| | | | | | | | | This change adds debug info to SurfaceFlinger's dumpsys to indicate that the USE_WAIT_SYNC compile option was enabled, and it removes the ALLOW_DEQUEUE_CURRENT_BUFFER option. Bug: 7238122 Change-Id: I70e08e34c2ef58aa6d2f88229e781a119f84b5a9
* Fix transform hintsAndy McFadden2012-09-161-2/+4
| | | | | | | | | The hints were being set a little too late, so the pre-rotation stuff wasn't quite working. Bug 7054997 Change-Id: Id8d5c626db7a76f768ba762a145b315878ee08e6
* BufferQueue: add a setMaxAcquiredBufferCount checkJamie Gennis2012-09-041-0/+5
| | | | | | | This change adds a check to verify the validity of the value passed to setMaxAcquiredBufferCount. Change-Id: I39730557aa58261e678bd6e4fce11bab78e98362
* BufferQueue: add a check for the max acquired bufsJamie Gennis2012-08-301-0/+17
| | | | | | | This change adds an error check to ensure that consumers don't acquire more buffers than the maximum that they set. Change-Id: I026643564bde52732e4ee6146972b207ddbbba77
* BufferQueue: use max acquired buffer countJamie Gennis2012-08-301-14/+29
| | | | | | | | | This change makes BufferQueue derive the min undequeued buffer count from a max acquired buffer count that is set by the consumer. This value may be set at any time that a producer is not connected to the BufferQueue rather than at BufferQueue construction time. Change-Id: Icf9f1d91ec612a079968ba0a4621deffe48f4e22
* BufferQueue: simplify max buffer count handlingJamie Gennis2012-08-291-82/+68
| | | | | | This change reworks how the maximum buffer count is computed. Change-Id: I7d3745814b9bd6f6f447f86bfea8eb7729914ebf
* BufferQueue: clean up buffer countingJamie Gennis2012-08-291-51/+52
| | | | | | | | This change is a clean up of some of the handling of the maximum number of buffers that are allowed at once. It mostly renames a few member variables and methods, but it includes a couple small refactorings. Change-Id: I9959310f563d09583548d4291e1050a7bbc7d87d
* surfaceflinger: refactor FrambufferSurfaceJamie Gennis2012-08-061-30/+22
| | | | | | | | This change refactors the FramebufferSurface class to inherit from the new ConsumerBase class. Bug: 6620200 Change-Id: I46ec942ddb019658e3c5e79465548b171b2261f2
* Return fence from acquireBufferJesse Hall2012-06-301-0/+2
| | | | Change-Id: Iab22054c1dc4fd84affab3cc5bbdcd5a1e689666
* Pass fences with buffers from SurfaceTextureClientJesse Hall2012-06-301-18/+21
| | | | Change-Id: I09b49433788d01e8b2b3684bb4d0112be29538d3
* Pass fences from BufferQueue to SurfaceTextureClientJesse Hall2012-06-211-14/+3
| | | | | | | | | | ISurfaceTexture::dequeueBuffer now returns the buffer's fence for the client to wait on. For BufferQueue, this means passing it through Binder so it can be returned to the SurfaceTextureClient. Now SurfaceTextureClient is responsible for waiting on the fence in dequeueBuffer instead of BufferQueue: one step closer to the goal. Change-Id: I677ae758bcd23acee2d784b8cec11b32cccc196d
* Transfer HWC release fences to BufferQueueJesse Hall2012-06-211-4/+17
| | | | | | | | | | | | | | | | | | After a HWC set, each SurfaceFlinger Layer retrieves the release fence HWC returned and gives it to the layer's SurfaceTexture. The SurfaceTexture accumulates the fences into a merged fence until the next updateTexImage, then passes the merged fence to the BufferQueue in releaseBuffer. In a follow-on change, BufferQueue will return the fence along with the buffer slot in dequeueBuffer. For now, dequeueBuffer waits for the fence to signal before returning. The releaseFence default value for BufferQueue::releaseBuffer() is temporary to avoid transient build breaks with a multi-project checkin. It'll disappear in the next change. Change-Id: Iaa9a0d5775235585d9cbf453d3a64623d08013d9
* Implement SurfaceFlinger's ANW on top of BufferQueueMathias Agopian2012-06-131-5/+10
| | | | | | | | SF now has its own implementation of ANW for the framebuffer and it uses BufferQueue. FramebufferNativeWindow is now only used by stand-alone apps. Change-Id: Iddeb24087df62bd92b0f78e391dda9b97ddc859c
* Remove misleading and wrong ALOGWMathias Agopian2012-05-181-2/+0
| | | | | Bug: 6476587 Change-Id: I4345f1100db02786bb50ad83ca7b559cad301706
* libgui: remove setPostTransformCropJamie Gennis2012-05-141-2/+2
| | | | | | | | This change removes the setPostTransformCrop function from SurfaceTextureClient. It also includes a small logging fix in BufferQueue. Bug: 6299171 Change-Id: Ifd0ed05b95dad6085e7a8267fda4d69b76ea3bad
* libgui: improve some logging and dumpingJamie Gennis2012-05-101-5/+16
| | | | | | | | | | This change updates some of the SurfaceTextureClient and BufferQueue logging and dumping to include the crop, transform and scaling mode. It also removes the uses of the NO_SCALE_CROP scaling mode enum, which was added by accident in a previous change. Change-Id: I62912716a1e48885fb22f12b92678aa13f10fcd9 Bug: 6470541
* libgui: Add support for post-xform crops.Jamie Gennis2012-05-081-9/+14
| | | | | | | | This change adds support for specifying a crop rectangle to a SurfaceTextureClient that is in post-transformed coordinate space. Change-Id: I247901de343e71b32850f7ae3bac62dfa612ad3d Bug: 6299171
* libgui: Add plumbing for active rectangleJamie Gennis2012-04-241-14/+18
| | | | | | | | This change adds the plumbing to SurfaceTextureClient, BufferQueue, and SurfaceTexture to get the active rectangle passed to the ANativeWindow to the buffer consumer. Change-Id: I35da0889b266327ebb079b6a7136fa3e2e8b00e6
* add a way to query whether an ANativeWindow consumer is running ahead of the ↵Mathias Agopian2012-04-231-2/+7
| | | | | | producer Change-Id: Ibccfa1feb56db2ab11f0c0934ce2d570a2b65ae2
* update the binder protocol for connect to match that of queueBufferMathias Agopian2012-04-231-5/+2
| | | | | | | indeed, connect and queueBuffer return the same data, so it's easier to have them use the same protocol. Change-Id: I4f9fa3be0a80c9ab0a7a4039b282ae843aab02e1
* Fix BufferQueue verbose logEino-Ville Talvala2012-04-181-2/+6
| | | | Change-Id: Id80742b5c1fd2960cc2eda3a9ba2db1078df5320
* Remove fixed USAGE_HW_TEXTURE flag from BufferQueue.Eino-Ville Talvala2012-04-181-1/+0
| | | | | | | USAGE_HW_TEXTURE applies to SurfaceTexture, not to all uses of BufferQueue. Refactor accordingly. Change-Id: Ic7add5e1f2bbec3d3e796ba7f15eaa0633945d8f
* BufferQueue: check before tracing buffer indexJamie Gennis2012-04-161-3/+6
| | | | | | | This change adds a check on ATRACE_ENABLED before calling snprintf to trace the buffer index. Change-Id: Id79430f9c69706393efd3d10780a4cc97055e9e0
* make sure to pass the transform-hint on ANW.connectMathias Agopian2012-04-161-1/+1
| | | | | | this optimization was probably lost during ST refactoring. Change-Id: I845978c4b718cb91941d15b30484837f19714abe
* fix a typo causing pre-rotation to never workMathias Agopian2012-04-121-1/+1
| | | | Change-Id: I8d698ec52d53ef1a553b887c7329413e1f49cc72
* Enabled cropping support in SurfaceTextureDaniel Lam2012-04-121-1/+3
| | | | | | | | | SurfaceTexture will modify the crop rect so it matches the desired output aspect ratio when the scaling mode is NATIVE_WINDOW_SCALING_MODE_CROP. Added a test for this new scaling mode. Change-Id: I60f24dcbc294b65cd10a393d9e27d40f07d27bb6
* use in/out structures for queueBuffer() IPCMathias Agopian2012-04-101-9/+12
| | | | Change-Id: Ie125df2444b62a9a2200586a717dca268852afc9
* BufferQueue returns proper code on acquireDaniel Lam2012-04-091-2/+1
| | | | | | | Also removed unnecessary debug messages from SurfaceTextureClient. Change-Id: I291897a44170142f9d42a007b008823fad4683e0
* BufferQueue no longer hardcodes buffer countsDaniel Lam2012-04-061-10/+16
| | | | | | | BufferQueue is now more flexible as it can be used by SurfaceMediaSource in addition to SurfaceTexture. Change-Id: I4222be8918d63372c44fcd412d9ad241c6a3eeb9
* Fixed disconnect bug in SurfaceTextureDaniel Lam2012-04-021-41/+58
| | | | | | | | | BufferQueue's disconnect could race with updateTexImage where invalid buffers could be released. Additionally fixed similar bug with setBufferCount. Tests were added to stress the disconnect mechanism. Change-Id: I9afa4c64f3e025984e8a9e8d924852a71d044716
* reduce IPC with BufferQueueMathias Agopian2012-03-301-63/+14
| | | | | | | | collapse setCrop, setTransform and setScalingMode to queueBuffer() this ends up simplifying things quite a bit and reducing the numnber of IPC needed per frame. Change-Id: I3a13c07603abe4e76b8251e6380b107fde22e6d9
* libgui: add BQ consumer buffer free notificationsJamie Gennis2012-03-191-45/+113
| | | | | | | | | | | | | | | | | | | This change adds a new callback for BufferQueue consumers to be notified when the BufferQueue frees some or all of its buffers. This is needed to retain SurfaceTexture behavior where all buffers would be freed when the producer disconnects. This change also modifies the SurfaceTextureGLToGLTest.EglDestroySurfaceUnrefsBuffers test to catch when the buffers are not freed. The implementation is a little complicated because it needs to avoid circular sp<> references across what will be a binder interface (so wp<> can't be used directly). It also needs to avoid the possibility of locking the BufferQueue and consumer (e.g. SurfaceTexture) mutexes in the wrong order. This change also includes a few additional fixes and test cleanups. Change-Id: I27b77d0af15cb4b135f4b63573f634f5f0da2182
* SurfaceTexture: Fully refactored from BufferQueueDaniel Lam2012-03-131-5/+35
| | | | | | SurfaceTexture and BufferQueue are separate objects. Change-Id: I230bc0ae6f78d0f9b2b5df902f40ab443ed5a055
* attempt to fix a deadlock in SurfaceTextureClient::disconnectDave Burke2012-03-121-8/+9
| | | | | | | | - condition wasn't signaled if an error happened between acquire and release - also replace signal with broadcasts Bug: 6109450 Change-Id: I8ac03c7eca35c9cc04a00ef7fad36bb9cb3fcef6
* BufferQueue: fixed issues with buffer slots not availableDaniel Lam2012-03-081-7/+2
| | | | | Bug: 6120953 Change-Id: I61d97d650c8dee0a6d7c19f2f50aa92a5f159095
* Merge "Add ATRACEs for Buffer indices"Mathias Agopian2012-03-051-0/+15
|\
| * Add ATRACEs for Buffer indicesMathias Agopian2012-03-011-0/+15
| | | | | | | | Change-Id: I44d7a9a9bf03f418cab2a4854583aac9e533daee
* | BufferQueue: fixed acquire operationDaniel Lam2012-03-021-0/+1
|/ | | | | Bug: 6082872 Change-Id: I897dc61eb84fed953e51f97871cd3ae6321505d4
* Add tracing to various graphics components.Jamie Gennis2012-02-271-0/+18
| | | | | | | This change adds ATRACE call tracing to BufferQueue, SurfaceTextureClient, SurfaceTexture, SurfaceFlinger, Layer, and EGL. Change-Id: I9d75ed26f5a3f0d1af635da38289520134cfbbb7
* Removed dependecies between BufferQueue and SurfaceTextureDaniel Lam2012-02-271-46/+218
| | | | | | | | | Refactored SurfaceTexture and BufferQueue such that share no protected members. Created an consumer facing interface for BufferQueue in preparation of connecting SurfaceTexture and BufferQueue through a binder. Change-Id: I938e63e085128148c58d0e26c7213b30145c109f
* Merge "Revert "Removed dependecies between BufferQueue and SurfaceTexture""Jamie Gennis2012-02-271-211/+45
|\
| * Revert "Removed dependecies between BufferQueue and SurfaceTexture"Daniel Lam2012-02-271-211/+45
| | | | | | This reverts commit a631399f71dbc7659d2f241968f85d337726ae61