summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/Layer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* use SurfaceTexture new scaling mode in SFMathias Agopian2011-07-191-11/+9
| | | | | | | SF now obeys SurfaceTexture's scaling mode instead of inferring it from the buffer's size Change-Id: I4d50e9851abedd7e64bfcfc8af9eefb9fb668529
* take the state transform into account with h/w composer halMathias Agopian2011-07-121-5/+20
| | | | | | | | | | if the state transform didn't preserve rectangles, we would still try to use h/w composer hal using the bounds of the transformed rect, which isn't correct. now we correctly fall back to composition. Change-Id: Iff78f4339ece415d4987e95a5717b04934d370ab
* SurfaceTexture: change onFrameAvailable behaviorJamie Gennis2011-06-271-11/+8
| | | | | | | | | | | | | | | | | | This change alters the conditions under which the onFrameAvailable callback gets called by the C++ SurfaceTexture class. The new behavior is to call the callback whenever a frame gets queued that will be visible to the buffer consumer. This means that buffers queued in synchronous mode always trigger the callback, as those buffers will remain pending until they are consumed. Buffers queued in asynchronous mode will only trigger the callback if there was not previously an unconsumed buffer pending. The new behavior means that a consumer should perform a draw operation exactly once for every onFrameAvailable call that it recieves. This change also modifies SurfaceFlinger and the SurfaceTexture JNI to support of the new behavior. Change-Id: I8b2c6e00961d3d58b11c6af50b555b6e4c5f5b40
* fix RefBase so it retains binary-compatibility with gingerbreadMathias Agopian2011-06-131-2/+4
| | | | | Bug: 4595257 Change-Id: I0d5e10f497e3f39868bff58f6ded510c38b44b12
* unify SurfaceTexture and SurfaceMathias Agopian2011-06-131-698/+168
| | | | | | | 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-191-12/+4
|\ | | | | | | thread."
| * Fix a race that could cause GL commands to be executed from the wrong thread.Mathias Agopian2011-05-191-12/+4
| | | | | | | | 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
* 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
| | * 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)
| | * fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE)Mathias Agopian2011-01-251-16/+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.
| | * [317580] fix issue where the screen wouldn't be rotated properly in bypass modeMathias Agopian2010-12-071-0/+12
| | | | | | | | | | | | | | | | | | | | | In some situations, the screen transformation would not be applied while in bypass mode. Change-Id: I3d6dd52e4c12b11aae97b54bf8e2322536eee37f
| | * [3171580] SurfaceFlinger Bypass mode. (DO NOT MERGE)Mathias Agopian2010-12-031-8/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | 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.
| * | 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 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 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-101-3/+7
|/ / | | | | | | | | | | | | | | | | 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
* | Merge "Correctly handle translucency of device-specific pixel formats"Eric Hassold2011-02-231-0/+48
|\ \
| * | Correctly handle translucency of device-specific pixel formatsEric Hassold2011-02-151-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-161-5/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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-281-0/+8
|/ / | | | | | | | | | | To be used by DRM framework, implemented by display HAL Change-Id: I054a07a94f4d5dbe792f3a597e2e49a100d90eb2
* | clean-up unneeded codeMathias Agopian2011-01-201-16/+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
* | Fix a problem where hwc and GL composition could show a different bufferMathias Agopian2010-12-141-18/+14
| | | | | | | | | | | | | | | | | | | | if a surface's buffers are reallocated, the current active buffer will end-up pointing on one of these until a new buffer is retired. we're now keeping a reference to the actual buffer until we retire a new one. Change-Id: Ib1703947e7a0340694d846e0962576318863b935
* | fix [3223749] media server crashes when switching mode from video capture to ↵Mathias Agopian2010-12-141-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | still image capture there was an issue were in some situation SF would call prepare() on hwc with a NULL handle and never call prepare again. in this situation, we onw set the SKIP flag to make sure that hwc won't process this layer and as soon as we receive our first buffer we trigger a recompute of the visible regions which will end-up calling prepare() again. Change-Id: I6b400b2df79712408b9315a9859290c7fcb1609e
* | fix [3176642] Camera preview turns completely black for multiple toggles ↵Mathias Agopian2010-12-131-1/+21
| | | | | | | | | | | | | | | | | | | | between camera and camcorder app There was a leak of Surface tokens when a surface was detached from a UserClient. We now always detach a surface from its client before attaching to the new one, this guarantees that its token is freed. Change-Id: Icfad0b16286ed58155bdfafdf36ab161440aa485
* | [3211070] camera preview image is rendered offset from the UI overlay frameMathias Agopian2010-12-081-5/+12
| | | | | | | | | | | | somehow this change got lost. Change-Id: I36f6c7ef3f782918042b77e9dc91a4c811d84a40
* | fix [3260137] Sometimes front-facing camera mirroring is wrongMathias Agopian2010-12-081-1/+2
| | | | | | | | | | | | make sure to take the buffer's orientation into account. Change-Id: I9fef89e66368ad2dec1cb8c7b77ac2b3b4858efb
* | resolved conflicts for merge of a0f011ff to masterMathias Agopian2010-12-071-12/+10
|\ \ | |/ | | | | Change-Id: I4c17021fc269ce66c98cc345353600eda332f980
| * [3171580] Fix two typos related to fixed-size buffersMathias Agopian2010-12-031-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mFixedSize was never set, this bug was introduced during some "cleanup", in practice this could cause some issues when a fixed-size buffer was used and the window was resized. Layer::drawForSreenShot() had a typo that had no effect. mFixedSize was used to determine if filtering was needed, which was a bit too conservative and created a dependency between filtering and "fixed size" states which should exist. Now we enable filtering based on the size of the buffer vs. the size of the layer. Change-Id: I32044e91b0c944c1b137efdceb3f01dfaa78119d
* | am 48f42f8c: am 4153bf3a: Merge "[3171580] don\'t automatically log ↵Mathias Agopian2010-12-071-0/+1
|\ \ | |/ | | | | | | | | | | GraphicBuffer allocation failures" into gingerbread * commit '48f42f8c3fbd33b2f46c6290ff5963dd58938cf9': [3171580] don't automatically log GraphicBuffer allocation failures
| * [3171580] don't automatically log GraphicBuffer allocation failuresMathias Agopian2010-12-031-0/+1
| | | | | | | | | | | | | | some of these failures are not fatal and even expected in some cases so they should not emit a dump in the log in those cases. Change-Id: Idcfa252e3bfa9d74e27fe4ad8f8623aa01aa9c5e
| * refactored screenshot codeMathias Agopian2010-10-041-0/+11
| | | | | | | | | | | | | | | | | | | | | | 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
* | Remove const_cast to layer handleLouis Huemiller2010-12-011-1/+1
| | | | | | | | Change-Id: Ica1e089cb56b5f9f46ab87abf735ffe7237fc926
* | Implement reducing the buffer count of a Surface.Jamie Gennis2010-11-111-3/+48
| | | | | | | | | | Change-Id: I7f979c60c06d654aa8265002836277434bc1a64f Bug: 3095167
* | Always create OpenGL accelerated windows in RGBA 8888.Romain Guy2010-10-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #3081600 The OpenGL renderer in libhwui uses a single EGL context per process and thus create it with an RGBA 8888 EGL configuration. To ensure that all windows are compatible with this configuration, this change modifies the window manager and SurfaceFlinger. The window manager now checks the window's flags and if the window is hardware accelerated, it forces the window's pixel format to be translucent when creating the surface. The window itself is still marked as opaque if we know that the window will be opaque on screen. This keeps existing optimizations in place. Similarly in SurfaceFlinger, a translucent Surface can now be created with the Surface.OPAQUE flag, indicating SurfaceFlinger that the surface does not require blending, despite its RGBA 8888 configuration. Change-Id: Ic747b6b12564ba064412d842117880fcc199eb7c
* | refactored screenshot codeMathias Agopian2010-09-291-0/+11
| | | | | | | | | | | | | | | | | | | | | | 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
* | fix [3018216] UI shrinks / stretches while using apps with IMEMathias Agopian2010-09-211-1/+2
| | | | | | | | Change-Id: Ie4c5d8a434b4489355ed8c52af96eb931b4d7167
* | Fix a SurfaceFlinger bug.Jamie Gennis2010-09-171-0/+1
| | | | | | | | | | | | | | The bug caused SurfaceFlinger to constantly trigger reallocation of buffers that requested a fixed size. Change-Id: Ic993a60e6474e36a344c8b48d541a0d08b8c4faf
* | am 6d4346ce: am 4cffbb47: Merge "fix [2946787] Screen flicker on low ↵Mathias Agopian2010-08-251-11/+21
|\ \ | |/ | | | | | | | | | | | | | | resolution setting in camcorder." into gingerbread Merge commit '6d4346ce35a521d67f45d7c9658c450c0fc461d2' * commit '6d4346ce35a521d67f45d7c9658c450c0fc461d2': fix [2946787] Screen flicker on low resolution setting in camcorder.
| * fix [2946787] Screen flicker on low resolution setting in camcorder.Mathias Agopian2010-08-251-11/+21
| | | | | | | | Change-Id: I7e86f2b6d85dcae8dd212890b978fa6ac7de6893
* | am 46820412: am 8eb16af2: Merge "don\'t try to lock a buffer that wasn\'t ↵Mathias Agopian2010-08-251-6/+10
|\ \ | |/ | | | | | | | | | | | | | | allocated with SW usage bits" into gingerbread Merge commit '468204124e95bbf74ae8cc000318ade29e311be6' * commit '468204124e95bbf74ae8cc000318ade29e311be6': don't try to lock a buffer that wasn't allocated with SW usage bits
| * don't try to lock a buffer that wasn't allocated with SW usage bitsMathias Agopian2010-08-251-6/+10
| | | | | | | | Change-Id: Iabbcec1bfa30dc47d45ece699dd178653f1b675b
* | am bc4389ed: am 8395b462: Merge "fix [2931513] Add support for setting the ↵Mathias Agopian2010-08-241-1/+8
|\ \ | |/ | | | | | | | | | | | | | | orientation of an ANativeWindow" into gingerbread Merge commit 'bc4389edfbb5777aec1a9af7863b2ca3ade2fa64' * commit 'bc4389edfbb5777aec1a9af7863b2ca3ade2fa64': fix [2931513] Add support for setting the orientation of an ANativeWindow