summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
Commit message (Collapse)AuthorAgeFilesLines
* Merge "SurfaceFlinger: Fix a typo." into honeycomb-mr1Jamie Gennis2011-03-181-1/+1
|\
| * SurfaceFlinger: Fix a typo.Jamie Gennis2011-03-181-1/+1
| | | | | | | | | | | | | | | | This change makes Layer skip its cleanup of its old shared memory region when the UserClient object that owned the memory has been freed. Bug: 3429357 Change-Id: I9e4d8eb190f6914dc043674b9bb8dd28e959901b
* | Fix missing AOSP copyright headers for more filesJames Dong2011-03-172-0/+32
|/ | | | | | | | | | o Update the copyright date on InputDispatcher_test.cpp and InputReader_test.cpp because these two files were moved from other places to the current location, and were actually created in 2010. bug - 4119349 Change-Id: Ic93b81ddafb58e9e72a2e9e02ca3d9f173d6dca7
* fix [4093196] Device lock up - log spam with SharedBufferStack: ↵Mathias Agopian2011-03-171-5/+7
| | | | | | | | | | | | | | | waitForCondition(LockCondition) timed out a memory corruption happned when the buffer pool was resized (like when playing a video or using camera) and there was no current active buffer. In this case, the faulty code would index into an array at position -1 which corrupted 24 bytes of data. also improved region validation code (ifdef'ed out by default) Bug: 4093196 Change-Id: I915c581d131148959d720e00e3892e9186ab733d
* SurfaceFlinger: Respect the PROTECTED gralloc bit.Jamie Gennis2011-03-104-17/+24
| | | | | | | | | This change makes SurfaceFlinger treat layers for which the active buffer has the GRALLOC_USAGE_PROTECTED bit set as if they have the 'secure' flag set. Change-Id: Ic60b6513a63e4bb92ec6ce9fd12fd39b4ba5f674 Bug: 4081304
* ANativeWindow: add queues-to-window-composer check.Jamie Gennis2011-03-082-0/+35
| | | | | | | | | 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
* remove some logsMathias Agopian2011-03-021-3/+3
| | | | Change-Id: Ia476184048ee419e19330a56dc8e6553189f6a24
* am 0dc5fdb9: am e630e5f4: am 919853ce: Merge "Prevent SurfaceFlinger from ↵Jamie Gennis2011-02-271-1/+1
|\ | | | | | | | | | | | | using layer token 31." into gingerbread * commit '0dc5fdb9b2fd3b3e2ede5e9607bc21423f357a01': Prevent SurfaceFlinger from using layer token 31.
| * am e630e5f4: am 919853ce: Merge "Prevent SurfaceFlinger from using layer ↵Jamie Gennis2011-02-271-1/+1
| |\ | | | | | | | | | | | | | | | | | | token 31." into gingerbread * commit 'e630e5f49ba15005172dceeda7299569b2d2351f': Prevent SurfaceFlinger from using layer token 31.
| | * am 919853ce: Merge "Prevent SurfaceFlinger from using layer token 31." into ↵Jamie Gennis2011-02-271-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | gingerbread * commit '919853ce244f853966817d4adb2f3b7b6e4bbe74': Prevent SurfaceFlinger from using layer token 31.
| | | * Prevent SurfaceFlinger from using layer token 31.Jamie Gennis2011-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | Bug: 2964479 Change-Id: I81e948924bff35b8b300d409f2c09f3779bcdeec
| | * | am 239fd805: Merge "fix [3361121] hang in glClear() - device unresponsive, ↵Mathias Agopian2011-01-256-43/+0
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | OTA fails (DO NOT MERGE)" into gingerbread * commit '239fd805ef7c0e4116b0a89e20caaf287e91f017': fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE)
| | | * fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE)Mathias Agopian2011-01-256-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | am 1955a5c9: Merge "partially fix [3306150] HTML5 video with H/W ↵Mathias Agopian2011-01-254-1/+59
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | acceleration blackout (DO NOT MERGE)" into gingerbread * commit '1955a5c9da421dc89bb1a1dd3d3193159192cde9': partially fix [3306150] HTML5 video with H/W acceleration blackout (DO NOT MERGE)
| | | * partially fix [3306150] HTML5 video with H/W acceleration blackout (DO NOT ↵Mathias Agopian2011-01-254-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MERGE) 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. also improve SurfaceFlinger 'dumpsys' log list the purgatory, which shows windows that have been closed, but for which the client still has references.
| | * | am d0441f92: Merge "fix a small bug that caused screenshot to show garbage ↵Mathias Agopian2011-01-251-1/+2
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | in some cases (DO NOT MERGE)" into gingerbread * commit 'd0441f921b2b1879fb44041f521d9bfaa5a547d0': fix a small bug that caused screenshot to show garbage in some cases (DO NOT MERGE)
| | | * fix a small bug that caused screenshot to show garbage in some cases (DO NOT ↵Mathias Agopian2011-01-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MERGE) we were not clearing the screen entirely, which caused garbage when the screen wasn't entirely covered by windows. Change-Id: Ia7aa13c36a8a314e0e8427d419b16b9aa2165ddf
| | * | am 043a3cdd: Merge "workaround [3201922] display not on: log full of gralloc ↵Mathias Agopian2011-01-251-0/+4
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | errors (DO NOT MERGE)" into gingerbread * commit '043a3cddf67e2baf38711bcb125084599f8f9802': workaround [3201922] display not on: log full of gralloc errors (DO NOT MERGE)
| | | * workaround [3201922] display not on: log full of gralloc errors (DO NOT MERGE)Mathias Agopian2011-01-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we make sure to call compositionComplete after everytime we do composition with the GPU (even for the screenshot case), which is where the buffer locks are released. Change-Id: I450430d1e4d1ee9ce1023970642378c42cdcfa4c
| | * | am d3fcd0a1: Merge "minor clean-up. SurfaceFlinger doesn\'t need ↵Mathias Agopian2011-01-251-1/+0
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | libpixelflinger.so. (DO NOT MERGE)" into gingerbread * commit 'd3fcd0a1c923498921107bb44fbc8b24582a170a': minor clean-up. SurfaceFlinger doesn't need libpixelflinger.so. (DO NOT MERGE)
| | | * minor clean-up. SurfaceFlinger doesn't need libpixelflinger.so. (DO NOT MERGE)Mathias Agopian2011-01-251-1/+0
| | | | | | | | | | | | | | | | Change-Id: I1ddbbbec4fa5b2521ef3787bc28efe1bc90d0060
| | * | am c724f2fb: disable the bypass mode. DO NOT MERGE.Mathias Agopian2010-12-201-1/+0
| | |\ \ | | | |/ | | | | | | | | | | | | * commit 'c724f2fba330da275f46586aeb5f0ae7bd2fae99': disable the bypass mode. DO NOT MERGE.
| | | * disable the bypass mode. DO NOT MERGE.Mathias Agopian2010-12-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SF bypass mode triggers a bug in the display controller that case cause the device to freeze. Change-Id: If29b4d5132f463d13831b082b904c235f15a19fb
| | * | am 74da537f: Merge "[317580] fix issue where the screen wouldn\'t be rotated ↵Mathias Agopian2010-12-083-1/+19
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | properly in bypass mode" into gingerbread * commit '74da537f80ba36c1279c04fcb85d89fc38c246a6': [317580] fix issue where the screen wouldn't be rotated properly in bypass mode
| | | * [317580] fix issue where the screen wouldn't be rotated properly in bypass modeMathias Agopian2010-12-073-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In some situations, the screen transformation would not be applied while in bypass mode. Change-Id: I3d6dd52e4c12b11aae97b54bf8e2322536eee37f
| | * | am a2977c38: Merge changes Ie03796ae,Ide3e980a into gingerbreadMathias Agopian2010-12-078-11/+172
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | * commit 'a2977c383d363e1e88a5b36230b1fa4c312807d2': [3171580] SurfaceFlinger Bypass mode. (DO NOT MERGE) [3171580] Add transform field to native buffers. (DO NOT MERGE)
| | | * [3171580] SurfaceFlinger Bypass mode. (DO NOT MERGE)Mathias Agopian2010-12-038-11/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a poor's man precursor to the h/w composer HAL. Basically we detect when a window is full screen and in that case we bypass surfaceflinger's composition step, which yields to much improved performance. Change-Id: Ie03796ae81a1c951949b771c9323044b980cb347
* | | | Merge "Correctly handle translucency of device-specific pixel formats"Eric Hassold2011-02-232-1/+50
|\ \ \ \
| * | | | Correctly handle translucency of device-specific pixel formatsEric Hassold2011-02-152-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check requested format for device-specific formats, and assume (as documented in libhardware/include/hardware/hardware.h) this is opaque layer so no blending is necessary. Bug: 3215931 Change-Id: Ib4dff8060ac522d201ff1e74807ac340c17d3fa7
* | | | | fix a surface leak in SurfaceFlingerMathias Agopian2011-02-164-14/+13
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SF kept a strong reference to ISurface until the window manager removed the surface from the screen. This fell appart when running standalone tests, that is when the window manager wasn't involved. When the window manager is around, it would clean-up surfaces even when an application died. with this change, SF is able to do its own cleanup without relying on the window manager. the change is very simple, we simply don't keep a reference to ISurface and make sure no more than one of them can be created. Change-Id: I61f2d7473bf8d4aa651549a846c34cdbb0d0c85a
* | | | am 50b029d5: am 7ba35f5a: Merge "[3418265] apply layer transformations to ↵Mathias Agopian2011-02-023-35/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | the DimLayer." into honeycomb * commit '50b029d578fa06cd0733dcc7c69cb94f5f824908': [3418265] apply layer transformations to the DimLayer.
| * | | [3418265] apply layer transformations to the DimLayer.Mathias Agopian2011-02-023-35/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | with this change DimLayers will behave just like any other layer, in particular they'll respect the layer transformations. Change-Id: Icb4a1275e8bca9e3deb5f57c9f9219aaa69f9877
* | | | am 09443aeb: am 62884505: Merge "Reset ANativeWindow crop on buffer geometry ↵Jamie Gennis2011-01-301-5/+3
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | changes." into honeycomb * commit '09443aeb6470d66f5bc1938b70d74b3e2f9bbbb9': Reset ANativeWindow crop on buffer geometry changes.
| * | | Merge "Reset ANativeWindow crop on buffer geometry changes." into honeycombJamie Gennis2011-01-301-5/+3
| |\ \ \
| | * | | Reset ANativeWindow crop on buffer geometry changes.Jamie Gennis2011-01-281-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the ANativeWindow API and the two implementations to reset the window's crop rectangle to be uncropped when the window's buffer geometry is changed. Bug: 3359604 Change-Id: I64283dc8382ae687787ec0bebe6a5d5b4a0dcd6b
* | | | | am 8d778b37: am 231da079: Merge "fix [3389263] OMX.Nvidia.h264.decode fails ↵Mathias Agopian2011-01-281-2/+1
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | to shutdown" into honeycomb * commit '8d778b375ccb4945cdcd7cc93272a6d36466ad00': fix [3389263] OMX.Nvidia.h264.decode fails to shutdown
| * | | | fix [3389263] OMX.Nvidia.h264.decode fails to shutdownMathias Agopian2011-01-281-2/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were still destroying an ANativeWindow's buffer pretty soon after it was removed from the window manager. This time we really wait for the ISurace to go away. Change-Id: I329273fedaeef76ee92836f6180c2c3808389330
* | | | Protected surface APIGlenn Kasten2011-01-284-3/+29
|/ / / | | | | | | | | | | | | | | | To be used by DRM framework, implemented by display HAL Change-Id: I054a07a94f4d5dbe792f3a597e2e49a100d90eb2
* | | fix [3385504] Surface flinger hang when adding dim surfaceMathias Agopian2011-01-254-3/+16
| | | | | | | | | | | | Change-Id: I8e0cda414bcad5854d2ca5dde8370bfd8b2e5ea4
* | | tone down the log spew regarding taking screenshots.Mathias Agopian2011-01-241-18/+1
| | | | | | | | | | | | Change-Id: I673806bda23eba6aab25f7505b7e0170afc9920b
* | | Merge "fix [3369743] SurfaceFlinger reads hardware composer hints before ↵Mathias Agopian2011-01-201-20/+26
|\ \ \ | | | | | | | | | | | | calling hwc.prepare()" into honeycomb
| * | | fix [3369743] SurfaceFlinger reads hardware composer hints before calling ↵Mathias Agopian2011-01-191-20/+26
| | | | | | | | | | | | | | | | | | | | | | | | hwc.prepare() Change-Id: If3277c7b9d4cb8ef20d1706155fac7b87e64fb20
* | | | clean-up unneeded codeMathias Agopian2011-01-206-42/+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
* | | | improve SurfaceFlinger 'dumpsys' logMathias Agopian2011-01-193-0/+43
|/ / / | | | | | | | | | | | | | | | | | | list the purgatory, which shows windows that have been closed, but for which the client still has references. Change-Id: I5168bb88cb328d5d77d71d0871deb9190f493126
* | | Add logs when taking a screenshot to help tracking issue 3361121Mathias Agopian2011-01-161-2/+23
| | | | | | | | | | | | Change-Id: I61d1e072ebe7061ee1d7255f6121b684e2923d1b
* | | Merge "partially fix [3306150] HTML5 video with H/W acceleration blackout" ↵Mathias Agopian2011-01-142-1/+19
|\ \ \ | | | | | | | | | | | | into honeycomb
| * | | partially fix [3306150] HTML5 video with H/W acceleration blackoutMathias Agopian2011-01-142-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-143-5/+17
|\ \ \ \ | | | | | | | | | | | | | | | front camera" into honeycomb
| * | | | fix [3312683] Camera mirroring problem after switching from back to front cameraMathias Agopian2011-01-133-5/+17
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-132-21/+55
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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