summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/EventThread.cpp
Commit message (Collapse)AuthorAgeFilesLines
* input: Adjust prioritySteve Kondik2015-10-171-0/+2
| | | | | | * Bring into the desired group to get the best result. Change-Id: I3bd031074cd7006994736b4c22d0294b6012f662
* SF: Permit changing DispSync offsets at runtimeDan Stoza2015-04-151-0/+5
| | | | | | | | | | This modifies EventThread such that its phase offsets for both Choreographer and SurfaceFlinger may be modified at runtime. It also plumbs this functionality up to the SurfaceFlinger debug interface so that it is possible to rapidly test different offsets without restarting the framework. Change-Id: I426873f8553f931250dfebc9a8a4a78e9f1f4309
* SurfaceFlinger: send VSYNC power hints to IPowerManagerRuchi Kandoi2014-06-181-3/+36
| | | | | | | | VSYNC power hints are now sent via binder to IPowerManager. SurfaceFlinger no longer loads a second copy of the PowerHAL. VSYNC power hints are sent in batches and not on per frame basis. Change-Id: Ia5a839ab3c857cffae7089f810b4315d4ed23fcf
* Revert "SurfaceFlinger: send VSYNC power hints to IPowerManager"Ruchi Kandoi2014-04-041-36/+3
| | | | This reverts commit d469a1c3285b974cf2637517cc25727da8f82668.
* SurfaceFlinger: send VSYNC power hints to IPowerManagerRuchi Kandoi2014-04-041-3/+36
| | | | | | | | VSYNC power hints are now sent via binder to IPowerManager. SurfaceFlinger no longer loads a second copy of the PowerHAL. VSYNC power hints are sent in batches and not on per frame basis. Change-Id: Icc2eee5df56135bd24dc244a84e7c12dd5511fec
* SurfaceFlinger: fix 64-bit format string warningsGreg Hackmann2014-03-071-1/+1
| | | | | Change-Id: Idacfbf0601743fba1c5de7632201a66a307a2710 Signed-off-by: Greg Hackmann <ghackmann@google.com>
* SurfaceFlinger: SW-based vsync eventsJamie Gennis2013-10-071-21/+21
| | | | | | | | | | This change adds the DispSync class, which models the hardware vsync event times to allow vsync event callbacks to be done at an arbitrary phase offset from the hardware vsync. This can be used to reduce the minimum latency from Choreographer wake-up to on-screen image presentation. Bug: 10624956 Change-Id: I8c7a54ceacaa4d709726ed97b0dcae4093a7bdcf
* Use new HWC display type/count constants.Jesse Hall2013-08-161-10/+12
| | | | Change-Id: I774d0c68906ac6dc69268f708c30a6b0868b8816
* clean-up/simplify all dump() APIsMathias Agopian2013-04-221-1/+1
| | | | | | | remove the scratch buffer parameter and use String8::appendFormat() instead. Change-Id: Ib96c91617c8e7292de87433d15cf6232b7d591b0
* Minor cleanups/fixes before virtual display refactoringJesse Hall2013-03-181-8/+8
| | | | | | | | | | | | | | | | | | | | | | | 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
* make sure we don't call into the HWC HAL when not neededMathias Agopian2012-10-041-2/+2
| | | | | | | | | when enabling/disabling vsync we now make sure to not call into the HAL if the state wouldn't change. Bug: 7274951 Change-Id: Ie24a6d68888a51b577acf9c2a973d85437cbacaf
* Display events now always carry the display id they happened onMathias Agopian2012-09-211-25/+53
| | | | Change-Id: I12de1d883c23927722bc3a71b782f0079de4e831
* fix an issue where hotplug events were not dispatchedMathias Agopian2012-09-211-12/+19
| | | | Change-Id: I527eec77f338cd6f1a9021aa4c9d384dbddd6d2a
* We now report hotplug events to the frameworkMathias Agopian2012-09-201-15/+36
| | | | Change-Id: I2d6b7787d39e5929485a551e4982498c5053c211
* Minor tweaksAndy McFadden2012-09-131-5/+0
| | | | | | | A couple of minor cleanups I stumbled over while looking at other things. Change-Id: I385ecfe1afefd577afbc59d7ef1d98d868073651
* Add timeout when waiting for HW vsyncAndy McFadden2012-08-311-9/+34
| | | | | | | This way we don't get stuck if, say, the driver decides not to send us vsync events. Change-Id: I4af6358b3a1f304eaae5fd926ed3403fa1091827
* Eradicate DisplayID.Mathias Agopian2012-08-271-1/+1
| | | | | | | | DisplayDevices are now keyed of the wp<IBinder> the client uses. DisplayID has now become DisplayType which is just used to identify physical displays (as opposed to virtual displays such as wifi displays). Change-Id: I0c5968f2c902dcd699a7e0afacf833ff070c12ea
* simplify further vsync handlingMathias Agopian2012-08-231-84/+75
| | | | | | | | | | | | - we now clean-up "dead" connection in the main loop, this entirely avoid the problem with the side effects of releasing strong references. We now only hold on to strong reference for the connection we will signal. - also simplify how we build the list of "ready" connections, by only adding them to the list when we did receive a vsync event Change-Id: I2a84da431320a2af8e8a93e07622a1d258236f43
* fix various issues in SF's EventThreadMathias Agopian2012-08-201-50/+51
| | | | | | | | | | | | | | | | - one issues caused most timestamps to be reported as 0 - on rare occasions an uninitialized variable could be used - vsync counts per connection were accessed unthreadsafely we now have 2 lists of connections in the main loop, one just keeps a list of strong refs to the connections because once we have a strong ref we're not allowed to release it while holding the lock. the 2nd list holds the connections that have a vsync event to be reported. all the calculations are made with the lock held. Change-Id: Iacfad3745b05df79d9ece3719bd4c34ddbfd5b83
* Fix deadlock in SF.Mathias Agopian2012-08-171-98/+86
| | | | | | | | | | | | | | | problem was that we were acquiring a strong reference on Connection object with a lock held, when those got out of scope (lock still held) their dtor could be called if all other refs had dropped, the dtor would acquire the lock again to remove the Connection from the main list. boom. we rearange the code so this doesn't happen. Bug: 6942208 Change-Id: I0a0ebabce2842d29d60d645b64aac2f26640e59b
* rename DisplayHardware to DisplayDeviceMathias Agopian2012-08-021-1/+0
| | | | Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
* split HWComposer out of DisplayHardwareMathias Agopian2012-07-241-4/+5
| | | | | | | | | | we will only ever have a single instance of HWComposer, so it's now an attribute of SurfaceFlinger, instead of being part of DisplayHardware. DisplayHardware now just represents a "display" (it should be renamed). Change-Id: Iec191e57686868e1df6daa8b880a286c9fefde56
* SurfaceFlinger cleanupMathias Agopian2012-07-241-6/+3
| | | | | | | mostly refactored SurfaceFlinger.h, but also removed dead code. cleaned-up a few includes as well. Change-Id: Ib15f4ffe567912b61ee98aa076c6a283b72811b5
* get rid of GraphicPlaneMathias Agopian2012-06-281-2/+2
| | | | | its functionality is now folded into DisplayHardware there will be more changes in that area.
* SF could get stuck waiting for vsync when turning the screen offMathias Agopian2012-06-151-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When turning the screen off we could have 2 waiters on the vsync condition: The main vsync waiter as well as one in onScreenReleased(). We were only signaling the condition though, so it it would be possible to wake onScreenReleased() without waking the main vsync thread which would then be stuck in .wait(). We fix this by just using broadcast() when receiving a vsync event. We also add a broadcast() to signal when the state of mUseSoftwareVSync changes. This is important particularly for the transition from hardware to software vsync because the main vsync waiter might have observed mUseSoftwareVSync == false and decided to block indefinitely pending a hardware vsync signal that will never arrive. Removed a potentially deadlocking wait for a signal in onScreenReleased(). The function was trying to wait for the last vsync event from the hardware to be delivered to clients but there was no guarantee that another thread would signal it to wake up again afterwards. (As far as I can tell, the only other other thread that might wake it up at this point would be a client application issuing a vsync request.) We don't really need to wait here anyhow. It's enough to set the mUseSoftwareVSync flag, wake up the thread loop and go. If there was a pending vsync timestamp from the hardware, then the thread loop will grab it and use it then start software vsync on the next iteration. Bug: 6672102 Change-Id: I7c6abc23bb021d1dfc94f101bd3ce18e3a81a73e
* set vsync power hintMathias Agopian2012-04-261-2/+2
| | | | Change-Id: I28c2faf9ff584df3e74392712971cbcf75eb9e98
* don't wake-up eventthread every 16ms if there are no vsync requestsMathias Agopian2012-04-121-1/+1
| | | | | Bug: 6332534 Change-Id: Idf79ad913770c6180969f6c95a9b125fff580231
* make sure to disable VSYNC while screen is offMathias Agopian2012-04-111-17/+39
| | | | Change-Id: If1894c43b0a39a2851e1280a35ae77bccd6d9abd
* Added vsync debugging information in dumpsys logMathias Agopian2012-04-101-8/+23
| | | | Change-Id: I20ef05a73d89caaf6a70dc9ca25ada6e6a1f6ff9
* VSYNC handling cleanupMathias Agopian2012-04-081-2/+0
| | | | Change-Id: I1376bf864c4e03c11fb6d1333a8b7cfdda08c9e4
* avoid turning vsync off/on at each frameMathias Agopian2012-04-081-10/+24
| | | | | | | always keep vsync active for an extra frame before deciding if it should be turned off. Change-Id: I55b03265b7851b33a595e46a013f2ab55e66c964
* SurfaceFlinger now uses the new VSYNC HAL API.Mathias Agopian2012-04-041-55/+70
| | | | | | | If h/w composer doesn't support vsync (version < 0.3) we "fake" it with a timer. Change-Id: I1e3be79f43c9631d1293ad7d6cf52f9bfc42d65b
* refactor / simplify EventThreadMathias Agopian2012-04-031-44/+69
| | | | Change-Id: I3981c6fba93b7b985174b2a7045e24db2c0b4428
* add more ATRACEMathias Agopian2012-03-011-0/+4
| | | | Change-Id: I6cc5759fb0a05427680488fd12ae797e77644f3d
* fix an issue with vsync event deliveryMathias Agopian2012-01-311-7/+3
| | | | | | | | | | | | | vsync events were sometimes delivered to connected client who didn't request them. this happened if another client requested the delivery and that client was first in the client list. also fix the vsync test which didn't request any events as well as DisplayEventReveiver documentation which was misleading about the necessity to request vsync events. Change-Id: Ie990fda3f337f8f0042745c4b2cde67936c45686
* SF now synchronizes to VSYNCMathias Agopian2012-01-301-6/+23
| | | | Change-Id: Ic5e4f2ea9927ce133eef9499c03161325e9d02c5
* improve SurfaceFlinger dumpsysMathias Agopian2012-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It is now possible to say: dumpsys SurfaceFlinger --latency to print latency information about all windows dumpsys SurfaceFlinger --latency window-name to print the latency stats of the specified window for instance: dumpsys SurfaceFlinger --latency SurfaceView The data consists of one line containing global stats, followed by 128 lines of tab separated timestamps in nanosecond. The first line currently contains the refresh period in nanosecond. Each 128 following line contains 3 timestamps, of respectively the app draw time, the vsync timestamp just prior the call to set and the timestamp of the call to set. Change-Id: Ib6b6da1d7e2e6ba49c282bdbc0b56a7dc203343a
* fix a bug with vsync managementMathias Agopian2012-01-121-8/+7
| | | | | | | this bug was introduced recently. we were signaling *all* clients regardless of the vsync rate. Change-Id: I2ae8a6c820a390f602382596ba75e8ed737fb2ef
* Fix an issue with VSYNCMathias Agopian2012-01-111-38/+31
| | | | | | | one-shot VSYNC listeners could miss a VSYNC event if scheduled while in waitForVsync(). Change-Id: I720485784aecfea6cc7a23c77081d7af3c9c71db
* Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block2012-01-041-1/+1
| | | | | | | See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
* Improve the VSYNC api a bit.Mathias Agopian2011-12-061-14/+89
| | | | | | | | | | | - add the ability to set the vsync delivery rate, when the rate is set to N>1 (ie: receive every N vsync), SF process' is woken up for all of vsync, but clients only see the every N events. - add the concept of one-shot vsync events, with a call-back to request the next one. currently the call-back is a binder IPC. Change-Id: I09f71df0b0ba0d88ed997645e2e2497d553c9a1b
* fix a deadlock when removing a DisplayEventConnectionMathias Agopian2011-12-051-21/+43
| | | | | | | | | the deadlock would happen when the pipe became invalid and SF trying to remove the connection from its list. we know make sure to process events without holding a lock. Change-Id: I39927ed8824fc7811e16db3c7608a2ebc72d9642
* Add support for sending VSYNC events to the frameworkMathias Agopian2011-11-291-0/+129
use gui/DisplayEvent to receive the events. Events are dispatched through a unix pipe, so the API is compatible with utils/Looper. see gui/DisplayEvent.h for more info. Bug: 1475048 Change-Id: Ia720f64d1b950328b47b22c6a86042e481d35f09