summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/SurfaceFlinger.h
Commit message (Collapse)AuthorAgeFilesLines
* SF transactions are now O(1) wrt IPC instead of O(N).Mathias Agopian2011-06-291-7/+2
| | | | Change-Id: I57669852cbf6aabae244ea86940a08a5a27ffc43
* PermissionCache caches permission checksMathias Agopian2011-06-271-11/+6
| | | | | | | | | | | | | This is intended to absorb the cost of the IPC to the permission controller. Cached permission checks cost about 3us, while full blown ones are two orders of magnitude slower. CAVEAT: PermissionCache can only handle system permissions safely for now, because the cache is not purged upon global permission changes. Change-Id: I8b8a5e71e191e3c01e8f792f253c379190eee62e
* unify SurfaceTexture and SurfaceMathias Agopian2011-06-131-39/+3
| | | | | | | Add the concept of synchronous dequeueBuffer in SurfaceTexture Implement {Surface|SurfaceTextureClient}::setSwapInterval() Add SurfaceTexture logging fix onFrameAvailable
* Fix a race that could cause GL commands to be executed from the wrong thread.Mathias Agopian2011-05-191-4/+9
| | | | Change-Id: Ia3d407f7bf2f5553f46cfdade70b7b0badb35beb
* Fix a race in SurfaceFlinger that could cause layers to be leaked forever.Mathias Agopian2011-05-031-0/+1
| | | | | | | | | | | | | | | | The transaction flags were atomically read-and-cleared to determine if a transaction was needed, in the later case, mStateLock was taken to keep the current state still during the transaction. This left a small window open, where a layer could be removed after the transaction flags were checked but before the transaction was started holding the lock. In that situation eTraversalNeeded would be set but only seen during the next transaction cycle; however, because we're handling this transaction (because of another flag) it will be commited, "loosing" the information about the layer being removed -- so when the next transaction cycle due to eTraversalNeeded starts, it won't notice that layers have been removed and won't populated the ditchedLayers array. Change-Id: Iedea9e25fee8dd98a0c5bd5ad41a20fcadf75b47
* Fix a race-condtion in SurfaceFlinger that could lead to a crash.Mathias Agopian2011-05-031-3/+9
| | | | | | | | | | | | | | Client::mLayers could be accessed from different threads. On one side from Client::attachLayer() which is currently called from a binder thread; on the other side from Client::detachLayer() which is always called from the main thread. This could lead to a corruption of Client::mLayers. We fix this issue by adding an internal lock to Client. Change-Id: Ib1317d7750ed5030e6f577efe34b69fc10198bd3
* Get rid of the "pid" parameter from createSurfaceMathias Agopian2011-04-201-4/+5
| | | | Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
* Fix a GraphicBuffer leak in SurfaceTextureMathias Agopian2011-04-081-6/+0
| | | | | | | | | | | | | | | | | This leak was intentional, it was there to deal with the fact that some gralloc implementations don't track buffer handles with file-descriptors so buffers needed to stay alive until there were registered, which is not guaranteed by binder transactions. In this new implementation, we use a small BBinder holding a reference to the buffer, which with tuck into the parcel. This forces the reference to stay alive until the parcel is destroyed, which is guaranteed (by construction) to happen after the buffer is registered. this allows the public facing API to not expose the previous hack. Change-Id: I1dd6cd83679a2b7457ad628169e2851acc027143
* Fix some const-ness and commentsMathias Agopian2011-03-111-2/+2
| | | | | | | | | | | mDrawingState doesn't need to be accessed by the mStateLock, because by definition it's only accessed from the main thread. Similarily, the list of layers in the drawing state cannot change (ie: is const). Change-Id: I2e5da7f4d8caee7af7802b432cd45cc81c7c08b0
* ANativeWindow: add queues-to-window-composer check.Jamie Gennis2011-03-081-0/+1
| | | | | | | | | This change adds a new 'method' to the ANativeWindow interface to check whether buffers queued to the window will be sent directly to the system window compositor. Change-Id: I4d4b199e328c110b68b250029aea650f03c8724d Bug: 3495535
* clean-up unneeded codeMathias Agopian2011-01-201-1/+0
| | | | | | | | | | 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. Change-Id: I210413d4c8c0998dae05c8620ebfc895d3e6233d
* Merge "partially fix [3306150] HTML5 video with H/W acceleration blackout" ↵Mathias Agopian2011-01-141-0/+1
|\ | | | | | | into honeycomb
| * partially fix [3306150] HTML5 video with H/W acceleration blackoutMathias Agopian2011-01-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to guarantee that a layer in SurfaceFlinger would never be destroyed before all references (to its ISurface) on the client side would be released. At some point, this guarantee got relaxed to allow to free gralloc resources sooner. This last change was incorrect, because: - in implementations with reference-counting the gralloc resources wouldn't be released anyways, until all the mapping were gone - in implementations without ref counting, the client side would most likely crash or do something bad - it also caused the SharedBufferStack slot to be reallocated to another surface, which could be problematic if the client continued to use the surface after the window manager destroyed it. So, we essentially reinstate the guarantee that layers won't be destroyed until after all references to their ISurface are released. NOTE: This doesn't entirely fix 3306150 because there is another problem there where the Browser continues to use a surface after it has been destroyed. Change-Id: I305c830dd722b30a6d53cbf3a9c714fd3cf7eb06
* | Merge "fix [3312683] Camera mirroring problem after switching from back to ↵Mathias Agopian2011-01-141-0/+1
|\ \ | | | | | | | | | front camera" into honeycomb
| * | fix [3312683] Camera mirroring problem after switching from back to front cameraMathias Agopian2011-01-131-0/+1
| |/ | | | | | | | | | | | | | | | | the crop as well as buffer orientation can change at every frame, when that happens we need to reset the hwc HAL (ie: set the GEOMETRY_CHANGED flag). currently we achieve this by taking the same code path than an actual geometry change which is a bit more heavy than necessary. Change-Id: I751f9ed1eeec0c27db7df2e77d5d17c6bcc17a24
* | Fix remote GraphicBuffer allocation in SurfaceFlinger.Jamie Gennis2011-01-131-2/+17
|/ | | | | | | | | | | This change fixes a horrible hack that I did to allow application processes to create GraphicBuffer objects by making a binder call to SurfaceFlinger. This change introduces a new binder interface specifically for doing this, and does it in such a way that SurfaceFlinger will maintain a reference to the buffers until the app is done with them. Change-Id: Icb240397c6c206d7f69124c1497a829f051cb49b
* Add the ISurfaceComposer::createGraphicBuffer IPC.Jamie Gennis2011-01-061-0/+2
| | | | | | | | This change adds a new binder method to the ISurfaceComposer interface. This IPC is intended to allow SurfaceFlinger clients to allocate gralloc buffers using SurfaceFlinger as a proxy to gralloc. Change-Id: Ide9fc283aec5da6268ba62cfed0c3319a50b640d
* [3258939] Need snapshot to limit which layers are includedMathias Agopian2010-12-101-8/+9
| | | | Change-Id: Id7351a0e3f53dde99b291cffba553d89fd4d7ca9
* More clean-up. Get rid off the "blur" effect in SurfaceFlingerMathias Agopian2010-12-081-6/+0
| | | | | | | | For multiple reason, this effect is not maintainable and was never used due to its abysmal performance. it'll be resurected when it can be implemented efficiently. Change-Id: Id4222c9b86c629275cdec18873ef07be8723b6d2
* remove support for PUSH_BUFFER surfaces and overlaysMathias Agopian2010-12-081-8/+0
| | | | | | | the same functionality is now supported through the h/w composer HAL, and YUV support in the GPU. Change-Id: I8146605449954b8e8fd7f78810b7d873c2d8f5bf
* am 7e9a54d4: am d4e03f37: addresses parts of 3096779 and 3097475Mathias Agopian2010-10-161-3/+3
|\ | | | | | | | | | | | | Merge commit '7e9a54d460030a871a4f05e61e943c6a694e9ef8' * commit '7e9a54d460030a871a4f05e61e943c6a694e9ef8': addresses parts of 3096779 and 3097475
| * addresses parts of 3096779 and 3097475Mathias Agopian2010-10-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 3097475: Animation setting should control the screen on animation 3096779: CRT power-on animation can briefly show the top app instead of lockscreen There is now a parameter that controls wether the ON and/or OFF animation are performed. we also always clear the screen to black on power off, to make sure it won't briefly appear on power on. HOWEVER, 3096779 is not 100% fixed in the case where we're doing the animation because there is a race, where SF doesn't wait (b/c it doesn't know) for the framework to have redrawn the lockscreen. Change-Id: Ie0f02c9225fcdf24b1e8907e268eb7da2c5b0a03
* | am 5bfa3a34: am 011b5bcc: Merge "implement part of [3094280] New animation ↵Mathias Agopian2010-10-151-0/+7
|\ \ | |/ | | | | | | | | | | | | | | for screen on and screen off add support for screen on animation" into gingerbread Merge commit '5bfa3a34eaef759c3ec4def76f646eb1c0bf997f' * commit '5bfa3a34eaef759c3ec4def76f646eb1c0bf997f': implement part of [3094280] New animation for screen on and screen off
| * implement part of [3094280] New animation for screen on and screen offMathias Agopian2010-10-131-0/+7
| | | | | | | | | | | | add support for screen on animation Change-Id: If50cf52ae04b95b42da7d74cf7fa96d5cb54d238
* | am 9a12a3c8: am ba799098: Merge changes I76513387,I335fb671 into gingerbreadJoe Onorato2010-10-131-0/+4
|\ \ | |/ | | | | | | | | | | | | Merge commit '9a12a3c8d4bb20042cf69e07d268e3a04ac71f96' * commit '9a12a3c8d4bb20042cf69e07d268e3a04ac71f96': Remove dead code, and make the animation a setting. turn off the electron beam
| * turn off the electron beamMathias Agopian2010-10-121-0/+4
| | | | | | | | Change-Id: I335fb6719f1d5a3f1c6f37a046fd1c2c4ed2bbc6
| * refactored screenshot codeMathias Agopian2010-10-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | the core screenshot function now can capture the screen at any lower resolution performing bilinear filtering. we also now have some client code to interface with the screenshot service. it's now possible to request a screenshot at a lower resolution. Change-Id: I33689bba98507ab928d0898b21596d0d2fe4b953
* | refactored screenshot codeMathias Agopian2010-09-291-1/+8
| | | | | | | | | | | | | | | | | | | | | | the core screenshot function now can capture the screen at any lower resolution performing bilinear filtering. we also now have some client code to interface with the screenshot service. it's now possible to request a screenshot at a lower resolution. Change-Id: I5a3b0e431421800e3aad601d9af8f94adffbc71f
* | am 495ad4f2: am beabe75a: Merge changes I1f7c4535,I741c68a2 into gingerbreadMathias Agopian2010-09-241-0/+6
|\ \ | |/ | | | | | | | | | | | | Merge commit '495ad4f22096aa172d025c16c25497e7dad8f2bd' * commit '495ad4f22096aa172d025c16c25497e7dad8f2bd': simple test app for screen capture API add support for [1974164] Be able to take a screen shot on the device
| * add support for [1974164] Be able to take a screen shot on the deviceMathias Agopian2010-09-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | screenshots are taken using ISurfaceComposer::captureScreen() which returns the size of the screenshot and an IMemoryHeap containing the data. screenshots have limitations: - they will always fail if a secure window is up on screen - require GL_OES_framebuffer_object extension - in some situation, video planes won't been captured Change-Id: I741c68a2d2984fb139039301c3349e6780e2cd58
| * revert hwcomposer HAL changes. DO NOT MERGE.Mathias Agopian2010-08-171-2/+0
| | | | | | | | | | | | | | | | This reverts commit: 94364b91a2894bf037b8beb027132fbb812e1434 f8e705dea48f77f1c2532fdbadd4997dd1851af0 b59beb5ca68d0228f60dda60d85e2d0226b33215 e0d5f5bcf5a8b26f4ad75f549cbf380b2c9faf20
* | add a way to toggle the h/w composer at runtimeMathias Agopian2010-09-221-0/+1
|/ | | | | | | | | | | | to DISABLE the h/w composer: adb shell service call SurfaceFlinger 1008 i32 1 to ENABLE the h/w composer: adb shell service call SurfaceFlinger 1008 i32 0 the state is dumped in "dumpsys SurfaceFlinger" Change-Id: I23e2242d42c6e3fd5261a83332dd900b189e38ce
* call into hwcomposer HAL when presentMathias Agopian2010-08-111-0/+2
| | | | Change-Id: I70f31c69a9436a43860e78977442863ecba6d27b
* get rid of our LayerVector implementationMathias Agopian2010-08-111-14/+12
| | | | | | we now use SortedVector<> with a special compare implementation. Change-Id: I910459cf3b3c8993b55ad0786a8c348369262de5
* keep a list of visible sorted surfacesMathias Agopian2010-08-111-3/+2
| | | | Change-Id: Ib815eeff894f8a3b1e79fbbf8186d5d91bb60285
* added BinderService<> template to help creating native binder servicesMathias Agopian2010-07-141-3/+6
| | | | Change-Id: Id980899d2647b56479f8a27c89eaa949f9209dfe
* move native services under services/Mathias Agopian2010-07-141-0/+420
moved surfaceflinger, audioflinger, cameraservice all native services should now reside in this location. Change-Id: Iee42b83dd2a94c3bf5107ab0895fe2dfcd5337a8