Linux – Force monitor detection, low level

displaylinux-mintmonitors

My external monitor (dell) is not detected on my Asus Laptop if I switch it on only after I booted the laptop.

The case similar to How to make linux detect/re-probe monitors with intel i915 driver?, except that in my case, once it is known to the laptop, I can unplug and plug it in again and get it detected.

Only when the external monitor is off during boot, I cannot get detected.

The solution with echo detect > /sys/class/drm/card0-DP-1/status, does not work, because the relevant directory would be card0-DP-2, which simply does not exist after booting while the monitor is off.

Other solutions like CTRL-ALT-F1 and back similarly don't work.

Unplugging the cable and plugging in again has no effect either. It feels a bit as if the whole displayport plug of the laptop is simply off completely.

Strange finding: if the displayport cable is not connected during boot, then the monitor is detected when I switch it on and connect the cable after booting (:-( So it seems the combination "cable connected/monitor off during boot" is interpreted as "don't bother with this hardware anymore".

Is there some command telling the system to reconsider the question whether something is connected to the display port?

Best Answer

This doesn't quite answer your question per se, but is arguably a technically correct answer, so I'm taking advantage of the nicer formatting afforded to answers so this isn't 30 wall-of-text comments.

You aren't likely to get an answer on SO/SE, because there simply isn't enough domain-specific knowledge present. You're far better off talking straight to the i915 kernel driver developers.

https://01.org/linuxgraphics/documentation/how-report-bugs contains very comprehensive instructions on how to do so in an organized way.

The way you've worded your bugreport implies that /sys/class/drm/card0-DP-2/status does exist when you connect a DisplayPort cable after boot, but doesn't when a cable and no screen is connected. Well, anything involving /sys/* is definitely not X11-related, and the drm in the path absolutely confirms that you want to follow the 1.1 - DRM Kernel section from the above link.

I've had a look at the details requested by that section and am reasonably confident that the impossible-to-understand bits are not actually needed. This being said, kernel and distro info, full dmesg after rebooting with drm.debug=0xe, etc are all very good ideas.

As is somewhat obvious, two dmesgs would logically be appropriate here; one from a boot without the connector present, and another with. It may be very useful to annotate the exact or approximate point you actually plug the connector in.

5 minutes' thought came up with a suitably hacky-but-successful way to easily annotate:

script -c 'dmesg -w | cat' dmesg.txt

will run dmesg -w and also allow you to type lines of text directly into the terminal to add annotations, and you can ^C when you're done collecting dmesg info. (dmesg -w | cat is shorter than dmesg -w --color=never.)

One possibly-unlikely thing, just in case: has this ever worked? If yes, do you remember what time? If yes, try installing old versions of the distributions you used at those points, and if they work, collect the kernel versions!

Also... you may not want to hear this, but as always one cannot be 100% sure if begrudgingly getting the latest kernel version working doesn't magically fix everything. :)

Thankfully, this is much less fearful than you might fear: https://cgit.freedesktop.org/drm-tip/ is an entire clone of the Linux kernel with the drm tip-of-tree patches already folded in. As best as I can tell, just clone and build this and you should be ready to go.

...That being said, as a matter of cautiousness, you may want to download the latest kernel release and get that known-working first, and then copy the .config over to the drm-tip tree. If you don't do this first, and everything explodes sideways, verifying you can build and boot a mainline kernel may be a good first fire-squashing sanity-check.

Here's the bugzilla page you'll want: https://bugs.freedesktop.org/enter_bug.cgi?product=DRI

Actually, that will almost certainly show you a login view; in that case you'll want this URL first: https://bugs.freedesktop.org/createaccount.cgi

Finally, if you want to ask questions, https://01.org/linuxgraphics/community/kernel mentions #gfx-intel on freenode.

FWIW, what I've described above is an ideal set of steps. You might open a provisional bug on freedesktop.org before eg going and doing a kernel rebuild to find out if there aren't some other debugging steps you can try. (The bug entry page only lists "drm git" in the version section, though, so they really want you using the git version... heh)

I actually do have a good question for the IRC channel - I listed the drm-tip git repo because that's the one the documentation mentions, but there's also an drm-intel repo, and I don't know what its relevance is. It also looks like a kernel tree, and is being updated every few minutes too.

Related Question