summaryrefslogtreecommitdiffstats
path: root/services
Commit message (Collapse)AuthorAgeFilesLines
* allow dumpsys SurfaceFlinger in user builds from the shell userMathias Agopian2013-04-181-4/+7
| | | | | Bug: 8659013 Change-Id: I1de43bb5808cb8c1103cfc73dca59ff70fc13f91
* Fix activation issue with auto disabled sensors.Jaikumar Ganesh2013-04-175-0/+31
| | | | | | | | | | Auto disabled sensors get auto disabled after trigger. An activation after this wasn't working because the state was not being reset. b/8609561 Change-Id: If72c9f27345e91671d7ad0a7a066f6dc3d255b78
* Merge "make sure to update the "current state" when we "fake" the ↵Mathias Agopian2013-04-131-0/+10
|\ | | | | | | transaction" into jb-mr2-dev
| * make sure to update the "current state" when we "fake" the transactionMathias Agopian2013-04-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | this mimics the code we used for the size. basically we need to also update the "current state" because it gets copied to the "drawing state" when a transaction occurs, and it would "undo" our change. Bug: 8511430 Bug: 8581533 Change-Id: I08c02abbf21b7f168f7124cd14ee717d7d3d502c
* | Merge "Sensor changes." into jb-mr2-devJaikumar Ganesh2013-04-135-38/+121
|\ \
| * | Sensor changes.Jaikumar Ganesh2013-04-125-38/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Some sensors can wake up the AP. Add wakelocks. 2. Handle backward compatibility for rotation vector heading accuracy. 3. Cleanup auto disabled sensors. 4. Fix race condition between enable and dispatch. Change-Id: I39dddf12e208d83cd288201986ee994312555820
* | | Merge "DO NOT MERGE Make sure surfaces always have latest orientation info" ↵Chet Haase2013-04-121-5/+10
|\ \ \ | |_|/ |/| | | | | into jb-mr2-dev
| * | DO NOT MERGE Make sure surfaces always have latest orientation infoChet Haase2013-04-111-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the screen is turned off, the current stack is set to -1. This causes logic in iSurfaceFlinger's handleTransactionLocked() function to fail to match the current stack, and the latest orientation is not set into the layer. This causes BufferQueue, later, to potentially set an obsolete transformHint on a created surface (such as in the case with ImageWallpaper's Egl surface, in the bug below). The fix is to note this situation and use a default value for the DisplayDevice, which should have the current orientation information. Issue #8508397 ImageWallpaper sometimes rendered in wrong orientation causing a ~30-40% drop in graphics performance Change-Id: Ibae15d73b289a8343c67f4f6bb77fdf11dd95ee7
* | | Improve screenshot performance on some devices (DO NOT MERGE)Mathias Agopian2013-04-112-120/+131
| |/ |/| | | | | | | | | | | | | | | | | | | | | this affects devices that need a glReadPixels(). We use a FBO instead of a GlConsumer as an intermediate render target, this saves 2 calls to eglMakeCurrent(). On Galaxy Nexus this allows us to go from ~135ms to ~35ms for recent's screenshots. Bug: 8582615 Change-Id: I6b25291ecc235f1927579bbb2db3c731e985c6e8
* | Merge "fix another bug where screenshots could end-up all black" into jb-mr2-devMathias Agopian2013-04-113-4/+37
|\ \
| * | fix another bug where screenshots could end-up all blackMathias Agopian2013-04-103-4/+37
| |/ | | | | | | | | | | | | | | | | | | | | | | | | SF transactions were always handled on VSYNC which allowed the screenshot to sneak-in between closing the transaction and vsync (before it's latched), resulting in a screenshot with the previous state. we now always force transactions to happen immediately before screenhots. Bug: 7552304 Change-Id: I0afc86b7e8366173daff5b9988bbb4d2a0f43860
* | Add liblogYing Wang2013-04-092-0/+3
|/ | | | | Bug: 8580410 Change-Id: I2ca4fa00dde0b574df3619134836bcb9315bd506
* Merge "Tell HWComposer the dimensions of virtual displays" into jb-mr2-devJesse Hall2013-04-063-14/+34
|\
| * Tell HWComposer the dimensions of virtual displaysJesse Hall2013-04-053-14/+34
| | | | | | | | | | | | | | | | | | | | HWComposer queries the HWC for dimensions of physical displays, but can't do that for virtual displays. The dimensions are used to set the display frame of the framebuffer target layer passed to HWC, and implicitly the dimensions of the virtual display. Bug: 8316155 Change-Id: I9cbd2530d2fa878f86128a1472def520b5d694a5
* | Merge "Actually set the virtual display output buffer." into jb-mr2-devJesse Hall2013-04-061-1/+5
|\ \ | |/ |/|
| * Actually set the virtual display output buffer.Jesse Hall2013-04-041-1/+5
| | | | | | | | | | Bug: 8316155 Change-Id: Ida1ac47e5a932fdaad3ec862e121cfe55d255699
* | Merge "Clean up HWC state when releasing a DisplayDevice" into jb-mr2-devJesse Hall2013-04-045-17/+38
|\ \ | |/ |/|
| * Clean up HWC state when releasing a DisplayDeviceJesse Hall2013-03-275-17/+38
| | | | | | | | | | | | | | | | | | | | DisplayDevices can be released when DisplayManager removes them from the display list, or (for virtual displays) when the surface is set to NULL. We were only cleaning up HWC resources associated with the display in the first case. Bug: 8384764 Change-Id: Id3d226dd7178fbe6d0a2ac4e2660b864ee073de3
* | latch transparent region hint only when we get a new frameMathias Agopian2013-04-023-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | since the transparent region hint really depends on the content of the window containing the SurfaceView (it's calculated by the view hierarchy based on overlapping views), it makes sense to latch it only when the content of the window (the app) changes. This should help fixing drawing artifacts when changing the layout of a window containing a SurfaceView. Bug: 8511430 Change-Id: Ic3aa668495293cb4d82a2cd7dcf3b6a337287678
* | Fix include pathsMathias Agopian2013-04-012-5/+6
| | | | | | | | Change-Id: If5350a3de995cc0cb1afea067e7ce168bc00d3f5
* | don't use compile-time configuration of libgui as much as possibleMathias Agopian2013-03-293-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now detect at runtime which sync features to use, which allows us to remove a lot of the compile-time configuration options. There is still one option though, to disable KHR_fence_sync on some devices (which are more efficient without it). - added a backdoor to get the vendor's EGL strings the new logic is: - use always ANDROID_native_fence_sync if available - fallback to KHR_fence_sync if available and not disabled by the compile-time option - use KHR_wait_sync if available and either of the above is enabled Change-Id: I9c4b49d9ff1151faf902cc93bd53ea5f205aaabf
* | fix uninitialized attribute in SurfaceFlingerMathias Agopian2013-03-281-1/+2
| | | | | | | | Change-Id: I8277f67e297a8b6a99195387060d03154a2cd929
* | Remove unused clz.cppJesse Hall2013-03-281-37/+0
|/ | | | Change-Id: Ieed91a45ba0e865a0d47d84effe9439aaab4371f
* Fix virtual displays for HWC<=1.1Jesse Hall2013-03-225-57/+73
| | | | | | | | | | | | | | If we're using a HWC that doesn't support virtual displays, or we have more virtual displays than HWC supports concurrently, the VirtualDisplaySurface should simply be a passthrough from source (GLES) to sink. This change also tries to distinguish between display types and HWC display IDs a little better, though there's more to do here. Probably needs a higher-level rethink; it's too error-prone now. Bug: 8446838 Change-Id: I708d2cf262ec30177042304f174ca5b8da701df1
* Fix dump when virtual display existsJesse Hall2013-03-222-3/+15
| | | | | | | | SurfaceFlinger::getLayerSortedByZForHwcDisplay only worked for builtin displays. Bug: 8384764 Change-Id: I989275407fb2f06d166a6e70321c3211e27e562e
* Isolate knowledge that fb target == output bufferJesse Hall2013-03-228-26/+65
| | | | | | | | | | | | | | | | HWComposer didn't allow the virtual display output buffer to be set directly, instead it always used the framebuffer target buffer. DisplayDevice was only providing the framebuffer release fence to DisplaySurfaces after a commit. This change fixes both of these, so both HWComposer and DisplayDevice should continue to work if VirtualDisplaySurface changes to use separate framebuffer and output buffers. It's also more correct since VirtualDisplaySurface uses the correct release fence when queueing the buffer to the sink. Bug: 8384764 Change-Id: I95c71e8d4f67705e23f122259ec8dd5dbce70dcf
* Use descriptive aliases instead of HWC_NUM_DISPLAY_TYPESJesse Hall2013-03-221-8/+11
| | | | | Bug: 8384764 Change-Id: Ia2563fab19dbc6e4a95bed03445e609334841cca
* Pass sp<Fence>s around instead of file descriptorsJesse Hall2013-03-229-23/+20
| | | | Change-Id: Iac70584a2207940730e8f803a543e4e9a4000c47
* Merge "Release virtual display buffer immediately after HWC set" into jb-mr2-devJesse Hall2013-03-228-65/+37
|\
| * Release virtual display buffer immediately after HWC setJesse Hall2013-03-208-65/+37
| | | | | | | | | | | | | | | | | | | | Previously we only queued a virtual display buffer to the sink when the next frame was about to be displayed. This may delay the "last" frame of an animation indefinitely. Now we queue the buffer as soon as HWC set() returns and gives us the release fence. Bug: 8384764 Change-Id: I3844a188e0f6ef6ff28f3e11477cfa063a924b1a
* | make sure screenshot are in a format supported by Bitmap.javaMathias Agopian2013-03-222-7/+32
| | | | | | | | Change-Id: I0fb9cc4088f9c1fd27e6c017b0a7c5617adb4660
* | fix a typo that broke all screenshotsMathias Agopian2013-03-211-1/+1
| | | | | | | | | | | | Bug: 8450197 Change-Id: I5b986cc0ff9c5e689d06a51ba68ab537d03d1f3d
* | Merge "only use glReadPixels() when needed when taking screenshots" into ↵Mathias Agopian2013-03-222-4/+9
|\ \ | | | | | | | | | jb-mr2-dev
| * | only use glReadPixels() when needed when taking screenshotsMathias Agopian2013-03-212-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | some drivers don't support this yet, so we use a system property to enable the glReadPixels "workaround" for them: ro.bq.gpu_to_cpu_unsupported=1 Change-Id: I74d6a3a8f0cee8d5a507b72c760cf247e39195e0
* | | initialize planeAlpha (to 0xFF) for the FB_TARGETMathias Agopian2013-03-211-0/+1
|/ / | | | | | | | | Bug: 8422625 Change-Id: I7b72456c2e01ed92e675cc1bfa0cfd0d2ce5064e
* | rework how we take screenshots for a CPU consumerMathias Agopian2013-03-192-105/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're not using IMemoryHeap as a transport anymore, instead we're providing a CpuConsumer and use the IGraphicBufferProducer version of the screenshot API. However, some GPU drivers don't support properly a GPU to CPU path, to work around this, we use a temporary BufferQueue on the server side for the GL rendering, and we use glReadPixels into the CpuConsumer (we're now using a CPU to CPU path which is always supported). Currently this "wrapping" is always performed, but it can be bypassed on devices that support the GPU to CPU path. This also addresses a DoS attack vector on SurfaceFlinger, where an application could consume all of SF's filedescriptors by creating a lot of screenshots in a row. Bug: 8390553 Change-Id: I9e81514c2a7711b9bb393f74305be7d2abe08f1c
* | Don't log an error on HWC1.1+ devices with no FB HALJesse Hall2013-03-192-11/+9
|/ | | | Change-Id: I015e5a1a1f926181e51f82525f69beff71bd70cd
* Merge changes I61ae54f3,I57cb668e,I7a3f1e1a,Id28a2f9b into jb-mr2-devJesse Hall2013-03-1914-119/+791
|\ | | | | | | | | | | | | | | * changes: Add BufferQueueInterposer and use it for virtual displays Add DisplaySurface abstraction Fix argument types in IGraphicBufferProducer methods Minor cleanups/fixes before virtual display refactoring
| * Add BufferQueueInterposer and use it for virtual displaysJesse Hall2013-03-187-10/+483
| | | | | | | | | | | | | | | | | | | | | | BufferQueueInterposer allows a client to tap into a IGraphicBufferProducer-based buffer queue, and modify buffers as they pass from producer to consumer. VirtualDisplaySurface uses this to layer HWC composition on top of GLES composition before passing the buffer to the virtual display consumer. Bug: 8384764 Change-Id: I61ae54f3d90de6a35f4f02bb5e64e7cc88e1cb83
| * Add DisplaySurface abstractionJesse Hall2013-03-1810-101/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | DisplayDevice now has a DisplaySurface instead of using FramebufferSurface directly. FramebufferSurface implements DisplaySurface, and so does the new VirtualDisplaySurface class. DisplayDevice now always has a surface, not just for virtual displays. In this change VirtualDisplaySurface is just a stub; buffers still go directly from GLES to the final consumer. Bug: 8384764 Change-Id: I57cb668edbc6c37bfebda90b9222d435bf589f37
| * Minor cleanups/fixes before virtual display refactoringJesse Hall2013-03-186-21/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | None of these should change behavior, except for removing some incorrect log messages when using a virtual display. - HWComposer::getAndResetReleaseFenceFd() checks the HWC version, so no need to do that in the DisplayDevice::onSwapBuffersCompleted(). However, it should check that mFramebufferSurface is not NULL like it is for virtual displays. - Comment that FramebufferSurface::dump() overrides the non-virtual ConsumerBase::dump(), and fix it so the right thing happens regardless of the static type of the pointer/reference the callee has. FramebufferSurface::dump() could be removed right now, but I'd need to bring it back in a later change. - Use the right enum for validating display type ids. - Don't try to send hotplug events for virtual displays. - Mark virtual displays as connected so HWComposer::prepare() doesn't think something is wrong when it gets a non-NULL layer list. - Remove unused FramebufferSurface methods. Bug: 8384764 Change-Id: Id28a2f9be86b45f4bb7915fdf7752157035f4294
* | don't allow screenshots without the READ_FRAMEBUFFER permissionMathias Agopian2013-03-151-0/+2
| | | | | | | | | | | | | | the recent screenshot rework allowed the older screenshot interface to work without that permission Change-Id: I6c4743f4591c81106e3b823d55a055f7b4907de1
* | Merge "get rid of purgatory and fix QueuesToWindowComposer query" into ↵Mathias Agopian2013-03-165-118/+51
|\ \ | | | | | | | | | jb-mr2-dev
| * | get rid of purgatory and fix QueuesToWindowComposer queryMathias Agopian2013-03-145-118/+51
| |/ | | | | | | | | | | | | | | | | | | | | | | | | the purgatory list wasn't needed anymore; in fact it had no effect as buffer life-time management is now handled by the BufferQueue. For QueuesToWindowComposer we keep a list of wp<> on the IBinder for IGraphicBufferProducers we hand over to clients so we can easily check if an IGraphicBufferProducer is ours. We clean-up the list when our IGraphicBufferProducer are destroyed. Bug: 8349142 Change-Id: I1aa06652ade8c72d0004a3f5e6c3d6e8a82fc2ae
* | don't capture hidden layers in screenshotsMathias Agopian2013-03-151-3/+5
|/ | | | | Bug: 8389956 Change-Id: I9ed836395258732c743c6fd44092bd01020dde13
* size IMemoryHeap properly for screenshotsMathias Agopian2013-03-131-1/+1
| | | | | | | | | since we're using glReadPixels(), we only need to use the width (as opposed to the stride) of the source screenshot. Bug: 8374664 Change-Id: I145c80f4fff5444df7c77c4f52e70a7203caddbd
* Surface can now be created only from an IGraphicBufferProducerMathias Agopian2013-03-122-84/+0
| | | | | | | it can't write itself to a parcel, nor can it be created from a parcel. Change-Id: I69165d5c54d6024b3e546e80d8b57e3dedda7893
* get rid of ISurfaceMathias Agopian2013-03-128-175/+147
| | | | | | | | | | | | ISurface was only used to get the IGraphicBufferProducer from a Layer. It's now replaced by a BBinder subclass / IBinder and is only used as a handle to the surface, to both refer to it and manage its life-time. Also cleaned-up a bit the ISurfaceComposer interface and "create layer" code path. Change-Id: I68d0e02d57b862cffb31d5168c3bc10cea0906eb
* Fix missing recents screenshotsMathias Agopian2013-03-111-6/+8
| | | | | | | | | | | | We were using the "visible layer list" when taking screenshots, which doesn't work when a layer is behind other opaque layers and therefore hidden. We fix this by using the full layer list, filtered by the layerstack of the display we're looking at. Bug: 7552304 Change-Id: I4b6f77e5511aea94f8d218975b6e22738e7e5d5b
* make sure to call compositionComplete after taking a screenshotMathias Agopian2013-03-081-0/+3
| | | | | | | | older drivers which are doing implicit synchronization need this or they could deadlock. Bug: 8341885 Change-Id: Icd980a6be16071678d6151e34725b3c1c547d7ee