Solved T430 and drm2 driver deprecation message

I'm running FreeBSD 12.1 on my Lenovo Thinkpad T430 w/Intel HD onboard driver, and I get the following messages at boot:

Code:
dmesg -a | grep drm

info: [drm] Initialized drm 1.1.0 20060810

drmn0: =======================================================

drmn0: This code is obsolete abandonware. Install the graphics/drm-legacy-kmod pkg
drmn0: =======================================================
drmn0: Deprecated code (to be removed in FreeBSD 13): drm2 drivers
drmn0: =======================================================

...

I gather this is because something I installed is being deprecated :)...

Configuring the T430 has been an ongoing effort since I first installed FreeBSD 10 on it, back in the day. At this point, here is my process of getting things working:

Code:
# move old drm.ko out of the way (just a precaution)
sudo mv /boot/kernel/drm.ko /boot/kernel/drm_old

# install drm-kmod
sudo pkg install drm-kmod

# add some tweaks to loader.conf (are these necessary or value-add?)
sudo vi /boot/loader.conf
drm.i915.semaphores=1
drm.i915.intel_iommu_enabled=1
drm.i915.enable_rc6=7

# add kernel module to rc.conf kld_list
/etc/rc.conf
kld_list="i915kms.ko"

Everything is "working", but what about those deprecation notices?
 
I gather this is because something I installed is being deprecated :)...
The DRM modules in the base system are deprecated, so it's something you installed (FreeBSD), but it isn't your fault ;)
They will be gone in FreeBSD 13, so there shouldn't be any more issues of this sort once you upgrade to it.
  • drm-kmod:
    Code:
    kld_list="/boot/modules/drm.ko /boot/modules/i915kms.ko"
  • drm-legacy-kmod:
    Code:
    kld_list="/boot/modules/drm2.ko /boot/modules/i915kms.ko"
As for your tweaks, I don't know what they do, and they're not listed by sysctl -a on my Haswell desktop system with drm-kmod installed. However, sysctl -a | grep i915 lists a lot of other things. You can format the setting names and their descriptions nicely if you want (portable sh syntax):
Code:
sysctl -a -d | grep i915 | sort | sed 's/: /\'"$(printf '\n\t')"/ | fmt

I haven't touched any of the settings listed by that command, so I can't tell you what to change.
 
Minor corrections:
  • drm[2].ko is pulled in automagically when i915kms.ko is loaded. So you can sysrc kld_list-=/boot/modules/drm2.ko. decuser, you're using the i915kms.ko module from base, but you should have sysrc kld_list-=i915kms.ko & sysrc+=" /boot/modules/i915kms.ko" from ports/pkg. For kernel modules from base, you can omit the .ko ending.
  • These sysctl knobs are obsolete, the new ones are compat.linuxkpi. On a T450, I have
    Code:
    # INTEL DRM WITH graphics/drm-kmod PACKAGE (NEW)
    compat.linuxkpi.i915_fastboot="1" # SKIP UNNECESSARY MODE SETS AT BOOT TIME
    compat.linuxkpi.enable_rc6="7" # ENABLE POWER SAVING RENDER C-STATE 6
    compat.linuxkpi.enable_dc="2" # ENABLE POWER SAVING DISPLAY C-STATES
    compat.linuxkpi.enable_fbc="1" # ENABLE FRAME BUFFER COMPRESSION FOR POWER SAVINGS
    compat.linuxkpi.semaphores="1" # USE SEMAPHORES FOR INTER RING SYNC
 
drm[2].ko is pulled in automagically when i915kms.ko is loaded. So you can sysrc kld_list-=/boot/modules/drm2.ko.
/boot/kernel/drm[2].ko is found automatically before /boot/modules/drm[2].ko. From the discussion in a drm-legacy-kmod bug report about this problem:
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?
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.
 
/boot/kernel/drm[2].ko is found automatically before /boot/modules/drm[2].ko. From the discussion in a drm-legacy-kmod bug report about this problem:
Seems that this has been fixed, the drm-kms(7) dependencies are fixed to include the correct path: lsmod -v|grep drm ( lsmod is a shell alias to kldstat(8)):
Code:
                119 drmn/fbd
11    1 0xffffffff83127000    76570 drm.ko (/boot/modules/drm.ko)
                519 drmn
and I have no sysrc kld_list|grep drm neither grep drm /boot/loader.conf (both empty).
 
mjollnir, your explanation of these details is very helpful. I have adjusted my process in light of them:

Code:
# install drm-kmod
sudo pkg install drm-kmod

# add some tweaks to loader.conf
sudo vi /boot/loader.conf
# INTEL DRM WITH graphics/drm-kmod PACKAGE (NEW)
compat.linuxkpi.i915_fastboot="1" # SKIP UNNECESSARY MODE SETS AT BOOT TIME
compat.linuxkpi.enable_rc6="7" # ENABLE POWER SAVING RENDER C-STATE 6
compat.linuxkpi.enable_dc="2" # ENABLE POWER SAVING DISPLAY C-STATES
compat.linuxkpi.enable_fbc="1" # ENABLE FRAME BUFFER COMPRESSION FOR POWER SAVINGS
compat.linuxkpi.semaphores="1" # USE SEMAPHORES FOR INTER RING SYNC

# add kernel module to rc.conf kld_list
/etc/rc.conf
kld_list="/boot/modules/i915kms.ko"

It works, I don't have deprecation messages anymore, and all's well in the world of Xfce on my T430.
 
Back
Top