How to make linux detect/re-probe monitors with intel i915 driver?

8,101

This isn't the xrandr-approach the I know works in X, but for console you can try this — you can write to that /sys/class/drm/card0-DP-1/status file as well. I couldn't find proper documentation, but thankfully Linux is open source. Reviewing the source code, it looks like it takes a few values: detect, on, on-digital, and off.

So echo detect > /sys/class/drm/card0-DP-1/status should force a re-check for a monitor. Or echo on-digital > /sys/class/drm/card0-DP-1/status might manage to turn it on, regardless of what the detection thinks.

edit: Under X, I've used this to deal with HDMI that did not detect being plugged it — it'll force-enable the output. But unfortunately video only, HDMI audio won't work (and apparently isn't possible without a kernel patch):

xrandr --newmode "Mode 2" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
xrandr --addmode HDMI-1 "Mode 2"
xrandr --output HDMI-1 --mode "Mode 2" --right-of LVDS-1

All those numbers specify the video timings; normally it's auto-detected, the easiest way to get them is to grab the mode it's using when you've booted with it so it's working (xrandr --verbose will show them).

Share:
8,101

Related videos on Youtube

jorsn
Author by

jorsn

Updated on September 18, 2022

Comments

  • jorsn
    jorsn over 1 year

    I have a laptop running linux with nvidia optimus/intel hybrid graphics where all outputs are connected to the intel card. It is driven by the i915 driver.

    An external monitor or beamer is discovered only one time a boot cycle: If I disable or unplug it (and then plug it again), it cannot be enabled again, because the linux kernel does not detect it anymore: There are no udev or acpi events on plug/unplug and the sysfs, in my case /sys/class/drm/card0-DP-1/status, indicates that the output is disconnected. After a reboot the display is detected again, and again exactly one time. Suspending/hibernating and resuming suffice as well, but only if the output is uplugged while rebooting.

    I think this is somehow related to the kernel probing/reprobing for output devices on boot. Can the kernel be somehow induced to re-probe for monitors, and thus to hopefully detect them again?

    • derobert
      derobert about 6 years
      Is this under X? Just running xrandr (without --current) might be enough... Otherwise, I have an incantation to force-enable an output, but it's on a laptop at home.
    • jorsn
      jorsn about 6 years
      This is in TTY as well, only worse: reenabling of TTY output on an external display seems randomly. But X should not have anything to do with the detection of the output as the kernel does not even detect it. @derobert: I would be grateful for the incantation!
    • derobert
      derobert about 6 years
      I added the xrandr stuff, no idea if it is of any use.
  • jorsn
    jorsn about 6 years
    Force-enabling the monitor via sysfs/on worked, however, auto-detection (detect) did not. Thank you for the xrandr stuff, even if the modes were no problem as they were detected correctly after force-enabling. And thank you very much for the kernel-related part of the answer!