Can't get X server to start on Raptor Lake with DRM

Hello folks,

I've been using FreeBSD on my server workloads for a few months now and now I want to switch to FreeBSD on the desktop as well, since I like the idea of being able to play with Jails and other stuff in localhost, so I got myself a recent Lenovo IdeaPad laptop that comes with Raptor Lake graphics:
Code:
# pciconf -lv | grep -B3 display
vgapci0@pci0:0:2:0:     class=0x030000 rev=0x04 hdr=0x00 vendor=0x8086 device=0xa7ab subvendor=0x17aa subdevice=0x3d05
    vendor     = 'Intel Corporation'
    device     = 'Raptor Lake-P [Intel Graphics]'
    class      = display
A simple Google search tells me that Raptor Lake support is still somewhat spotty on FreeBSD 14 and is supposed to get much better in the upcoming FreeBSD 15, but I thought I'd give it a try on 14.3-RELEASE first since I spent ~15 years on Debian and macOS as my daily desktop drivers and I've come to appreciate the long term stability of the environment where I spend most of my day.

Spoiler alert: it's not any different on 15-CURRENT, but let's take it step by step.

After installing the base system, I install Git and grab the source code:
Code:
# git clone https://git.freebsd.org/src.git /usr/src
and switch to the appropriate branch:
Code:
root@lenovo:/usr/src # git checkout releng/14.3
Updating files: 100% (41320/41320), done.
branch 'releng/14.3' set up to track 'origin/releng/14.3'.
Switched to a new branch 'releng/14.3'
So far so good. Now I can use freebsd-update(8) to bring the system up to date, and sure enough, I end up with the latest release:
Code:
# uname -r
14.3-RELEASE-p2
Now I can get to the fun part, and that's installing the appropriate graphics drivers. Reading the Handbook, these forums, Reddit and other sites tell me that I should absolutely go with the DRM drivers ported from Linux, so I should probably just install the graphics/drm-kmod metapackage and it will figure everything out on its own, right? Let me check with fwget(8) real quick first:
Code:
# fwget
No package found for device 0xa7ab
Needed firmware packages: 'wifi-firmware-iwlwifi-kmod-ax210'
The most recent versions of packages are already installed
The device 0xa7ab happens to be the Raptor Lake graphics device listed above with pciconf(8) and it looks like installing the appropriate driver won't be as smooth as I originally anticipated.

Alright, I'll compile the driver myself then. Let me get the Ports tree first:
Code:
# git clone https://git.freebsd.org/ports.git /usr/ports
Cloning into '/usr/ports'...
remote: Enumerating objects: 6681388, done.
remote: Counting objects: 100% (966/966), done.
remote: Compressing objects: 100% (150/150), done.
remote: Total 6681388 (delta 928), reused 816 (delta 816), pack-reused 6680422 (from 1)
Receiving objects: 100% (6681388/6681388), 1.48 GiB | 1.16 MiB/s, done.
Resolving deltas: 100% (4045083/4045083), done.
Updating files: 100% (165516/165516), done.
I want to get the bleeding edge driver so I don't switch to the 2025Q3 branch, I'll stay in main for the best chance to get the proper driver in there. A page for the graphics/drm-kmod metapackage on FreshPorts tells me that for 14.3, the graphics/drm-61-kmod is the appropriate package, so that's what I'll compile. Wish me luck:
Code:
# cd /usr/ports/graphics/drm-61-kmod
root@lenovo:/usr/ports/graphics/drm-61-kmod # make install
Sure enough, it compiles just fine, so I adjust the /etc/rc.conf accordingly in order to get i915kms loaded on system boot:
Code:
# sysrc kld_list+="/boot/modules/i915kms.ko"
kld_list:  -> /boot/modules/i915kms.ko
but before I reboot for a clean start, I want to check if I can load it manually, and sure enough, I can:
Code:
# kldload /boot/modules/i915kms.ko
# kldstat
Id Refs Address                Size Name
 1   98 0xffffffff80200000  1f41500 kernel
 2    1 0xffffffff82142000   5e9328 zfs.ko
 3    1 0xffffffff8272c000     7808 cryptodev.ko
 4    1 0xffffffff838da000     3390 acpi_wmi.ko
 5    1 0xffffffff838de000     4250 ichsmb.ko
 6    1 0xffffffff838e3000     2178 smbus.ko
 7    1 0xffffffff838e6000    b1270 if_iwlwifi.ko
 8    4 0xffffffff83998000     3378 lindebugfs.ko
 9    1 0xffffffff8399c000     6020 ig4.ko
10    1 0xffffffff839a3000     5640 ng_ubt.ko
11    4 0xffffffff839a9000     abb8 netgraph.ko
12    3 0xffffffff839b4000     a250 ng_hci.ko
13    2 0xffffffff839bf000     2670 ng_bluetooth.ko
14    1 0xffffffff839c2000     3218 iichid.ko
15    1 0xffffffff839c6000     21e8 hms.ko
16    1 0xffffffff839c9000     30a8 hidmap.ko
17    1 0xffffffff839cd000     3355 hmt.ko
18    1 0xffffffff839d1000     22cc hconf.ko
19    1 0xffffffff839d4000   1df228 i915kms.ko
20    2 0xffffffff83bb4000    85090 drm.ko
21    1 0xffffffff83c3a000     22b8 iic.ko
22    2 0xffffffff83c3d000     4120 linuxkpi_video.ko
23    3 0xffffffff83c42000     7350 dmabuf.ko
24    1 0xffffffff83c4a000     c338 ttm.ko
Let me install X real quick before the reboot since I want to start fresh just in case. I install X and add myself to the video group:
Code:
# pkg install xorg
# pw groupmod video -m ppetrovic
# pw groupmod video -m root
It should probably be good to reboot now, but it turns out I need to specify the PCI bus for X, so let me put some basic stuff in /usr/local/share/X11/xorg.conf.d/20-intel.conf:
Code:
Section "Device"
        Identifier "Card0"
        Driver "modesetting"
        BusID "PCI:0:0:2:0"
EndSection
I reboot the machine, log in as root and sure enough, the module loads as usual:
Code:
# kldstat
Id Refs Address                Size Name
 1   98 0xffffffff80200000  1f41500 kernel
 2    1 0xffffffff82142000   5e9328 zfs.ko
 3    1 0xffffffff8272d000     7808 cryptodev.ko
 4    1 0xffffffff838da000   1df228 i915kms.ko
 5    2 0xffffffff83aba000    85090 drm.ko
 6    1 0xffffffff83b40000     22b8 iic.ko
 7    2 0xffffffff83b43000     4120 linuxkpi_video.ko
 8    3 0xffffffff83b48000     7350 dmabuf.ko
 9    4 0xffffffff83b50000     3378 lindebugfs.ko
10    1 0xffffffff83b54000     c338 ttm.ko
11    1 0xffffffff83b61000     3390 acpi_wmi.ko
12    1 0xffffffff83b65000     4250 ichsmb.ko
13    1 0xffffffff83b6a000     2178 smbus.ko
14    1 0xffffffff83b6d000    b1270 if_iwlwifi.ko
15    1 0xffffffff83c1f000     6020 ig4.ko
16    1 0xffffffff83c26000     5640 ng_ubt.ko
17    4 0xffffffff83c2c000     abb8 netgraph.ko
18    3 0xffffffff83c37000     a250 ng_hci.ko
19    2 0xffffffff83c42000     2670 ng_bluetooth.ko
20    1 0xffffffff83c45000     3218 iichid.ko
21    1 0xffffffff83c49000     21e8 hms.ko
22    1 0xffffffff83c4c000     30a8 hidmap.ko
23    1 0xffffffff83c50000     3355 hmt.ko
24    1 0xffffffff83c54000     22cc hconf.k
However, running startx=1() throws the following error:
Code:
# startx
xauth:  file /root/.serverauth.2170 does not exist


X.Org X Server 1.21.1.18
X Protocol Version 11, Revision 0
Current Operating System: FreeBSD lenovo 14.3-RELEASE-p2 FreeBSD 14.3-RELEASE-p2 GENERIC amd64
 
Current version of pixman: 0.46.2
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Sep 13 22:15:15 2025
(==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
dmesg output can be found here: https://pastebin.com/0KFUwfd9
Xorg.0.log file can be found here: https://pastebin.com/0EQGJibe

I've tried the exact same above on 15-ALPHA1 and even tried compiling everything from source with buildkernel and buildworld and I get the exact same result (obviously on 15 I switched to the proper graphics/drm-66-kmod port). I tried installing the pre-packaged graphics/drm-kmod package as well, to no avail.

Is it really possible I've got graphics that's so fresh it's going to take like another year before it gets proper support?

And yes, before you even ask - I can get X to start with the x11-drivers/xf86-video-scfb driver but as you all know, it's not as usable as we'd all like it to be.
 
Yes, forgot to mention it, I installed/compiled it every time along with the rest of the kmods, no difference.
 
Seems 0x8086:0xa7ab is not supported by graphics/drm-66-kmod. But support is already added in main branch and is subject to next drm-6.11 release.
Well spotted, shurik! I've done some more research in the meantine and this particular chipset appears to have been released less than a year ago, which explains the lack of support for it.

I've poked around the GitHub repository and I'm not quite sure if these changes are going to be merged into the existing graphics/drm-66-kmod port at some point or should I expect a whole new port to be made for drm-6.11? I guess it's going to be the latter.

Either way, I can wait for a little longer to get it all working. The machine is usable with the scfb driver but it feels sluggish at times.
 
Yeah, I'll give it a shot as soon as I have some more time to spend on this, but I'd still like to have it in a proper kmod package at some point, probably around the time when 15-RELEASE lands in December which is when I'll do a clean install and set everything up from scratch.

Will report back here once I compile the latest module from the main branch.
 
I've finally had some more time to play around with this today, and I can confirm that the driver installs properly now that the new version of graphics/drm-61-kmod port is released (6.1.128_6). I didn't even have to compile anything from source directly from the Git repository.

Special thanks goes to shurik for all the guidance and suggestions.
 
Back
Top