Skip to content

Use upstream drivers for Waveshare DSI panels - #7782

Open
popcornmix wants to merge 6 commits into
raspberrypi:rpi-7.4.yfrom
popcornmix:waveshare-upstream
Open

popcornmix wants to merge 6 commits into
raspberrypi:rpi-7.4.yfrom
popcornmix:waveshare-upstream

Conversation

@popcornmix

Copy link
Copy Markdown
Collaborator

Upstream now supports most Waveshare DSI panels: the DSI TOUCH panels in the jadard-jd9365da-h3, himax-hx8394, himax-hx83102, focaltech-ota7290b and ilitek-ili9881c drivers, the panel controller in gpio-waveshare-dsi, and the DSI-to-DPI/LVDS kits with the waveshare-dsi bridge plus panel-simple. This switches the two Waveshare overlays to those drivers and keeps the downstream drivers only for panels upstream lacks. It also fixes waveshare,7.0-dsi-touch-a, which both ili9881c and the downstream v2 driver matched.

The overlay parameters are unchanged.

vc4-kms-dsi-waveshare-panel-v2

  • Upstream drivers: 3.4" C, 4.0" C, 5.0" A, 5.5" A, 7.0" A, 8.0" A, 8.8" A, 9.0" B, 10.1" A, 10.1" B and 12.3" A, including the 4-lane options. The lane count is now set with data-lanes on the DSI endpoint.
  • Still downstream: 4.0" A, 4.3" A, 5.0" A v2, 5.0" B, 6.25" A, 7.0" B, 7.0" C, 10.1" E.
  • The controller at 0x45 now uses upstream gpio-waveshare-dsi, with fixed regulators for VCC, IOVCC and AVDD, so the downstream regulator driver is reverted. The downstream panel driver now takes AVDD and IOVCC as supplies.
  • hx8394 gets the vendor display-on sequence for the 5.0" A panel; upstream left out a command and some waits.

vc4-kms-dsi-waveshare-panel

  • Upstream bridge (waveshare,dsi2dpi or dsi2lvds) plus panel-simple: 2.8", 3.4", 4.0", 4.0" C, 5.0", 6.25", 7.0" C, 7.0" H, 7.9", 8.0", 8.8", 10.1", 11.9", 13.3" 4-lane.
  • Still downstream: 6.25" B, 10.1" E (2 and 4 lane), 13.3" 2-lane.

User-visible changes

  • The v1 kits that moved upstream report an LVDS or DPI connector, so the output is LVDS-1/DPI-1 instead of DSI-1. Anything that names the output (video=, desktop screen layouts) needs updating.
  • Some v2 panels get upstream's slightly different timings, e.g. 5.0" A at 66.1 Hz instead of 65.3 Hz.
  • v1 panels report their real physical size instead of a fixed 154x86 mm.
  • The upstream drivers don't power the panel off at shutdown.

Testing

  • Build-tested with bcm2712_defconfig.
  • Both overlays applied with dtmerge for a range of parameters on Pi 4 and Pi 5 DTBs, and the resulting nodes and links checked.
  • Not tested on any panel. It needs someone with the hardware. One panel per driver would be a good start: 10.1" A at 2 and 4 lanes, 5.0" A, 7.0" A, 8.8" A, 12.3" A, 7.0" C, plus v1 10.1", 7.0" C and 10.1" E.

The two fixup commits trim the downstream panel drivers and will squash into "drm/panel: Add panel driver for Waveshare DSI touchscreens" at the next rebase.

panel-waveshare-dsi-v2: Drop the panels now handled by upstream drivers
(jadard-jd9365da-h3, himax-hx8394, himax-hx83102, focaltech-ota7290b and
ilitek-ili9881c). Upstream picks the lane count from DT, so the -4lane
variants go too.

The Waveshare controller is now driven by the upstream
gpio-waveshare-dsi driver, with avdd and iovcc as fixed regulators, so take
those as supplies rather than GPIOs. Use reset-gpios with the active-low
convention of the upstream panel drivers, as the panel node is shared.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
panel-waveshare-dsi: Drop the panels handled upstream by the
waveshare,dsi2dpi/dsi2lvds bridge and panel-simple. Keep 6.25inch-b,
10.1inch-e (2 and 4 lane) and 13.3inch 2 lane, which upstream lacks.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
…hare 5.0" A

The Waveshare driver for the 5.0" A panel waits 200ms after leaving sleep,
writes SETDISP again with its full 12 byte payload, turns the display on and
then waits a further 80ms. Allow a panel to supply its own display-on
sequence, and use the vendor one for this panel.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Enable the Waveshare DSI TOUCH GPIO controller, the Waveshare DSI bridge
and the jadard-jd9365da-h3, himax-hx8394, himax-hx83102 and
focaltech-ota7290b panels, and drop the downstream Waveshare regulator.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
vc4-kms-dsi-waveshare-panel-v2: drive the panel controller with the
upstream gpio-waveshare-dsi driver, with fixed regulators for VCC, IOVCC
and AVDD, and give the panel node the supplies and GPIOs that the upstream
panel drivers look up. The 4 lane variants now select the lane count with
data-lanes on the DSI endpoint.

vc4-kms-dsi-waveshare-panel: describe the adapter as the upstream
waveshare,dsi2dpi/dsi2lvds bridge followed by a panel-simple panel. The
6.25inch B, 10.1inch E and 13.3inch 2 lane panels still use the downstream
panel driver.

The overlay parameters are unchanged.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
…ries panels"

This reverts commit 762dbc5.

The upstream gpio-waveshare-dsi driver handles the same controller, and the
Waveshare overlays now use it.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
@popcornmix

Copy link
Copy Markdown
Collaborator Author

Some more detail on what changes and where it could go wrong. Everything here is from reading the code; none of it has been tested on a panel.

Other user-visible changes

  • Different kernel modules load: panel-jadard-jd9365da-h3, panel-himax-hx8394, panel-himax-hx83102, panel-focaltech-ota7290b, panel-ilitek-ili9881c, panel-simple, the bridge module (waveshare-dsi) and gpio-waveshare-dsi. waveshare-panel-regulator is gone. This only matters to anyone loading or blacklisting modules by hand.

  • Timing changes on the v2 panels, all taken from upstream:

    Panel Was Now
    3.4" C 44.3 MHz 44.352 MHz
    4.0" C 36.5 MHz 36.48 MHz
    8.0" A, 10.1" A hsync 30, htotal 890, 71 MHz hsync 20, htotal 880, ~70 MHz
    9.0" B, 10.1" B (4 lanes) 66 MHz 66.44 MHz
    9.0" B, 10.1" B (2 lanes) 69 MHz 69.01 MHz
    5.0" A hsync 30, htotal 810, 65.3 Hz hsync 20, htotal 800, 66.1 Hz
  • The v1 LVDS panels report an LVDS bus format (RGB888_1X7X4_SPWG) instead of RGB888.

Risks

  • Power-up and reset order
    • Every upstream v2 driver sequences power and reset differently from the Waveshare driver:
      • jadard pulses reset for 5, 10 and 130 ms.
      • hx8394 switches vcc on before iovcc, and sends its start-up commands at enable rather than prepare.
      • hx83102 drives the reset line as an enable signal.
    • The fixed regulators restore the downstream 20 ms gaps at power-on, but not those at power-off.
  • Shutdown
    • None of the upstream panel drivers powers the panel off at shutdown or remove.
    • The v1 bridge doesn't write the final 0xd2/0xad registers that downstream wrote at shutdown.
  • 13.3" 4-lane: upstream drives it with DSI flags HSE|VIDEO|NON_CONTINUOUS, where downstream used VIDEO|LPM. Upstream runs it this way on a Renesas board; it's untested on vc4.
  • 8.8" A
    • The ota7290b driver fails to probe unless vcc, avdd and vdd supplies are all present, but its binding names vdda and allows no others. That mismatch should be reported upstream.
    • The overlay maps them as vcc = IOVCC, vdd = the always-on VCC, and avdd = AVDD.
    • Downstream's pre-power-on behaviour is gone.
  • 12.3" A: hx83102 needs an avee supply that the controller doesn't switch separately, so the overlay points it at AVDD.
  • Controller probe: upstream gpio-waveshare-dsi reads the controller's ID registers without the 5 ms pause the downstream driver used, and fails to probe if the read fails.
  • Supply mapping: downstream only has the AVDD and IOVCC lines, so which line feeds which upstream supply name is my best guess for each driver. The mapping is in the overlay's panel node.

@pelwell

pelwell commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

FYI, @waveshare @EngineerWill.

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.

2 participants