Solved How to switch from vesa to intel driver?

Hello,

I have just installed FreeBSD on an old laptop. Even though the installation was successful and Xorg is running, is the cpu usage high (writing this post is very demanding with this machine…). I read somewhere that vesa could cause high cpu usage. So I am trying to switch to the intel driver. Here is the info about my setup:

My dmesg is here.

Code:
$ pciconf -lv | grep -B3 display
vgapci0@pci0:0:2:0:    class=0x030000 rev=0x03 hdr=0x00 vendor=0x8086 device=0x27a2 subvendor=0x1734 subdevice=0x10c1
    vendor     = 'Intel Corporation'
    device     = 'Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller'
    class      = display
--
vgapci1@pci0:0:2:1:    class=0x038000 rev=0x03 hdr=0x00 vendor=0x8086 device=0x27a6 subvendor=0x1734 subdevice=0x10c1
    vendor     = 'Intel Corporation'
    device     = 'Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller'
    class      = display

My /var/log/Xorg.0.log is available here.

I have xf86-video-intel installed. And i915 does not load:
Code:
$ kldload i915
kldload: can't load i915: No such file or directory
Neither sct nor redshift work. The color temperature stays the same…
I appreciate your help very much.
 
From the looks of the Xorg log file, it is still using the VESA driver.

Create a file called /etc/X11/xorg.conf (or /usr/local/etc/X11/xorg.conf) containing:

Code:
Section "Device"
  Identifier "Device0"
  Driver "intel"
EndSection

And see if that works. This is using the "legacy" intel driver which is likely more suitable for your card. But the fact that Xorg didn't autodetect this likely means that the old driver has become broken.

Instead, you might also like to try (you were close with your command!):

# kldload i915kms

And see if the kernel modesetting driver can attach. In which case, so long as your user is in the video group, this part of the error should no longer occur (and delete that previous xorg.conf file so it falls back to the modesetting driver):

Code:
[    52.133] (EE) open /dev/dri/card0: No such file or directory
[    52.133] (WW) Falling back to old probe method for modesetting
[    52.133] (EE) open /dev/dri/card0: No such file or directory
[    52.133] (WW) Falling back to old probe method for scfb
[    52.133] scfb trace: probe start
[    52.133] scfb trace: probe done
[    52.133] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support

I just tested this on my (even older) Intel GMA 915 (ThinkPad Z61t) and it does work.

Note: The handbook erroneously says to install the drm-kmod package which is useless because it only grabs a bunch of firmware files (mostly amdgpu). The actual package you want is drm-fbsdXXX-kmod (do a pkg search drm and I'm sure you will track it down). It was meant to be a meta-package that does it for you but this is all fairly broken.
 
Thank you very much! With your instruction I successfully switched to the intel driver. The performance is fine now, too. Here is what I did:
  1. I deleted drm-kmod
  2. I installed drm-fbsd13-kmod
  3. I added i915kms to my /etc/rc.conf
That’s it. I did not even had to add a xorg.conf.
All solved now for me. Thank you again!
 
Great to hear :)

Just to clarify then in case you ever need to repeat this setup, and because it is fairly confusing!

1) You have loaded the i915kms kernel module
2) You are not using the intel Xorg driver (which is good because that is legacy)
3) You are instead using the modesetting Xorg driver (which works in combination with the i915kms kernel module).

As such, you *should* be able to remove the old xf86-video-intel Xorg driver package because you aren't needing it. That said, if you don't want to risk it, it doesn't do any harm remaining :)
 
I appreciate your clarification. Now I understand better what is going on.:)

I corrected my original post.
 
Note: The handbook erroneously says to install the drm-kmod package which is useless because it only grabs a bunch of firmware files (mostly amdgpu). The actual package you want is drm-fbsdXXX-kmod (do a pkg search drm and I'm sure you will track it down). It was meant to be a meta-package that does it for you but this is all fairly broken.

Well people who do not have much idea of the stuff or are too lazy, the metapackage drm-kmod is already a remedy. This automatically installs a stable version of drm with the correct FreeBSD version. It also installs everything from gpu-firmware. So if you want it fast and easy, people can use it.

People who know what they are doing can install what they need directly [drm-fbsdXXX-kmod] but then have to grab the right gpu firmware and need to keep an eye on the drm package before and after upgrading to a new major FreeBSD version.
 
Well people who do not have much idea of the stuff or are too lazy, the metapackage drm-kmod is already a remedy. This automatically installs a stable version of drm-kmod with the correct FreeBSD version. It also installs everything from gpu-firmware. So if you want it fast and easy, people can use it.

People who know what they are doing can install what they need directly [drm-fbsdXXX-kmod] but then have to grab the right gpu firmware and need to keep an eye on the drm package before and after upgrading to a newer major FreeBSD version.
I do get the point and think it is a good idea. However it is broken.

If you install drm-kmod (from packages), it does not correctly pull in drm-fbsdXXX-kmod. I just tried it.

I believe the drm-kmod port does, but potentially the package is broken.
 
it does not correctly pull in drm-fbsdXXX-kmod. I just tried it. I believe the port does, but potentially the package is broken.

1661635171629.png
 
Very strange. I just get a list of amdgpu-firmware packages and not much more.

Why are they not present on yours?

Mine was on a fresh install of FreeBSD 13 (i386 if this is potentially making the difference). It looks to be the case with the OP too (?).
 
Thats a good question, this may be due to the fact that i use -STABLE? However its not just amdgpu-firmware, in the middle of the list you can find the intel-kmod packages 🤓

1661635743412.png
 
Thats a good question, this may be due to the fact that i use -STABLE? However its not just amdgpu-firmware, in the middle of the list you can find the intel-kmod packages 🤓
Yep, I do also get the intel-firmware but have double checked and no drm-fbsdXXX-kmod.

I will try the port later (I do recall that working a few months back). Actually I also remember the package working many months back too.
 
BTW from Meinold 's xorg log.

[ 51.673] Build Operating System: FreeBSD 13.0-RELEASE-p12 i386
[ 51.673] Current Operating System: FreeBSD localhost 13.1-RELEASE-p1....]

This could be a hint that there are now drm-drivers in use that are in mismatch with the running kernel.
 
BTW from Meinold 's xorg log.

[ 51.673] Build Operating System: FreeBSD 13.0-RELEASE-p12 i386
[ 51.673] Current Operating System: FreeBSD localhost 13.1-RELEASE-p1....]

This could be a hint that there are now drm-drivers in use that are in mismatch with the running kernel.
Here is my current xorg log. I don’t know if there are any mismatches but the performance is much better now. However, I was unable to start X without xf86-video-intel. So I need to have it installed…
 
Yes, I had /usr/local/etc/X11/xorg.conf.d/card.conf:

Code:
Section "Device"
  Identifier "Device0"
  Driver "intel"
EndSection

And here is my Xorg log without this custom Xorg config.
 
From the OP's xorg.log when using modesetting:
[ 156.284] Require OpenGL version 2.1 or later.
[ 156.284] (EE) modeset(0): Failed to initialize glamor at ScreenInit() time.
The GMA 945 did used to support OpenGL 2.1 in an earlier version of Mesa. This was provided in part by some emulation but nonetheless did work. Some info here. Now I believe it only supports OpenGL 2.0 so just misses the glamor requirement.

So Meinold , I go back to my earlier clarification. You *are* using xf86-video-intel. Don't remove it as you have found out ;)

I have just tried again on my old GMA and notice that if I haven't already loaded the KMS driver, Xorg (and the intel driver) does it for me when I startx. So it seems to still need the i915kms even when using the legacy intel driver. It works, it is all just a bit weird.

Additionally, My GMA 915 just outright causes a coredump of glxinfo and glxgears when I try to run it to check OpenGL versions. I feel there is some bitrot going on with the drivers for these cards. I might personally just start using an older FreeBSD release for them.
 
Back
Top