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 dmesg
s 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.