Skip to content

drm/adbe: Turn the backlight off with the display pipe (iPhone 6s) - #186

Open
jeroentrappers wants to merge 2 commits into
OrchardLinux:mainfrom
jeroentrappers:adbe-backlight-pr
Open

jeroentrappers wants to merge 2 commits into
OrchardLinux:mainfrom
jeroentrappers:adbe-backlight-pr

Conversation

@jeroentrappers

Copy link
Copy Markdown

On the iPhone 6s, the backlight stayed lit when the display was turned off. This series turns it off and on with the display pipe.

Why it stayed on: a compositor's DPMS off and a power-down fbdev blank both disable the CRTC, but adbe only switched the backlight around system sleep. The fbdev blank notifier doesn't help, because the kernel is built without FB_BACKLIGHT. On top of that, the 6s never found its backlight at all: the lookup sat in the eDP panel-supply attach (the iPad's path; the 6s panel is MIPI DSI), and the 6s device tree had no backlight link.

The series:

  1. drm/adbe: Turn the backlight off with the pipe:
    • The CRTC's disable turns the backlight off, and its enable turns it back on.
    • A separate adbe_backlight_find() looks the backlight up on first use, so panels without the eDP path find it too.
    • A backlight held off after a failed panel wake stays off.
    • Suspend and resume take panel_lock around the CRTC's disable and enable, not inside them, so this doesn't nest.
    • Rebased onto main's DSI panel sleep (adbe_dsi_panel_set()): enable wakes the panel first, then the backlight. Disable turns the backlight off first, then sleeps the panel.
  2. arm64: dts: apple: s800x-6s: Give the display pipe its backlight: backlight = <&dwi_bl> plus post-init-providers on &disp0. The 6s Plus shares this file; its ADT was not checked.

Tested on an iPhone 6s (N71m), on the 6s branch before this rebase. I blanked fb0 three times with power-down (blank=4) and read the backlight while it was blanked:

  • While blanked: actual_brightness 0 and bl_power 4 on every cycle.
  • After unblank: 400/400 and bl_power 0, the level it was set to.
  • Before this series: the backlight stayed at 400 while blanked.
  • Clean: checkpatch.pl on both commits. The rebased driver code is the same, function for function, as a tree that builds for n71m with main merged.
  • Not tested on hardware since the rebase: the combination with main's DSI panel sleep. It boots on the 6s next time; I'll report the result here.

Proposed CHANGELOG entry (not added; for you to take or adjust): "iPhone 6s: the backlight now turns off with the display (screen blank and DPMS off)."

Nothing turned the backlight off when the display went off: a
compositor's DPMS off and a power-down fbdev blank disable the CRTC,
and this driver only handled the backlight around system sleep. The
fbdev blank notifier does not help either, as the kernel is built
without FB_BACKLIGHT. On an iPhone 6s the backlight stayed at its
level through fb0 blank=4.

Turn the backlight off when the CRTC is disabled and back on when it is
enabled, looking it up first if no sleep has done so yet. A backlight
held off after a failed panel wake stays off. Suspend and resume take
panel_lock around, not inside, the CRTC's disable and enable, so this
does not nest.

Assisted-by: LLM
Signed-off-by: Jeroen Trappers <jeroen.trappers@gmail.com>
The iPhone 6s's display pipe has no backlight phandle, so the driver
cannot turn the backlight off when the pipe goes off: after a power-down
fbdev blank the panel showed nothing but the backlight stayed lit.
Point it at the DWI backlight. post-init-providers keeps the backlight
from holding up the pipe's probe, as on the iPad 5.

Assisted-by: LLM
Signed-off-by: Jeroen Trappers <jeroen.trappers@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant