OSDN Git Service

Fixes vsync behavior in power mode transitions.
authorMatthew Bouyack <mbouyack@google.com>
Fri, 12 May 2017 19:49:32 +0000 (12:49 -0700)
committerMatthew Bouyack <mbouyack@google.com>
Fri, 12 May 2017 20:56:21 +0000 (13:56 -0700)
commit4de4ee3cb3ccb3bcf4ea507f7bd6e02ab29aeb75
treeb9baced46475cfbe4d0c16d378032d6121a806a4
parent46d455b3abaa2c7a54c8d4e3b3cd5a03fe59ac2f
Fixes vsync behavior in power mode transitions.

Calling EventThread::onScreenAcquired enables hardware vsync and
calling EventThread::onScreenReleased disables hardware vsync.

The power modes 'NORMAL' and 'DOZE' should have hardware vsync
enabled while power modes 'OFF' and 'DOZE_SUSPEND' should have
hardware vsync disabled.

This change correctly handles the transitions from 'OFF' to
'DOZE_SUSPEND' and from either 'OFF' or 'DOZE_SUSPEND' to
'NORMAL'. Previously these cases were handled incorrectly.

Note that redundant calls to onScreenAcquired or onScreenReleased
are safe.

Fixes bug: 38232221

Change-Id: I7b00f97a67b157366364b3d26fe94533da07c263
services/surfaceflinger/SurfaceFlinger.cpp
services/surfaceflinger/SurfaceFlinger_hwc1.cpp