Commit Graph

27 Commits

Author SHA1 Message Date
Dan Stoza db4ac3ce63 SF: Permit changing DispSync offsets at runtime
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
2015-04-15 13:56:28 -07:00
Ruchi Kandoi ef472ec40a SurfaceFlinger: send VSYNC power hints to IPowerManager
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
2014-06-18 18:51:24 -07:00
Ruchi Kandoi 4098f03d5c Revert "SurfaceFlinger: send VSYNC power hints to IPowerManager"
This reverts commit d469a1c328.
2014-04-04 18:09:30 -07:00
Ruchi Kandoi d469a1c328 SurfaceFlinger: send VSYNC power hints to IPowerManager
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
2014-04-04 20:22:31 +00:00
Jamie Gennis faf77cce9d SurfaceFlinger: SW-based vsync events
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
2013-10-07 17:59:53 -07:00
Jesse Hall 9e663de4fe Use new HWC display type/count constants.
Change-Id: I774d0c68906ac6dc69268f708c30a6b0868b8816
2013-08-16 14:28:37 -07:00
Saurabh Shah 5c876fa6b2 SurfaceFlinger: EventThread: Fix Vsync array size.
Vsync array size is specified as HWC_DISPLAY_TYPES_SUPPORTED whose
value luckily happens to be 2. That enum is actually used for querying
hwc for the number of displays supported.

The implementation file EventThread.cpp correctly accesses the array
upto HWC_NUM_DISPLAY_TYPES

Change-Id: I36e3f0913e7d6fda7bbf4449c1fb32c7f18bb934
Signed-off-by: Amara Venkata Mastan Manoj Kumar<manojavm@codeaurora.org>
Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
2013-07-12 16:29:48 -07:00
Mathias Agopian 74d211ae26 clean-up/simplify all dump() APIs
remove the scratch buffer parameter and use
String8::appendFormat() instead.

Change-Id: Ib96c91617c8e7292de87433d15cf6232b7d591b0
2013-04-22 21:51:28 +02:00
Mathias Agopian ff28e201ec Display events now always carry the display id they happened on
Change-Id: I12de1d883c23927722bc3a71b782f0079de4e831
2012-09-21 14:20:35 -07:00
Mathias Agopian 148994e5f3 We now report hotplug events to the framework
Change-Id: I2d6b7787d39e5929485a551e4982498c5053c211
2012-09-20 17:13:58 -07:00
Andy McFadden ae2cfb5746 Minor tweaks
A couple of minor cleanups I stumbled over while looking at other
things.

Change-Id: I385ecfe1afefd577afbc59d7ef1d98d868073651
2012-09-13 11:21:40 -07:00
Mathias Agopian 3ee454a7be Eradicate DisplayID.
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
2012-08-27 17:43:43 -07:00
Mathias Agopian f6bbd44a23 simplify further vsync handling
- 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
2012-08-23 15:26:27 -07:00
Mathias Agopian a4cb35a286 fix various issues in SF's EventThread
- 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
2012-08-20 21:41:29 -07:00
Mathias Agopian 10125f00a5 Fix deadlock in SF.
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
2012-08-17 18:48:56 -07:00
Mathias Agopian 0f2f5ff75b rename DisplayHardware to DisplayDevice
Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
2012-08-02 22:24:12 -07:00
Mathias Agopian 8630320433 split HWComposer out of DisplayHardware
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
2012-07-24 22:49:49 -07:00
Mathias Agopian 921e6ac4b7 SurfaceFlinger cleanup
mostly refactored SurfaceFlinger.h, but also removed dead code.
cleaned-up a few includes as well.

Change-Id: Ib15f4ffe567912b61ee98aa076c6a283b72811b5
2012-07-24 00:09:35 -07:00
Mathias Agopian 1b03149f35 get rid of GraphicPlane
its functionality is now folded into DisplayHardware
there will be more changes in that area.
2012-06-28 17:27:19 -07:00
Mathias Agopian 22ffb117b0 make sure to disable VSYNC while screen is off
Change-Id: If1894c43b0a39a2851e1280a35ae77bccd6d9abd
2012-04-11 15:31:40 -07:00
Mathias Agopian e2c4f4ec23 Added vsync debugging information in dumpsys log
Change-Id: I20ef05a73d89caaf6a70dc9ca25ada6e6a1f6ff9
2012-04-10 21:04:12 -07:00
Mathias Agopian 3eb38cb33e SurfaceFlinger now uses the new VSYNC HAL API.
If h/w composer doesn't support vsync (version < 0.3) we
"fake" it with a timer.

Change-Id: I1e3be79f43c9631d1293ad7d6cf52f9bfc42d65b
2012-04-04 19:01:20 -07:00
Mathias Agopian cb9732a951 refactor / simplify EventThread
Change-Id: I3981c6fba93b7b985174b2a7045e24db2c0b4428
2012-04-03 18:28:25 -07:00
Mathias Agopian 8aedd4737d SF now synchronizes to VSYNC
Change-Id: Ic5e4f2ea9927ce133eef9499c03161325e9d02c5
2012-01-30 15:21:23 -08:00
Mathias Agopian 478ae5eb5a Improve the VSYNC api a bit.
- 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
2011-12-06 22:43:10 -08:00
Mathias Agopian 23748668d3 fix a deadlock when removing a DisplayEventConnection
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
2011-12-05 19:58:47 -08:00
Mathias Agopian d0566bc26f Add support for sending VSYNC events to the framework
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
2011-11-29 13:10:25 -08:00