Skip to content

RK3576: Enable USB-C DisplayPort Alt Mode output#2676

Merged
sydarn merged 1 commit into
ROCKNIX:nextfrom
pgratz1:pr/rk3576-dp-kernel
May 9, 2026
Merged

RK3576: Enable USB-C DisplayPort Alt Mode output#2676
sydarn merged 1 commit into
ROCKNIX:nextfrom
pgratz1:pr/rk3576-dp-kernel

Conversation

@pgratz1
Copy link
Copy Markdown
Contributor

@pgratz1 pgratz1 commented May 9, 2026

Summary

  • Add three kernel patches enabling DP Alt Mode on RK3576 via the DesignWare DP controller:
    • 0015: Fix RK3576 VOP2 VP2 — promote Esmart0 to PRIMARY plane and clear the VP2 pixel-clock divider for DP output
    • 0016: Add RK3576 to the dw-dp driver OF match table, make i2s/spdif clocks optional, and add single-pixel input mode for VP2
    • 0017: Add the DP controller node (dp@27e40000) to the RK3576 base DTSI
  • Enable CONFIG_ROCKCHIP_DW_DP and CONFIG_TYPEC_DP_ALTMODE in the RK3576 kernel config
  • Wire VP2 → DP0 output path in the RG Vita Pro device tree

Tested on ANBERNIC RG Vita Pro with VITURE Pro XR glasses at 1920×1080@60 Hz via USB-C.

This is a split of #2647 containing only the kernel/DTS portion, per reviewer request. Userspace display-switching scripts (dp_monitor, sway config) will follow in a separate PR once these patches are merged.

Test plan

  • Build RK3576 image from this branch
  • Flash to ANBERNIC RG Vita Pro
  • Connect VITURE Pro XR glasses via USB-C — confirm DP-1 output initialises in sway at 1920×1080@60 Hz
  • Disconnect glasses — confirm device continues to function normally on DSI-1

🤖 Generated with Claude Code

Kernel patches, device tree, and kconfig changes to enable DP Alt Mode
video output through the USB-C port on RK3576 devices. Tested on
ANBERNIC RG Vita Pro with VITURE Pro XR glasses at 1920x1080@60Hz.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pgratz1
Copy link
Copy Markdown
Contributor Author

pgratz1 commented May 9, 2026

Tested on ANBERNIC RG Vita Pro with VITURE Pro XR glasses. The kernel patches are working — /sys/class/drm/card0-DP-1/status reports connected when the glasses are plugged in via USB-C. Sway can successfully output to DP-1 once directed there manually:

swaymsg output DP-1 enable
swaymsg "workspace 1 output DP-1 DSI-1"
swaymsg focus output DP-1 && foot &

After those commands a foot terminal appeared on the glasses at the correct resolution. Without them, sway routes nothing to DP-1 on its own — the automatic workspace routing and display-switching logic (dp_monitor) will follow in a separate PR.

@sydarn
Copy link
Copy Markdown
Contributor

sydarn commented May 9, 2026

LGTM let's merge this :)

If this doesn't work at boot I would guess that's a bug in the 111-sway-init script. It's supposed to prioritize HDMI and DP if connected. Logic starting here:

card_no=$(ls /sys/class/drm/ | grep -E "DP|HDMI|DSI" | head -n 1 | cut -b 5)

@sydarn sydarn merged commit 70419e6 into ROCKNIX:next May 9, 2026
2 checks passed
pgratz1 added a commit to pgratz1/distribution that referenced this pull request May 9, 2026
When AR glasses or an external monitor connect via USB-C DP Alt Mode,
automatically power the internal DSI-1 panel off and restore it on
disconnect. dp_monitor subscribes to sway IPC output events because
the RK3576 DP driver does not emit DRM hotplug uevents.

Depends on: ROCKNIX#2676 (kernel patches enabling CONFIG_ROCKCHIP_DW_DP and
CONFIG_TYPEC_DP_ALTMODE)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pgratz1 added a commit to pgratz1/distribution that referenced this pull request May 17, 2026
When AR glasses or an external monitor connect via USB-C DP Alt Mode,
automatically power the internal DSI-1 panel off and restore it on
disconnect. dp_monitor subscribes to sway IPC output events because
the RK3576 DP driver does not emit DRM hotplug uevents.

Depends on: ROCKNIX#2676 (kernel patches enabling CONFIG_ROCKCHIP_DW_DP and
CONFIG_TYPEC_DP_ALTMODE)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pgratz1 added a commit to pgratz1/distribution that referenced this pull request May 24, 2026
When AR glasses or an external monitor connect via USB-C DP Alt Mode,
automatically power the internal DSI-1 panel off and restore it on
disconnect. dp_monitor subscribes to sway IPC output events because
the RK3576 DP driver does not emit DRM hotplug uevents.

Depends on: ROCKNIX#2676 (kernel patches enabling CONFIG_ROCKCHIP_DW_DP and
CONFIG_TYPEC_DP_ALTMODE)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.

2 participants