summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
Commit message (Collapse)AuthorAgeFilesLines
* fix RefBase so it retains binary-compatibility with gingerbreadMathias Agopian2011-06-132-4/+6
| | | | | Bug: 4595257 Change-Id: I0d5e10f497e3f39868bff58f6ded510c38b44b12
* unify SurfaceTexture and SurfaceMathias Agopian2011-06-1312-1246/+499
| | | | | | | Add the concept of synchronous dequeueBuffer in SurfaceTexture Implement {Surface|SurfaceTextureClient}::setSwapInterval() Add SurfaceTexture logging fix onFrameAvailable
* Merge "Fix a race that could cause GL commands to be executed from the wrong ↵Mathias Agopian2011-05-196-108/+79
|\ | | | | | | thread."
| * Fix a race that could cause GL commands to be executed from the wrong thread.Mathias Agopian2011-05-196-108/+79
| | | | | | | | Change-Id: Ia3d407f7bf2f5553f46cfdade70b7b0badb35beb
* | SurfaceFlinger: unfreeze windows for fixed size buffers.Jamie Gennis2011-05-161-2/+3
|/ | | | | | | | | This change makes SurfaceFlinger unfreeze a window if it ever gets a buffer that is fixed-size. Normally the window would not be frozen if its in fixed-size mode, but if the window was frozen before entering fixed-size mode then it should be unfrozen. Change-Id: I6bc822d4b02ae51fa8914c1f60f5d24b2002b38d
* Fix a race in SurfaceFlinger that could cause layers to be leaked forever.Mathias Agopian2011-05-032-1/+17
| | | | | | | | | | | | | | | | 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
* frameworks/base: android_native_buffer_t -> ANativeWindowBufferIliyan Malchev2011-05-032-2/+2
| | | | | Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417 Signed-off-by: Iliyan Malchev <malchev@google.com>
* Merge "Fix a race-condtion in SurfaceFlinger that could lead to a crash."Mathias Agopian2011-05-032-11/+21
|\
| * Fix a race-condtion in SurfaceFlinger that could lead to a crash.Mathias Agopian2011-05-032-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 08acaec6: am a47c0d29: am 58e4a5e2: Merge "Fixed to draw texture when ↵Conley Owens2011-05-021-1/+1
|\ \ | |/ |/| | | | | | | | | loadTexture() is called at first time" * commit '08acaec6df66bd6a12b1e63016ed998abff4afdc': Fixed to draw texture when loadTexture() is called at first time
| * am a47c0d29: am 58e4a5e2: Merge "Fixed to draw texture when loadTexture() is ↵Conley Owens2011-04-291-1/+1
| |\ | | | | | | | | | | | | | | | | | | called at first time" * commit 'a47c0d29bec7c242fb8d5ffe206c4c6ff85a178a': Fixed to draw texture when loadTexture() is called at first time
| | * Merge "Fixed to draw texture when loadTexture() is called at first time"Conley Owens2011-04-291-1/+1
| | |\
| | | * Fixed to draw texture when loadTexture() is called at first timeIchitaro Kohara2011-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SW renderer of Stagefright reaches loadTexture() to draw image. The first time loadTexture() is called, it just initializes OGL texture, then returns. Thus, the first time call doesn't draw. This patch fixes to move on to draw stage after the initialization. Change-Id: I3ec1ad68fb8d376a4ad7aefded1c18a002d175c4
| | * | Merge "Fixed to call computeVisibleRegions() when transparent value changed"Conley Owens2011-04-291-0/+3
| | |\ \
| | | * | Fixed to call computeVisibleRegions() when transparent value changedIchitaro Kohara2011-02-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When some Surfaces are overlapping and one of them changed to transparent or opaque, the back Surfaces should appear or disappear. This patch calls SurfaceFlinger::computeVisibleRegions() to re-calculate region of each Surface to implement the behavior. Change-Id: Iffb1caf1b4ce28dff252e114fe5b9b07d9c84a6f
* | | | | am ba5aebd1: am ac505b86: am f0556bb9: am 86d1d747: Merge "Add lock before ↵Conley Owens2011-04-271-2/+10
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | calling initEglImage" * commit 'ba5aebd106c61567ad6be905efd18902025735aa': Add lock before calling initEglImage
| * | | | am ac505b86: am f0556bb9: am 86d1d747: Merge "Add lock before calling ↵Conley Owens2011-04-271-2/+10
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | initEglImage" * commit 'ac505b86b45462d9883f9c36fad0ef85e0885ee4': Add lock before calling initEglImage
| | * | | am 86d1d747: Merge "Add lock before calling initEglImage"Conley Owens2011-04-271-2/+10
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * commit '86d1d74762e65b6f64c2d4758aa5fd4af6275696': Add lock before calling initEglImage
| | | * | | Add lock before calling initEglImageKobi Cohen Arazi2011-04-151-2/+10
| | | | |/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without that lock, there is a chance of race condition where while composing a specific index, requestBuf with the same index can be executed and touch the same data that is being used in initEglImage. (e.g. dirty flag in texture)
| | * | | am 33029221: Merge "revert the surface purgatory list and dependent ↵Mathias Agopian2011-03-097-87/+18
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes." into gingerbread * commit '33029221619f14577bd0d0e7c2f815abc8f1b8ea': revert the surface purgatory list and dependent changes.
| | | * | | revert the surface purgatory list and dependent changes.Mathias Agopian2011-03-097-87/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6d0f6cb Revert "Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) only" 6154412 Revert "partially fix [3306150] HTML5 video with H/W acceleration blackout (DO NOT MERGE)" 37c2a37 fix [3408713] Dialog window invisible sometimes It looks like there is a surface leak, it's unclear where it is. Without those reverts, this would cause a leak of the associated buffers which is far more problematic. this change might hide the surface leak. Bug: 4078032 Change-Id: Iedcda3ffcdd2f69d41047b5c3134c1e867ff90d7
| | * | | | am df6410dc: Merge "Fix [3513017] in lockscreen but showing empty launcher ↵Mathias Agopian2011-03-076-17/+28
| | |\ \ \ \ | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (live wallpaper) only" into gingerbread * commit 'df6410dce3dae0bdb7e13118b3878079a1dcce03': Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) only
| | | * | | Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) onlyMathias Agopian2011-03-076-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 37c2a37 fix [3408713] Dialog window invisible sometimes d35c666 fix [3385504] Surface flinger hang when adding dim surface 1723b04 fix [3389263] OMX.Nvidia.h264.decode fails to shutdown 1b0114f fix a surface leak in SurfaceFlinger Bug: 3513017 Change-Id: Ia13ed8c9cdcb1f484e177cdcaff687e7c88a10c3
* | | | | | Get rid of the "pid" parameter from createSurfaceMathias Agopian2011-04-202-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
* | | | | | Merge "remove support for console in SurfaceFlinger"Mathias Agopian2011-04-192-263/+4
|\ \ \ \ \ \
| * | | | | | remove support for console in SurfaceFlingerMathias Agopian2011-04-182-263/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the only supported screen management api now is /sys/power/wait_for_fb_{sleep|wake} Change-Id: I6c7d8d54843da4980b1b38ee3d46cf19be275240
* | | | | | | fix memory corruption when retriving GL_MAX_VIEWPORT_DIMSMathias Agopian2011-04-182-4/+8
|/ / / / / / | | | | | | | | | | | | | | | | | | Change-Id: I2e0b1eac6dbc6a4ecbbaf31013aa02cf2369fce2
* | | | | | Fix a GraphicBuffer leak in SurfaceTextureMathias Agopian2011-04-082-19/+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
* | | | | | remove more unused references to ISurfaceMathias Agopian2011-04-051-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2201f1ca2bb8f203a081d94a0134f798778dfbef
* | | | | | merge libsurfaceflinger_client into libguiMathias Agopian2011-03-254-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is the first step in unifying surfacetexture and surface. for this reason the header files were not moved, as most of them will eventually go away. NOTE: currently we keep libsurfaceflinger_client.so as an empty library to workaround prebuilt binaries wrongly linking against it. Change-Id: I130f0de2428e8579033dc41394d093f4e1431a00
* | | | | | am bd340c7b: am b368f4d8: am 38caff23: Merge "SurfaceFlinger: Fix a typo." ↵Jamie Gennis2011-03-181-1/+1
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into honeycomb-mr1 * commit 'bd340c7b492fcf7d0a6cccab8825e710c83fe76d': SurfaceFlinger: Fix a typo.
| * | | | | 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
* | | | | | | am 14438b81: am 970bad67: am be368de7: Merge "Fix missing AOSP copyright ↵James Dong2011-03-172-0/+32
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | headers for more files" into honeycomb-mr1 * commit '14438b81a1fe4d7ebdf8977f3d80a1dd1867c5ad': Fix missing AOSP copyright headers for more files
| * | | | | | 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
* | | | | | am e22aa623: am 25594e19: am f40e638e: fix [4093196] Device lock up - log ↵Mathias Agopian2011-03-171-5/+7
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spam with SharedBufferStack: waitForCondition(LockCondition) timed out * commit 'e22aa62362a3007ee59ac62d4b5969e216987995': fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
| * | | | | 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
* | | | | | Fix some const-ness and commentsMathias Agopian2011-03-112-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Fix initialization order warning.Mathias Agopian2011-03-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I794dfaaa3a2f2645a89abc6c45de5f76e485f7d0
* | | | | | Merge "Default to NONE format in Layer"Eric Hassold2011-03-111-1/+2
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | Default to NONE format in LayerEric Hassold2011-03-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mFormat is not initialized with any value in Layer constructor, causing a call to requestFormat() with no explicit format specified to fallback to some uninitialized value. Such invalid path actually detected by valgrind. Change-Id: Ib7faabcd61eaa26fb0ae7a9a486d9e258ba31b63
* | | | | | 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.