Bug 237127

Summary: graphics/drm-legacy-kmod: g20190213 loads wrong drm2.ko
Product: Ports & Packages Reporter: Trev <fbsdbugs4>
Component: Individual Port(s)Assignee: freebsd-x11 (Nobody) <x11>
Status: Closed Not A Bug    
Severity: Affects Some People CC: dereks, x11, zeising
Priority: --- Flags: tobik: maintainer-feedback? (x11)
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://github.com/FreeBSDDesktop/drm-legacy/issues/7

Description Trev 2019-04-08 23:47:50 UTC
System: FreeBSD tiger 12.0-STABLE FreeBSD 12.0-STABLE r345906 GENERIC  i386
Apple Mac Mini 2,1

After installing drm-legacy-kmod-g20190213 for the system's Intel Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller, on boot I kept receiving the following warnings:

Apr  8 22:10:35 tiger kernel: drmn0: =======================================================
Apr  8 22:10:35 tiger kernel: drmn0: This code is obsolete abandonware. Install the graphics/drm-legacy-kmod pkg
Apr  8 22:10:35 tiger kernel: drmn0: =======================================================
Apr  8 22:10:35 tiger kernel: drmn0: Deprecated code (to be removed in FreeBSD 13): drm2 drivers
Apr  8 22:10:35 tiger kernel: drmn0: =======================================================
Apr  8 22:10:35 tiger kernel: drmn0: This code is obsolete abandonware. Install the graphics/drm-legacy-kmod pkg
Apr  8 22:10:35 tiger kernel: drmn0: =======================================================
Apr  8 22:10:35 tiger kernel: drmn0: Deprecated code (to be removed in FreeBSD 13): drm2 driver

which was to say the least a little confusing because I had just installed graphics/drm-legacy-kmod.

Long story short: The system is loading the base /boot/kernel/drm2.ko module and doing this despite the fact that I had edited /etc/rc.conf to include:

# Intel Graphics
kld_list="/boot/modules/drm2.ko"
kld_list="/boot/modules/i915kms.ko"

and had installed graphics/drm-legacy-kmod.

The solution was to rename the base drm2.ko module so it could not be found/loaded and then the port drm2.ko module is loaded and the warnings go away and, with the Daemon now happy, hopefully the system will continue to run when FreeBSD-13.0 is released :)
Comment 1 Derek Schrock 2019-04-26 00:43:24 UTC
Your kld_list value in rc.conf should be a space separated list of kernel models not multiple kld_list= lines.

kld_list="/boot/modules/drm2.ko /boot/modules/i915kms.ko"

Loads /boot/modules' drm2.ko then i915kms.ko.


Maybe the pkg-message file of the port should be updated to include /boot/modules/drm2.ko?
Comment 2 Tobias Kortkamp freebsd_committer freebsd_triage 2019-08-30 11:41:26 UTC
Triage: Fix bug title and assign to the right team.
Comment 3 Niclas Zeising freebsd_committer freebsd_triage 2019-08-30 13:00:47 UTC
See also: https://github.com/FreeBSDDesktop/drm-legacy/issues/7
Comment 4 Niclas Zeising freebsd_committer freebsd_triage 2020-07-11 20:01:41 UTC
This is an issue with how the loader looks at things and load things, and is not possible to change from the driver.  To be sure to load the correct drm2.ko, add /boot/modules/drm2.ko to the kld_list in rc.conf.