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.

This branch will be used for the update to Linux 3.9 just after this task.

Goals

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.

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!

  1. 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
  2. Enable DRM debug messages:

    # In /boot/loader.conf
    drm.debug=7
  3. You need to clone the repository and switch to the drm-next-3.9 branch:

    git clone -b drm-next-3.9 \
     https://github.com/freebsd/freebsd-base-graphics.git
  4. 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
  5. Select the new kernel for the next boot and reboot:

    sudo nextboot -k kernel.39
    sudo reboot
  6. Try to load the appropriate driver:

    sudo kldload i915kms

    or

    sudo kldload radeonkms
  7. Try to start an X.Org server and use it!
  8. Send feedback! Post on the freebsd-x11 mailing list


CategoryTodo CategoryStale

JeanSébastienPédron/LinuxKPIinDRM (last edited 2021-04-10T04:49:33+0000 by KubilayKocak)