This is an ugly hack to get devmatch to match drm graphics drivers built out of tree. To make this work I had to work around the following issues
Problem 1: devmatch only uses the first linker.hints it can find.
Fix: With this patch, devmatch now iterates through all paths found in kern.module_path and parses the linker.hints it finds.
Problem 2: devmatch can't match anything on the vgapci bus since there is already a driver attached.
Fix: Ignore "vgapci" and use "pci" and not "vgapci" bus in MODULE_PNP_INFO
I'm not sure of the correct way to solve these issues so I leave that to the developer(s) of devmatch.
Another issue of course is if there the same module is located in for example /boot/kernel and /boot/modules. May I suggest priority order as in listed kern.module_path, except for letting /boot/kernel have the lowest priority (currently it is inserted before any paths set in loader.conf)?
The patch to linuxkpi and i915 driver is here: (WIP for reference)
https://github.com/FreeBSDDesktop/kms-drm/commit/9a0b7d0cebc2f6acf4f05ba6ae4b0a191a16afee