Solved How does the i915kms driver identify the processor?

Hei.

First, this is not a question about how to configure vt or Xorg to use the i915kms driver, I simply wonder why one of my Haswell prosessors isn't recognized by it.

So maybe some of you have some idea why, for others it hopefully is interesting to just have a look at different approaches when using the i915kms driver. It may seem like I love prosessor-juggling but it's just that I cannot stop before I have compared any possible situation to the other ;)

I got 2 Haswell systems at home. A desktop computer with a Pentium G3220 (Intel HD) and a Laptop with a i7-4600U (HD4400). Both work nicely with the i915kms driver on vt and within Xorg.
Now I got an Haswell i3-4170 for a bargain and swapped out the Pentium G3220 with my new i3-4170 on an Asrock H81M-ITX running FreeBSD 11-RELEASE-p9.
Surprise... the i3 is not recognized when the i915kms driver is loaded.

Weird I thought and did some testing, comparing kernel messages when loading the i915kms driver.
Updated the old 2013 Bios on the Asrock H81M-ITX to newest version from 2016.
The FreeBSD install is in legacy mode, UEFI install didn't work on this motherboard. So when the computer is booting it starts in textmode (vga) and then switches to graphics mode when the i915kms attaches succesfully.

1. i3-4170 on the Asrock H81M-ITX running FreeBSD 11-RELEASE-p9
Code:
info: [drm] Initialized drm 1.1.0 20060810
Doesn't work. That's it, no ...replacing "vga" with "fb"...
So, no graphics-mode on vt and no graphic acceleration in Xorg.

2. The old Pentium G3220 on the Asrock H81M-ITX unning FreeBSD 11-RELEASE-p9
Code:
info: [drm] Initialized drm 1.1.0 20060810
drmn0: <Intel Haswell (GT1 desktop)> on vgapci0
....
VT: Replacing driver "vga" with new "fb".
Works. Everybody using the i915kms driver knows the output, I have shortened it a little.


In the next step I'll try my luck on an Asrock Z97E-ITX Motherboard (which holds the Broadwell i5-5675C. My Linux gaming computer). The same FreeBSD install with booting in legacy mode as above is used and the i915kms loaded manually with kldload, like before.

1. i5-5675C (Broadwell) on the Asrock Z97E-ITX running FreeBSD 11-RELEASE-p9
Code:
Yes, no output at all, since Broadwell is not supported. Just wanted to see if there was a difference to the i3-4170.

2. i3-4170 on the Asrock Z97E-ITX running FreeBSD 11-RELEASE-p9
Code:
info: [drm] Initialized drm 1.1.0 20060810
Same output as on the H81 Motherboard an it doesn't work. Xorg works without accelaration.

3. Pentium G3220 on the Asrock Z97E-ITX running FreeBSD 11-RELEASE-p9
Code:
info: [drm] Initialized drm 1.1.0 20060810
drmn0: <Intel Haswell (GT1 desktop)> on vgapci0
....
VT: Replacing driver "vga" with new "fb".
Works as good as on the H81 motherboard, why shouldn't it. Xorg with accelaration.


Ok, no working KMS with the i3-4170 on the Z97 motherboard either. What if I try forcing the i3 to use graphics mode on vt by installing FreeBSD in UEFI mode. I never tried that before... Ok, a fresh install in UEFI mode, a quick upgrade to RELEASE-p9 and installing Xorg, xfce4 and mplayer worked without a hassle on the Z97 motherboard.

1. i3-4170 on the Asrock Z97E-ITX running FreeBSD 11-RELEASE-p9 (UEFI/efifb)
Code:
info: [drm] Initialized drm 1.1.0 20060810
Same output as on the H81 Motherboard and it doesn't work.
startx
Code:
Cannot run in framebuffer mode
No, the i915kms driver didn't attach. Xorg won't even start. At least graphics-mode on vt is working via efifb.

2. Pentium G3220 on the Asrock Z97E-ITX running FreeBSD 11-RELEASE-p9 (UEFI/efifb)
Code:
info: [drm] Initialized drm 1.1.0 20060810
drmn0: <Intel Haswell (GT1 desktop)> on vgapci0
....
VT: Replacing driver "efifb" with new "fb".
And again. Even when booting from UEFI the i915kms driver attaches to the G3220's HD graphics. Xorg runs smooth. Though, when vt runs on efifb, the i915kms driver is not loaded by Xorg automatically.


Does the i915kms driver identify prosessors by a whitelist and my new i3 isn't in that list yet because it's a very late modell from 2015?
Or could it be my i3 allready has some Broadwell like graphics even if it's called HD4400? Comparing my prosessors on ark.intel.com I noticed that the i3-4170 got released just one month before Broadwell came out, allmost 2 years after the first Haswell prosessors where released.

I hope somebody has an idea why the Haswell i3 refuses to work with KMS, if not, this will hopefully give some people an overview about the i915kms driver :)
 
AFAICT the driver just matches on the PCI ids. Check sys/dev/drm2/drm_pciids.h in the source tree to see if your GPU's id is in the table. To find it look for a line with chip=0x????8086 in the output of pciconf -lv.
 
Hei tobic,

Thank you, that looks very promising.
I verified with pciconf -lv and found my Pentium's PCI-id in sys/dev/drm2/drm_pciids.h. Then I looked for the i3-4170's PCI-id and it's not there.
The line for GT2 Desktop is allready occupied:
Code:
{0x8086, 0x0412, 0, "Intel Haswell (GT2 desktop)"}, \
For testing purpose i just replaced it with the PCI-id from my i3 which is 0x041e8086
Code:
{0x8086, 0x041E, 0, "Intel Haswell (GT2 desktop)"}, \

I then rebuild the kernel and rebooted but it didn't do anything. The i915kms driver still has no effect. No kernel messages indicating that the driver attached after kldload i915kms.
I must have done something wrong...
Any more ideas?

Matthias
 
Hei tobik,
Great it's been added to HEAD and thanks again for your help!

After a different approch, trying to add a line instead of replacing an existing one, the errors from make led me to sys/dev/drm2/i915/i915_drv.c as well. Changed that file, too. Works now. driver attached succesfully. How cool is that!
Thanks man, you made my day :)

Without missusing this thread, only a short and stupid question from a none-developer...
How did you find out that it has been added to HEAD? How do you search for such things?

Matthias
 
Changed that file, too. Works now. driver attached succesfully. How cool is that!
Thanks man, you made my day :)
Great! :beer:

How did you find out that it has been added to HEAD? How do you search for such things?
Git's or SVN's blame and log commands are your friends :).

I think you should open a bug on https://bugs.freebsd.org and ask for revision 316749 to be MFC'ed to 11-STABLE so that this can be part of 11.1-RELEASE and you don't have to keep on patching your system.
 
Ok, I'll open a bug on this and take a look at the blame and log commands and learn something about Git and SVN :) Thank you!
 
I hope somebody has an idea why the Haswell i3 refuses to work with KMS, if not, this will hopefully give some people an overview about the i915kms driver
Are more performant video driver than i915kms ?

If so, do you write here possible alternatives ?

Thanks.
 
Back
Top