Solved drm-kmod oddity

I don't know if I should mark this as solved, because it's working, but I didn't get it working the way I expected.
I have a T495 Thinkpad, and X stopped working. I tried unistalling and reinstalling drm-kmod, building it from a port (which was suspiciously quick) and so on.
It also no longer loaded the module and I had to comment out the kld_list entry in rc.conf to boot.

Then things got worse. I could no longer boot the system, as it would hang on acpi0. Single user, trying to boot with an older kernel, trying to boot with an older version didn't work. Searching the forums, I saw SirDice recommended that someone with a similar problem be sure they had the latest bios/uefi, and I did that, which fixed the hanging on boot issue with acpi.
But still no X. Tried installing xf86-video-vesa and still not working. So once again, I uninstalled drm-kmod and this time, built, from ports, drm-fbsd13-kmod. And it fixed things. I had thought that drm-kmod would provide all that is provided by the fbsd13 port, but, for whatever reason, only drm-fbsd13-kmod got X working again. I'm not sure why, but I'm just throwing this out here in case it helps someone. I know one friend on these forums has the same laptop, so it might help them.

Lastly, it might be worth mention that this laptop multiboots with some Linux systems, and when I went to upgrade, rather than downloading something from Lenovo and burning to USB, I was able to use Linux's fwupd program to apply firmware updates. It certainly is easier and achieved the desired update.
 
Interesting. Especially the "drm-kmod finished quickly".
Looking at the drm-kmod makefile, this is interesting:
.if ${OSVERSION} < 1300000 RUN_DEPENDS= ${KMODDIR}/drm.ko:graphics/drm-fbsd12.0-kmod .elif ${OSVERSION} >= 1300000 && ${OSVERSION} < 1300136 IGNORE= not supported on older 13, no kernel support .elif ${OSVERSION} >= 1300136 && ${OSVERSION} < 1400000 RUN_DEPENDS= ${KMODDIR}/drm.ko:graphics/drm-fbsd13-kmod .elif ${OSVERSION} >= 1400000 RUN_DEPENDS= ${KMODDIR}/drm.ko:graphics/drm-510-kmod
What version is your system? Perhaps it's falling into a not supported category.
 
drm-kmod is 'meta' port. For t495 you need to rebuild 'graphics/drm-XXX-kmod' and `graphics/gpu-firmware-kmod`. Also kld_list= in /etc/rc.conf must contain 'amdgpu'.
 
Ahhh. That explains it. I forgot to mention--I wound up staying up late playing with this---that I did, before doing drm-fbsd13-kmod I also install the gpu-firmware-kmod, though I think I did that with pkg. Thanks, now I understand why, trying to install drm-kmod from ports had no effect. I didn't know if I should use the drm-54 or drm-510 which is why I chose drm-fsd13. Turns out the drm-fbsd is is using 5.4.191.g20220604 and drm-54 shows version 5.4.191. I guess, to get the port to build, that would drm-54 would have also worked. (And maybe drm-510 too.)
Anyway, Ole answered my question, to the point where I will mark it solved.
 
drm-kmod is 'meta' port.
And as such, it depends on the correct port for your FreeBSD version, so just building drm-kmod will work. That is, unless the specific port it depends on is already installed of course ;)

Note the requirement to build yourself is a special case and only ever necessary as long as two FreeBSD versions of the same major version are supported and you're already using the newer one. That's because there's only one set of packages for each major version (and the official builders build on the older minor version until it's EOL). The ABI doesn't change, so this works fine, except sometimes for packages/ports containing kernel modules, because inside the kernel, things might change...
 
Back
Top