This is an old revision of the document!
Use linuxkpi in DRM
Currently, our DRM uses a small Linux wrapper in sys/dev/drm2/drm_os_freebsd.[ch]. Now that we have a centralized Linux shim (moved out of OFED), we want to use it. It will avoid duplicate efforts. In DRM, it will further reduce the diff with Linux.
The work-in-progress branch is available on GitHub. This branch will be used for the update to Linux 3.9 just after this task.
Goals
- Move DRM headers to a similar location as Linux
Use kmalloc() instead of malloc(9)- Use kref
- Use idr and get rid of
drm_gem_names.c - Use PCI API
- Use Linux locking primitives
Current status (2016-03-28)
The project just started with a contribution from Conrad Meyer: he changed all calls to FreeBSD's malloc(9) to Linux kmalloc() calls. See his pull request on GitHub: https://github.com/freebsd/freebsd-base-graphics/pull/10
Testing Instructions / How To
Whether it works or not, we are interested in the output of dmesg and, in case of a kernel crash, the corresponding /var/crash/core.txt.* files. Please send them to the freebsd-x11 mailing list.
At this time, we aren't providing user support. However, if you have patches, they are very much welcome!
Thank you for your help!
- Make sure you have everything setup to have kernel dumps:
# In /etc/rc.conf dumpdev="AUTO" ddb_enable="YES"
Additionally, it helps to have the following sysctl:
# In /etc/sysctl.conf debug.debugger_on_panic=0
- Enable DRM debug messages:
# In /boot/loader.conf drm.debug=7
- You need to clone the repository and switch to the
drm-next-3.9branch:
git clone -b drm-next-3.9 \ https://github.com/freebsd/freebsd-base-graphics.git
- Build and install a kernel from this clone; I suggest you install the kernel with a non-default name:
cd freebsd-base-graphics sudo make kernel INSTKERNNAME=kernel.39
- Select the new kernel for the next boot and reboot:
sudo nextboot -k kernel.39 sudo reboot
- Try to load the appropriate driver:
sudo kldload i915kms
}}} or {{{
sudo kldload radeonkms
- Try to start an X.Org server and use it!
- Send feedback! Post on the freebsd-x11 mailing list