How to use the "old" or the "new" i915kms driver for Intel integrated graphics with Xorg..

k.jacker

Well-Known Member

Thanks: 230
Messages: 437

#1
This is a short as possible overview over the "old" and the "new" kms video drivers for Intel integrated graphics and the how and when they should be used.

I wrote this as an attempt to clear up confusion and hopefully reduce the amount of threads with the same questions about that topic on the forum.

Yes, one could read the wiki or dig through the driver sources, but this one is aimed at the newbie or maybe even the experienced FreeBSD user that simply thinks a computer is a square box ;)


=== THE "NEW" AND THE "OLD" DRIVER ===

As the title suggests, since FreeBSD 11.2-RELEASE, we have two kms drivers with the same name. In FreeBSD 11.1-RELEASE there is only the i915kms.ko driver from the base system. Since FreeBSD 11.2-RELEASE there are two - the one in the base system and the new one in the ports. Both share the same name (i915kms.ko).
The driver in the base system is (like all kernel modules) located in /boot/kernel/, while the one from the ports will be in /boot/modules/ after building and installing it.

The base system i915kms.ko driver supports the Intel Core family processors up to the Haswell (4th) generation of Intel Core processors. The new i915kms.ko driver available from ports (graphics/drm-next-kmod) since FreeBSD 11.2-RELEASE, supports Intel Core family processors up to Kaby Lake (7th) generation.


=== IDENTIFYING YOUR PROCESSOR ===

On all desktop and mobile Core processors, e.g. the Intel Core i7-4600U in my laptop, Intel nicely matched the numbering with the processor's generation. This processor in my laptop is a Haswell generation processor, see the number 4xxx = 4th generation matches up. Easy to see. You can use the i915kms.ko driver from the base system with it's integrated graphics (HD 4000 series) in both FreeBSD 11.1-RELEASE and 11.2-RELEASE.

If you got something like what I have in my workstation, a Core i5-5675C, you can only use the graphics/drm-next-kmod driver from the ports in FreeBSD 11.2-RELEASE since this is a Broadwell processor (5th generation). See the number 5xxx = 5th generation matches nicely as well. Though Broadwell came after Haswell and the driver in the base system does not support this processors graphics.
Every processor from the 5th generation (Broadwell) or newer, needs the new driver from the ports that came with the FreeBSD 11.2-RELEASE to work. When buidling and installing the graphics/drm-next-kmod port, the new kms driver will be created as /boot/modules/i915kms.ko in the process.

When it comes to Pentium and Celeron processers, it's important to know, that they fall in two different categories: the cheap (Intel Atom like) SoC (System on a Chip) and the "normal" processors. The "normal" Pentium and Celeron processors are all supported by either the kms driver in the base system or that one from the ports, depending on the processors generation. Sadly their numbering doesn't match their generation, making them a little harder to identify.
A "normal" (none SoC) processor will fit into one of the 1155, 1150 or 1151 FCLGA (LGA = Land grid array) sockets (same as the Core i processors above), whereas the smaller SoC Celerons and Pentiums fit into some FCBGA socket (BGA = Ball grid array.
Those get soldered on, like in (modern) notebooks). The SoC are not neccessarily supported, some work, others not. Later more.

So how do you identify your processor?
If you don't know your processors name, run the following command:
Code:
% dmesg | grep CPU:
CPU: Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz (2693.83-MHz K8-class CPU)


=== DECIDE WHICH DRIVER TO USE ===

The numbering in the table below shows the Intel Core i3, Core i5 and Core i7 family of processors,
including it's mobile and desktop parts:

2xxx Sandy Bridge (i915kms.ko in base)
3xxx Ivy Bridge (i915kms.ko in base)
4xxx Haswell (i915kms.ko in base)
5xxx Broadwell (i915kms.ko from ports graphics/drm-next-kmod)
6xxx Skylake (i915kms.ko from ports graphics/drm-next-kmod)
7xxx Kaby Lake (i915kms.ko from ports graphics/drm-next-kmod)
(I'm going a little deeper into, how you identify your Pentium, Celeron or Xeon processor in a minute)

First, for those who got one of the above processors and can't wait...

If your processor is supported by the i915kms.ko driver in the base system, add the following lines to /etc/rc.conf
Code:
kld_list="i915kms"
In case you have created a xorg.conf, remove it and reboot. That's it.

or...

If your processor is supported by the i915kms.ko driver from the ports, you have to install that one first.
Update to FreeBSD 11.2-RELEASE if you haven't already # freebsd-update upgrade -r 11.2 (check the Handbook, if you have never done it before)
Fetch ports tree (if /usr/ports/ is emtpy) # portsnap fetch extract or update it # portsnap fetch update
Fetch sources # svnlite co https://svn.freebsd.org/base/releng/11.2 /usr/src/
cd /usr/ports/graphics/drm-next-kmod
# make && make install
Now add the following lines to /etc/rc.conf
Code:
kld_list="/boot/modules/i915kms.ko"
In case you have created a xorg.conf, remove it and reboot. That's it.


=== IDENTIFYING CELERON, PENTIUM & XEON ===

The "normal" (none SoC) Pentiums' and Celeron's numbering starts with a "G", like the Celeron G1820 I once had in my server. This is also a Haswell generation processor which isn't quite as easy to identify as with the Intel Core processors. As you see, the numbering starts with "1xxx" even if Haswell is 4th generation.
Let's try to identify the "normal" socketed 1155, 1150 and 1151 Celeronst:

G16xx Ivy Bridge (i915kms.ko in base)
G18xx Haswell (i915kms.ko in base)
G39xx Skylake (i915kms.ko from ports graphics/drm-next-kmod)
G49xx Kaby Lake (i915kms.ko from ports graphics/drm-next-kmod)


And here are the "normal" socketed 1155, 1150 and 1151 Pentiums:

G2xxx Ivy Bridge (i915kms.ko in base)
G3xxx Haswell (i915kms.ko in base)
G44xx Skylake (i915kms.ko from ports graphics/drm-next-kmod)
G45xx Skylake & Kaby Lake (i915kms.ko from ports graphics/drm-next-kmod)
G46xx Kaby Lake (i915kms.ko from ports graphics/drm-next-kmod)


As with Celeron and Pentium, also the Xeon processors fall into the categories of "normal" and SoC.
The "normal" Xeons processors, of which some models have integrated graphics, are all part of the Intel Xeon E3 family:

E3 Sandy Bridge (i915kms.ko in base)
E3 v2 Ivy Bridge (i915kms.ko in base)
E3 v3 Haswell (i915kms.ko in base)
E3 v4 Broadwell (i915kms.ko from ports graphics/drm-next-kmod)
E3 v5 Skylake (i915kms.ko from ports graphics/drm-next-kmod)
E3 v6 Kaby Lake (i915kms.ko from ports graphics/drm-next-kmod)

To make use of the integrated graphics of the above Pentiums, Celerons and Xeons use the appropriate i915kms.ko driver, either that one from the base system or from the ports, as explained before in the DECIDE WHICH DRIVER TO USE section.


=== THE INTEL GRAB BAG SOC, TRY YOUR LUCK ===

Last but not least, the SoC Pentiums and Celerons. There are many of them and I don't know them all. This is Intel's rubbish bin (Oops personal opinion here). Nobody knows what they contain, maybe not even Intel. I feel with every new generation they take some random previous generation parts, put them their rubbish bin and shake it until in the end... SURPRISE!!
We are presented with a yet another product that's has no clear specs about the graphics. Wikipedia often is more helpful then ark.intel.com

The Celeron N3160 (Braswell generation) SoC works with the new graphics/drm-next-kmod driver from the ports, as in this thread. If all Braswell Celerons work is beyond me. No clue about other generations of SoC either. They are not yet documented in the wiki, but I know at least there are some models in the "old" drivers source code.
Try the i915kms.ko driver from the base system first, and if that fails, try the new 915kms.ko driver from the ports!

To check if you have a Braswell SoC, check ark.intel.com on the web and enter you processor's name into the 'Search specifications' field. That will be e.g. "n3160" for a Celeron N3160. Look at the field "Code Name" here.
It can be helpful to look at the "Launch date" field and check that against the release dates of the of the Core family processors. So you'll know approximately which graphics (or parts of) is inside your SoC. Or even better: Never buy any of these.
EDIT:
Added release dates to check in which time frame a SoC graphics falls.
Release dates Intel Core series:
2011 Sandy Bridge
2012 Ivy Bridge
2013 Haswell
2015 Broadwell & Skylake
2016 Kaby Lake

Remember that the new i915kms.ko driver from the ports won't be available as package (pkg) before FreeBSD 11.1-RELEASE becomes EoL (End of Life) Around August 1. 2018. Until then, only the driver build from the ports will work.

I tried to keep this as straight to the topic as possible, this is not an Xorg tutorial. Read the Handbook (but ignore how to setup xorg.conf)
 
Last edited:
OP
OP
k.jacker

k.jacker

Well-Known Member

Thanks: 230
Messages: 437

#4
Typo corrected, thanks!

Are you collecting Intel processors?
Let's say I have had a lot of them. I have always been a (crazy) hardware enthusiast :)

In the late `90s when I was low on money I thought about a way to get more performance out of my Pentium II system. At one point, I got hold of something really cool, the Gigabyte GA-5AA socket 7 motherboard used of ebay.
I trashed my old board (QDI I think it was) and moved my Pentium II 233 and my 24MB sdram, to my newly acquired board. This board was able to run the CPU at a blazing 140MHz FSB. So via the board's jumpers, I adjusted the FSB from 66MHz to 125MHz (which was the highest stable FSB) and reduced the multiplier from 3,5 to 2 (resulting in a light overclock at 250MHz, but the doubled FSB made it allmost take off. A friend of mine (the one who showed me FreeBSD existed) was very into databases and benchmarked it's mysql on his Pentium II 400 all the time. He installed the same setup on my new steroids loaded computer, and it outperformed his Pentium II 400 like a racecar would a bicycle. That was the moment I was hooked up :p.
That Gigabyte board had a Ali chipset, not Intel. I liked the times when there where other vendors of chipsets around, like Ali and Via. Boards with none Intel or none AMD chipsets usually had more functionality. I remember a AMD socket 754 motherboard with a VIA chipset, I once had, that I had running with a mobile Turion64, which wasn't possible with AMD's own chipsets.
 
OP
OP
k.jacker

k.jacker

Well-Known Member

Thanks: 230
Messages: 437

#5
intel-kms-pciid-checker.sh
Find out what graphics you got and what driver you need quick and easy.


I made a little script that checks which kms driver to use with Intel integrated graphics.
It should work with all kinds of integrated graphics, even the old ones build into the northbridge of the motherboard and SoC.
(Only tested on more or less modern hardware where graphics sits inside the CPU)

It will fetch parts of the sources for both the driver in the base system (/boot/kernel/i915kms.ko) and graphics/drm-next-kmod that contain the pciids (thanks to tobik@).
Those are then matched against the pciid found in your hardware and showing the result.

Note: I couldn't find where to get the pciid file to check the pciids for graphics/drm-next-kmod so the script fetches the whole .tar.gz and just extracts that one file and throws the rest away.
That's might be a bit annoying if your internet connection is slow :rolleyes:
After you ran the script you may want to remove the fetched files: drm_pciids.h_BASE and i915_pciids.h_DRM-NEXT-KMOD.

That's how it looks....
Code:
% ./intel-kms-pciid-checker.sh
drm_pciids.h_BASE                             100% of   70 kB  838 kBps 00m00s
Makefile_DRM-NEXT-KMOD                        100% of 1064  B 7168 kBps 00m00s
PORTVERSION=4.11.g20180619
fetch: https://codeload.github.com/FreeBSDDesktop/kms-drm/tar.gz/a753215?dummy=/FreeBSDDesktop-kms-drm-4.11.g20180619-.tar.gz: size of remote file is not known
FreeBSDDesktop-kms-drm-4.11.g20180619-.tar.gz         6521 kB 1816 kBps 00m04s

Your CPU: Intel(R) Core(TM) i3-4170 CPU @ 3.70GHz (3700.09-MHz K8-class CPU)
pciid to match: 0x041e

Support in the base driver: {0x8086, 0x041E, 0, "Intel Haswell (GT2 desktop)"}, \

Support in drm-next-kmod: INTEL_VGA_DEVICE(0x041E, info), /* GT2 reserved */ \n

Result:
Your graphics is supported by the driver in base, no need to install drm-next-kmod.
To /etc/rc.conf, add the following line:
kld_list="i915kms"
In case you have created xorg.conf or driver-intel.conf remove it.
Reboot. That's it.
And here is that little helper......
Code:
#!/bin/sh

# Short:
#    Checks which kms driver to use with your Intel integrated graphics.
#
# File:
#    intel-kms-pciid-checker.sh
#
# Description:
#    Downloads the parts of the driver source that contain the pciids and then matches the pciid
#    of your Intel integrated graphics against the sourcecode.
#    Does not use svn or portsnap, so nothing is installed or changed in your FreeBSD installation.
#    The relevant files are simply fetched from svn.freebsd.org and Github and stored in the
#    directory this script is run from. No need for elevated permissions.
#
# Howto:
#    Simply put it in your home directory and run it.
#
# Author:
#    madde
#
# Date:
#    25.07.2018


if [ ! -f drm_pciids.h_BASE ]; then
    fetch -o drm_pciids.h_BASE https://svn.freebsd.org/base/releng/11.2/sys/dev/drm2/drm_pciids.h
fi


if [ ! -f i915_pciids.h_DRM-NEXT-KMOD ]; then
    fetch -o Makefile_DRM-NEXT-KMOD https://svn.freebsd.org/ports/head/graphics/drm-next-kmod/Makefile
    PORTVERSION=`grep PORTVERSION Makefile_DRM-NEXT-KMOD | cut -f 2`
    GH_TAGNAME=`grep GH_TAGNAME Makefile_DRM-NEXT-KMOD | cut -f 2`
    echo PORTVERSION=$PORTVERSION

    fetch https://codeload.github.com/FreeBSDDesktop/kms-drm/tar.gz/$GH_TAGNAME?dummy=/FreeBSDDesktop-kms-drm-$PORTVERSION-$GH_TAGNAME_GH0.tar.gz
    tar -Oxf FreeBSDDesktop-kms-drm-$PORTVERSION-$GH_TAGNAME_GH0.tar.gz --include *i915_pciids.h > i915_pciids.h_DRM-NEXT-KMOD
    rm Makefile_DRM-NEXT-KMOD FreeBSDDesktop-kms-drm-$PORTVERSION-$GH_TAGNAME_GH0.tar.gz
fi


pciid=`pciconf -l | grep ^vga | cut -d " " -f 3 | cut -c 6-11`
printf "\nYour "
dmesg | grep -m1 CPU:
echo "pciid to match: $pciid"


base_result=`grep -i $pciid drm_pciids.h_BASE | cut -f 2`
drm_next_kmod_result=`grep -i $pciid i915_pciids.h_DRM-NEXT-KMOD | cut -f 2`
printf "\nSupport in the base driver: ${base_result:-No match}"
printf "\n\nSupport in drm-next-kmod: ${drm_next_kmod_result:-No match}\n\n\n"


echo "Result:"
if [ -z "$base_result" ]; then
    printf "Your graphics isn't supported "
    if [ -z "$drm_next_kmod_result" ]; then
        echo "by neither the driver in base or drm-next-kmod.";exit
        else
            printf "by the driver in base,\nbut the drm-next-kmod port supports it.\n"
            echo "Fetch or update your ports tree:"
            echo "# portsnap fetch extract"
            echo "or..."
            echo "# portsnap fetch update"
            echo "Fetch sources:"
            echo "# svnlite co https://svn.freebsd.org/base/releng/11.2 /usr/src/"
            echo "% cd /usr/ports/graphics/drm-next-kmod"
            echo "# make && make install"
            echo "To /etc/rc.conf, add the following line:"
            echo "kld_list=\"/boot/modules/i915kms.ko\""
            echo "In case you have created xorg.conf or driver-intel.conf remove it."
            echo "Reboot. That's it.";exit
    fi
fi
  
echo "Your graphics is supported by the driver in base, no need to install drm-next-kmod."
echo "To /etc/rc.conf, add the following line:"
echo "kld_list=\"i915kms\""
echo "In case you have created xorg.conf or driver-intel.conf remove it."
echo "Reboot. That's it."
 

mufeng

New Member


Messages: 1

#6
Hello there!
My CPU is j4105, Processor Graphics is Intel® UHD Graphics 600.

I installed FreeBSD 11.2-release. Which driver should I use?
Thank you!
 

Oleg P.

Member

Thanks: 2
Messages: 49

#8
Hi!
Well, I have got the next message:
Code:
Your CPU: Intel(R) Core(TM) i5-8500T CPU @ 2.10GHz (2112.10-MHz K8-class CPU)
pciid to match: 0x3e92

Support in the base driver: No match

Support in drm-next-kmod: No match


Result:
Your graphics isn't supported by neither the driver in base or drm-next-kmod.
And I am using my PC like server with XDM.
 
OP
OP
k.jacker

k.jacker

Well-Known Member

Thanks: 230
Messages: 437

#9
That is a Coffee Lake generation processor. The generation that came after Kaby Lake.
Not supported.
 

vince66

Well-Known Member

Thanks: 10
Messages: 379

#10
Hello jacker,

maybe is not clear for me.
Surely I'd like to run your code on my PC's.

My apologize:

And here is that little helper......
Is this the helper ? not the code ?
Where is the code ?
It seems the code to me.

make it executable
in which a way a shell language program is made executable before running it ?

After copied in a text file (and named jacker_test.sh, for example) is it not just a matter of typing: :

sh jacker_test.sh

or

./jacker_test.sh

Thanks in advance.
 

Beastie

Daemon

Thanks: 448
Messages: 2,132

#12
in which a way a shell language program is made executable before running it ?

After copied in a text file (and named jacker_test.sh, for example) is it not just a matter of typing: :

sh jacker_test.sh

or

./jacker_test.sh
chmod +x jacker_test.sh
./jacker_test.sh
 
Top