New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 651669 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 643240



Sign in to add a comment

powerd should give Chrome a way to turn the display off immediately

Project Member Reported by derat@chromium.org, Sep 30 2016

Issue description

(See doc at https://docs.google.com/document/d/1W9GfYWj-YWRO6Run3r1P4WTOE0LGgPMvLVqmC1vpBsM/edit?ts=57d1e596#heading=h.9yvwynq659oj)

powerd should expose two new D-Bus methods:

SetForceDisplayOff(bool) -> [empty response]
GetForceDisplayOffState() -> bool

The first method will set a bool in the display BacklightController that results in the backlight being immediately set to 0% and Chrome being told to turn all displays off, regardless of any other state. This is similar to how we force displays off when the system starts shutting down.

The second method will return the value of the bool. Chrome will call this at startup (after powerd is available) to get the initial state, to handle cases where Chrome crashes or restarts for some other reason while the display is off.

There are additional open questions around e.g. preventing the keyboard from waking from S3 while in this state, but let's use another bug for that once we have a better understanding of what needs to be done.
 

Comment 1 by bleung@chromium.org, Sep 30 2016

Cc: bleung@chromium.org
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 6 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/system_api/+/d726d6e8e26c53689f9d4d732d6650ec296722e3

commit d726d6e8e26c53689f9d4d732d6650ec296722e3
Author: Daniel Erat <derat@chromium.org>
Date: Mon Oct 03 18:46:53 2016

power_manager: Add [S,G]etBacklightsForcedOff constants.

Add constants for new SetBacklightsForcedOff and
GetBacklightsForcedOff D-Bus methods that will be exported
by powerd.

BUG= chromium:651669 
TEST=built it

Change-Id: Id4724935fe9e5352feea4cc535d6c5a52acd2dc9
Reviewed-on: https://chromium-review.googlesource.com/394146
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Qiang Xu <warx@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>

[modify] https://crrev.com/d726d6e8e26c53689f9d4d732d6650ec296722e3/dbus/power_manager/dbus-constants.h

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/b125db902c30359ac43ca15d1a1c2f921c31c564

commit b125db902c30359ac43ca15d1a1c2f921c31c564
Author: Daniel Erat <derat@chromium.org>
Date: Sat Oct 01 15:33:12 2016

power: Add SetForceBacklightsOff and GetForceBacklightsOff.

Add new D-Bus methods that can be used to force the display
and keyboard backlights (if present) off and to query the
current state. These can be called by Chrome to turn the
backlights off immediately when the power button is tapped
and to get the current state after browser startup.

Also move backlight controllers' initialization lists into
class definitions.

The new methods can be manually exercised with:

  dbus-send --system --dest=org.chromium.PowerManager \
      --print-reply --type=method_call \
      /org/chromium/PowerManager \
      org.chromium.PowerManager.SetBacklightsForcedOff \
      boolean:true

and:

  dbus-send --system --dest=org.chromium.PowerManager \
      --print-reply --type=method_call \
      /org/chromium/PowerManager \
      org.chromium.PowerManager.GetBacklightsForcedOff

BUG= chromium:651669 
TEST=added tests; also manually verified it works
CQ-DEPEND=CL:394146

Change-Id: I6588b29368e9a7f1159167c0ba7536ef29cfff14
Reviewed-on: https://chromium-review.googlesource.com/394167
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>

[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/keyboard_backlight_controller_unittest.cc
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/backlight_controller_stub.cc
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/external_backlight_controller_unittest.cc
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/internal_backlight_controller.h
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/backlight_controller_stub.h
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/internal_backlight_controller.cc
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/internal_backlight_controller_unittest.cc
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/daemon.cc
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/external_backlight_controller.h
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/keyboard_backlight_controller.cc
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/keyboard_backlight_controller.h
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/backlight_controller.h
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/policy/external_backlight_controller.cc
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/daemon.h
[modify] https://crrev.com/b125db902c30359ac43ca15d1a1c2f921c31c564/power_manager/powerd/daemon_unittest.cc

Comment 4 by derat@chromium.org, Oct 7 2016

Blocking: 643240

Comment 5 by derat@chromium.org, Oct 10 2016

Status: Fixed (was: Assigned)
Status: Verified (was: Fixed)

Sign in to add a comment