Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 186 additions & 10 deletions device/panther/DISPLAY-PLAN.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- SPDX-License-Identifier: MIT -->
# Pixel 7 (panther) display: DCS brightness, then flip-only KMS

Status (2026-11-01): G1, D1 and D2 passed (kernel: [linux-omarchy-mobile#177](https://github.com/derekross/linux-omarchy-mobile/pull/177), in review): the panel driver takes the panel over, and brightness and display off/on work over DCS, including from the shell's slider. device-panther 0.1.4 ships `allow_tx=1`, and at its boots `allow_tx` reads Y with no hand-written option. Next: D3 (flip-only KMS).
Status (2026-11-01): G1, D1, D2 and D3 passed. Brightness and display off/on work over DCS ([linux-omarchy-mobile#177](https://github.com/derekross/linux-omarchy-mobile/pull/177), merged), and gs-decon drives the screen: Hyprland flips at 60 Hz, DPMS off stops the frames and puts the panel to sleep, and the panel's cold init wakes it ([linux-omarchy-mobile#181](https://github.com/derekross/linux-omarchy-mobile/pull/181), in review). device-panther 0.1.7 ships `screen_off=2`, and the bring-up file is gone. A second Pixel 7 passed D3 too (2026-11-03). Next: D4 (90 Hz).

Today the Pixel 7 shows the bootloader's framebuffer through simplefb and
simpledrm: no brightness control, no screen off, no vsync. The Pixel 7 Pro
Expand Down Expand Up @@ -121,16 +121,113 @@ shell's brightness slider drives the backlight.

### D3. Flip-only KMS (medium-high risk; staged)

`gs-decon` with the S6E3FC3 modes at 60 Hz, in three stages:
- **Stage 0:** log DECON and DPP0, read-only.
- **Stage 1:** count frame starts. The measured rate should be about 60 Hz.
- **Stage 2:** take the screen over from simpledrm, then test DPMS off/on
and the panel sleep (`screen_off=2`).
**The changes** ([linux-omarchy-mobile#181](https://github.com/derekross/linux-omarchy-mobile/pull/181)):
1. `drm/panel: samsung-s6e3fc3: support sleep and a cold restart from KMS`.
A panel taken over from the bootloader is marked prepared and enabled,
so gs-decon's `drm_panel_disable()`/`unprepare()` reach it. While the
panel is asleep, backlight changes are only recorded, and the panel's
lock covers every command sequence. This mirrors the S6E3HC4 change.
2. `drm: google: gs-dsim-cmd: recognise the Pixel 7's link`. The
bootloader's 60 Hz pair (UNDERRUN_CTRL 0x1cf8, CMD_TE_CTRL1 0x2a82306d,
read in D1) gets no second rate, so gs-decon gets the link and the panel
but never switches the rate.
3. `drm: google: gs-decon: pick the modes by the bootloader's scanout size`.
Each SoC gets a list of mode sets, one per panel, chosen by the size ABL
scans out. gs201 gains the S6E3FC3 P10 at 1080x2400, 60 Hz.
4. `drm: google: gs-decon: scan out padded rows on gs201 too`. It was found
in D3c: buffers allocated for 1080-pixel rows are padded to 64 bytes
(pitch 4352), and gs201 only took the boot pitch (4320). It comes before
the DECON0 enable, so that a bisect never lands on a frozen screen.
5. `arm64: dts: ... gs201-panther: enable DECON0 for gs-decon`. DECON0
gets a `display_pool` (0x3800000, five 1080x2400 XRGB8888 buffers, below
4 GiB, reusable) and the boot framebuffer.

**Kernel D3** = D1 plus that branch. It is built
(`7.3.0-rc6-omamobile-push1-gdc3f0ce5e425`), and D1's image set is kept as
its rollback.

Without a module option, gs-decon goes straight to stage 2 at boot. So the
first boot holds it at stage 0 with a bring-up file on the phone,
`/etc/modprobe.d/omamobile-display-bringup.conf`:
`options gs_decon stage=0`. That file is deleted once D3 passes (AGENTS.md §2).

#### D3a. Stage 0, read-only (low risk)

**Before the boot:**
1. Write the bring-up file.
2. `modules-push` D3.
3. Fastboot (Power + Volume Down), then flash D3. The flash puts slot B
back at 3 retries.

Each stage is its own boot or module reload. The plan gets its own
runbook before D3 starts, with a Rollback for each stage: D2's image set
by fastboot, and `gs_decon` blacklisted so that simpledrm keeps the
screen.
**Pass:**
- **0.1.4 at boot:** `allow_tx` reads Y with no hand-written option, and
the slider changes the brightness.
- `gs_decon` binds and logs DECON0 and DPP0 as ABL left them: command
mode, 1080x2400, DPP0 at 0xfac00000. It also logs "link timers for
60 Hz" from gs-dsim-cmd.
- simpledrm still owns `card0`, and the screen looks as before.

**Stop if:** "unexpected scanout size", "DPP0 scans …", or a DSIM error.
**Rollback:** stage 0 changes nothing, so keeping the bring-up file is
enough to go on with simpledrm; otherwise flash D1's set by fastboot.

#### D3b. Stage 1, frame count (low risk)

On the running D3 kernel: `rmmod gs_decon; modprobe gs_decon stage=1`.

**Pass:** the frame start and frame done interrupts count at about 60 per
second (the driver's `stats` in sysfs and `/proc/interrupts`), with no
interrupt storm. The screen is unchanged.

**Stop if:** a storm warning, or the count is far from 60.
**Rollback:** `rmmod gs_decon`.

#### D3c. Stage 2, KMS (medium-high risk; the screen goes through gs-decon)

Hyprland runs on simpledrm, and taking its device away at runtime would
end the session. So stage 2 comes with a reboot:
1. Change the bring-up file to `options gs_decon stage=2 screen_off=0`.
2. Push or reboot. Slot B goes from 2 retries to 1.

**Pass:**
- gs-decon registers its DRM device, and simpledrm goes away (the aperture
is handed over).
- Hyprland and the Omarchy shell come up on gs-decon at 1080x2400, 60 Hz.
- Touch, the brightness slider and animations work, and vblank events
arrive (`modetest` or Hyprland's frame timing).
- There are no flip timeouts.

**Stop if:** a black or frozen screen, flip timeouts, or Hyprland failing
to start.
**Rollback:**
- over SSH, set the bring-up file back to `stage=0` and reboot;
- or flash D1's set by fastboot.

USB and SSH don't depend on the screen.

#### D3d. Screen off (medium risk; the screen turns off and on)

On D3c, with Hyprland's Lua dispatchers (AGENTS.md: `hl.dsp.dpms({ action
= "disable" })`, then `"enable"`):
1. `screen_off=0`: DPMS off sends black frames, and DPMS on shows the
desktop again.
2. `screen_off=1`: DECON stops sending frames while dark.
3. `screen_off=2`: the panel goes to sleep (display off, sleep in, reset)
and wakes through the panel driver's cold init (reset, Google's init at
60 Hz, TE2, DSC). **That cold init has never run before this step.**

Announce each step before running it. On a pass of `screen_off=2`,
device-panther ships `options gs_decon screen_off=2`, and the bring-up file
goes.

**Stop if:**
- the screen stays dark after DPMS on;
- the picture is scrambled after the cold init, which would point to the
DSC or PPS;
- a DSIM timeout.

**Rollback:** `screen_off=0` (written at runtime) avoids the panel sleep. A
reboot restores ABL's state.

### D4. 90 Hz (medium risk)

Expand Down Expand Up @@ -210,3 +307,82 @@ installed:
- On a later boot, `ls /etc/modprobe.d` listed only `hid_apple.conf` (no
hand-made `omamobile-display.conf` hiding the package's file), and
`allow_tx` read `Y`.

### 2026-11-01: D3

**D3a, stage 0.** Kernel `7.3.0-rc6-omamobile-push1-gdc3f0ce5e425` (D1
plus the D3 branch without the padded-row commit, which came out of
D3c), flashed after its modules with
the bring-up file at `stage=0`:
- **0.1.4 at boot:** `allow_tx` read Y with no hand-written option, and the
slider worked.
- **gs-dsim-cmd** logged "link timers for 60 Hz".
- **gs-decon bound** (so the 1080x2400 mode set matched) and logged
GLOBAL_CON 0x133 (command mode), TRIG_CON 0x3061 (TE trigger on),
RDMA_IMG_SIZE and SRC_SIZE 0x09600438 (1080x2400), and DPP0 at
0xfac00000.
- simpledrm kept `card0`, and the screen was unchanged.

**D3b, stage 1.** After `rmmod gs_decon; modprobe gs_decon stage=1`: 601
frame starts and 601 frame dones in 10.0 s, **60.02 Hz**, with no storm. MIF
was at 2028 MHz and DISP at 400 MHz. The screen was unchanged.

**D3c, stage 2, first try.** The bring-up file was set to `stage=2
screen_off=0`, then a reboot:
- gs-decon took the screen over: simpledrm went, `card2` is gs-decon, and
it reported "flip-only KMS on DECON0, 1080x2400, up to 60 Hz".
- **Every Hyprland modeset failed with -EINVAL**, and the screen froze on
the boot console's last line. DRM's debugfs showed why: Hyprland's
framebuffers had a pitch of 4352 (1080 pixels padded to 64 bytes), where
gs201's plane check took only the boot pitch, 4320. The Pixel 7 Pro's
1440-pixel rows (5760 bytes) need no padding.
- **Fix:** gs-decon's fifth commit lets gs201 take padded rows, as G4 does.
DPP0's source width is the row length in pixels, and on gs201 the
source height shares that register.

**D3c, stage 2, with the fix.** Kernel
`7.3.0-rc6-omamobile-push1-g53fab72d1489` (all five commits), flashed after its modules:
- Hyprland's modesets all passed, and `hyprctl monitors` showed
1080x2400@60.00000.
- **The desktop showed, and it was smooth.** In the first ~37 s there were
162 flips with no timeouts and no late flips, and flip latency averaged
12.2 ms (16.5 ms at most). Frame start ran at 59.96 Hz.
- 10 minutes later: 2624 flips, still no timeouts (8.9 ms on average).

**D3d, screen off,** with Hyprland's DPMS dispatcher, each step seen on the
phone:

| `screen_off` | While off | After DPMS on |
| --- | --- | --- |
| 0 | black frames (frames still counted) | desktop back |
| 1 | no frames (frame_start unchanged over 3 s), trigger masked | desktop back |
| 2 | no frames, trigger masked, **panel asleep** | **panel cold init**, desktop back with the picture correct |

With `screen_off=2`, the power key's lock turned the screen off, a tap woke
it, and the PIN could be entered. There were no DSIM timeouts, no "cold
init failed" and no gs-decon errors (`dmesg` was cleared before the
`screen_off=2` step).

**The package with no bring-up file.** device-panther, built as 0.1.5 (it
ships as 0.1.7, after 0.1.6's AVB footers), was installed on the phone, the bring-up file deleted, and the phone rebooted on the same
kernel. After the reboot:
- `allow_tx`, `stage` and `screen_off` read Y, 2 and 2 from the package
alone, and gs-decon owned the screen.
- Hyprland ran at 1080x2400@60 (163 flips, no timeouts, frames at
59.99 Hz), and the desktop was smooth.
- The slider worked. The power key's lock turned the screen off, a tap
turned it on, and the PIN could be entered.
### 2026-11-03: D3 on a second Pixel 7

angelrenefm's unit (issue #342: stock factory unit, `CP3A.261005.002.A1` on both slots), kernel `7.3.0-rc6-omamobile-push1-g0a132eb92793` (linux-omarchy-mobile#181's head), flashed with omarchy-mobile#396's AVB footers. Results from [linux-omarchy-mobile#181](https://github.com/derekross/linux-omarchy-mobile/pull/181):

| Step | Result |
| --- | --- |
| D3a, stage 0 | pass: "link timers for 60 Hz"; DECON0 and DPP0 as ABL left them (1080x2400, RDMA 0xfac00000, TRIG_CON 0x3061); the panel taken over from the bootloader; simpledrm kept `card0`; `allow_tx` Y; no errors |
| D3b, stage 1 | pass: 601 frame starts and 601 frame dones in 10.01 s (60.1 Hz), no storm |
| D3c, stage 2 | pass: gs-decon on `card2`, simpledrm gone, Hyprland at 1080x2400@60. Over 10 minutes: 871 flips, no timeouts and no late flips, latency 9.0 ms on average (16.7 ms at most). No stripes or tearing |
| D3d, `screen_off` at runtime, DPMS through `hl.dsp.dpms` | 0: frames keep counting while dark. 1: frame start frozen, trigger masked. 2: `panel_asleep` 1 and the panel's TE count frozen while dark; after DPMS on, TE back at 60 Hz. Each time the desktop came back. `screen_off=2` six times out of six, with no DSIM timeouts, no "cold init failed" and nothing in `dmesg` |
| Boot with `stage=2 screen_off=2` from the bring-up file | gs-decon at 60.12 Hz, Hyprland up, no flip timeouts |

Not checked there: the picture right after the runtime cold inits (that run measured over SSH: counters and `dmesg`).

Loading