fix: panel-cwu50 timing fix from Rex's kernel — native 720x1280 mode #73

Open
Hermes wants to merge 1 commits from fix/uconsole-cm5-panel-timing into master
Collaborator

Problem

Horizontal pixel repetition on the uConsole CM5 display — each row shows 5 repeated pixels. Confirmed on nixos-uconsole v1.1.0.

Root Cause

The panel-cwu50.c driver sets the DRM display mode to 1280×720 (the rotated landscape resolution) instead of the panel's native 720×1280 (portrait). In DRM/KMS, rotation is handled by the connector's panel orientation property — the mode must always use the panel's native orientation.

Setting H=1280 causes the RP1 DSI controller to transmit 1280 pixels per horizontal line to a panel that expects 720. The extra pixels overflow the line buffer and wrap around, repeating earlier pixels — exactly the reported symptom.

Fix

Taken from ak-rex/ClockworkPi-linux rpi-6.12.y branch — Rex's kernel has a working display on this hardware.

  1. Swap display mode timings: H=720, V=1280 (native) instead of H=1280, V=720 (rotated)
  2. Add DCS panel detection: After SLPOUT in init_sequence2, read register 0x04 to detect panel revision (supplements GPIO-based detection)

Testing

Deploy via nixos-rebuild, then visually confirm display shows correct content without horizontal repetition. Reboot and check dmesg for panel detection message.

## Problem Horizontal pixel repetition on the uConsole CM5 display — each row shows 5 repeated pixels. Confirmed on nixos-uconsole v1.1.0. ## Root Cause The `panel-cwu50.c` driver sets the DRM display mode to 1280×720 (the rotated landscape resolution) instead of the panel's native 720×1280 (portrait). In DRM/KMS, rotation is handled by the connector's panel orientation property — the mode must always use the panel's native orientation. Setting H=1280 causes the RP1 DSI controller to transmit 1280 pixels per horizontal line to a panel that expects 720. The extra pixels overflow the line buffer and wrap around, repeating earlier pixels — exactly the reported symptom. ## Fix Taken from **ak-rex/ClockworkPi-linux** rpi-6.12.y branch — Rex's kernel has a working display on this hardware. 1. **Swap display mode timings**: H=720, V=1280 (native) instead of H=1280, V=720 (rotated) 2. **Add DCS panel detection**: After SLPOUT in init_sequence2, read register 0x04 to detect panel revision (supplements GPIO-based detection) ## Testing Deploy via nixos-rebuild, then visually confirm display shows correct content without horizontal repetition. Reboot and check dmesg for panel detection message.
Hermes added 1 commit 2026-06-14 00:19:39 +00:00
Swap H/V display mode to native panel resolution (720x1280) instead of
rotated (1280x720). The DRM/KMS pipeline handles rotation via connector
orientation property. Setting wrong horizontal resolution caused DSI
controller to send extra pixels per line, resulting in horizontal
repetition.

Add DCS-based panel detection in init_sequence2 as supplemental check.

Based on ak-rex/ClockworkPi-linux rpi-6.12.y branch panel-cwu50.c.

Replaces old 0008 patches (DSI_INIT0, BURST removal) that didn't fix
the issue.
This pull request has changes conflicting with the target branch.
  • flake.nix
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/uconsole-cm5-panel-timing:fix/uconsole-cm5-panel-timing
git checkout fix/uconsole-cm5-panel-timing
Sign in to join this conversation.
No description provided.