Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save gornostal/ec270bf2d5a4380ed556c4a6011df149 to your computer and use it in GitHub Desktop.

Select an option

Save gornostal/ec270bf2d5a4380ed556c4a6011df149 to your computer and use it in GitHub Desktop.
USB-C Monitor Hotplug Detection Fix for Linux on Intel Arrow Lake-P

USB-C Monitor Hotplug Detection Fix for Linux on Arrow Lake-P

Problem Description

External monitor connected via USB-C to HDMI cable is not detected on hotplug in Elementary OS. The monitor only appears after a full system reboot. The same cable and monitor work perfectly on another laptop running Ubuntu, confirming the hardware is functional.

System Configuration

  • OS: Elementary OS 8 (based on Ubuntu 24.04)
  • Kernel: 6.14.0-34-generic
  • Display Server: Wayland with Xwayland
  • GPU: Intel Arrow Lake-P [Intel Graphics]
  • Graphics Driver: i915 (kernel module)
  • USB-C Controller: UCSI (USB Type-C Connector System Software Interface)

Root Cause Analysis

The issue stems from a failure in DisplayPort Alternate Mode negotiation on hotplug events:

  1. USB-C Alternate Mode Not Registering: When the monitor is hot-plugged, the UCSI firmware does not properly trigger DisplayPort alternate mode negotiation between the USB-C controller and the GPU.

  2. Intel Arrow Lake-P Hardware: This is very new hardware (late 2024) with potentially incomplete kernel support in the 6.14 kernel series.

  3. Driver State Issue: The i915 graphics driver and ucsi_acpi USB-C driver fail to communicate display capability changes without a full system initialization.

Diagnostic Evidence

# USB-C ports detected but no alternate modes registered
$ cat /sys/class/typec/port*/number_of_alternate_modes
0

# All display connectors show disconnected despite cable being plugged in
$ cat /sys/class/drm/card1-*/status
disconnected  # DP-1
disconnected  # DP-2
connected     # eDP-1 (internal display)
disconnected  # HDMI-A-1

Solution

Quick Fix Script

Create a script that forces the USB-C and graphics drivers to re-negotiate display connections:

#!/bin/bash
# Force USB-C monitor detection workaround
# Run this after connecting your USB-C monitor

echo "Reloading USB-C drivers..."
sudo modprobe -r ucsi_acpi typec_ucsi 2>/dev/null
sudo modprobe ucsi_acpi typec_ucsi
sleep 2

echo "Forcing DRM connector detection..."
for conn in /sys/class/drm/card*/card*/status; do
    echo detect | sudo tee "$conn" > /dev/null 2>&1
done
sleep 1

echo "Refreshing display configuration..."
xrandr --auto

echo -e "\nCurrent displays:"
xrandr | grep connected

Save this as ~/usbc-monitor-detect and make it executable:

chmod +x ~/usbc-monitor-detect

Usage

After connecting your USB-C monitor, simply run:

sudo ~/usbc-monitor-detect

The script will:

  1. Reload the USB-C drivers to re-trigger alternate mode negotiation
  2. Force the graphics driver to re-scan all display connectors
  3. Automatically configure detected displays

Why This Works

The script forces a full re-initialization of the USB-C subsystem:

  1. Unloading ucsi_acpi and typec_ucsi: Clears the USB-C controller state
  2. Reloading the modules: Forces re-enumeration of USB-C capabilities and alternate modes
  3. Writing "detect" to DRM status: Triggers the graphics driver to actively probe all connectors
  4. xrandr --auto: Forces X11/Wayland to reconfigure displays

This simulates what happens during boot, when all drivers properly negotiate capabilities in the correct order.

Future Outlook

This issue should be resolved in future kernel updates as Intel Arrow Lake-P support matures. Monitor these areas:

  • Kernel 6.15+ with improved Arrow Lake support
  • Updated UCSI firmware/drivers
  • Intel graphics driver improvements

Tags

elementary-os usb-c monitor hotplug displayport hdmi external-monitor not-detected intel-graphics arrow-lake i915 ucsi ubuntu linux wayland xorg display-detection kernel-module type-c alternate-mode dp-alt-mode lenovo-ideapad elementary-os-8 ubuntu-24.04 kernel-6.14 intel-gpu graphics-driver display-driver drm kms modprobe xrandr usb-c-to-hdmi monitor-not-detected external-display second-monitor dual-monitor linux-troubleshooting driver-issue hardware-compatibility

@gornostal
Copy link
Author

Fix generated with copilot agent & Sonnet 4.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment