OSDN Git Service

SurfaceFlinger: Do less work when using PTS
authorDan Stoza <stoza@google.com>
Sat, 8 Nov 2014 00:00:59 +0000 (16:00 -0800)
committerDan Stoza <stoza@google.com>
Mon, 17 Nov 2014 21:32:13 +0000 (21:32 +0000)
commit6b9454d1fee0347711af1746642aa7820b1ea04d
treeebf569047268bfce45e46fa63ae84d1e6d00fa9a
parent7d9fdd1e0d980fb9e67fbb96b4c499b1895109f1
SurfaceFlinger: Do less work when using PTS

Currently, SurfaceFlinger is very dumb about how it handles buffer
updates at less than 60fps. If there is a new frame pending, but its
timestamp says not to present it until later SurfaceFlinger will wake
up every vsync until it is time to present it. Even worse, if
SurfaceFlinger has woken up but nothing has changed, it still goes
through the entire composition process.

This change (mostly) fixes that inefficiency. SurfaceFlinger will
still wake up every refresh period while there is a new frame
pending, but if there is no work to do, it will almost immediately go
back to sleep.

Bug: 18111837
Change-Id: I7825bacd37f40bf26edcc6a5e0f051dce45291fb
services/surfaceflinger/Layer.cpp
services/surfaceflinger/Layer.h
services/surfaceflinger/SurfaceFlinger.cpp
services/surfaceflinger/SurfaceFlinger.h
services/surfaceflinger/SurfaceFlingerConsumer.h