Hilarious (?)

Fedora support for DisplayLink adapters

Dell 4 in 1 AdapterA couple of months ago I got myself a Dell XPS 13. I have read it was one of the best ultrabooks of 2015, it had great reviews and even won some awards. Dell also ships the “Developer edition”, with Ubuntu, so I figured Linux would be well supported. Since I occasionally require physical network connection, and frequently need VGA or HDMI, I decided I would also get Dell’s 4 in 1 adapter, that provides all that, without loosing the USB port.

Unfortunately, after getting the adapter, I discovered that it uses DisplayLink technology for its VGA/HDMI ports, and as a matter of fact, it is DisplayLink who provides the driver, not Dell. Until just days ago, there was no driver for Linux, whatever version you would be running, but on Aug 3rd, DisplayLink published a driver for Ubuntu, with a note that said it could be used to create a driver for other Linux versions.

Since I use Fedora/CentOS/RHEL, and considering it’s been two months that I have got this device without being able to use the VGA/HDMI ports (network and USB do work out of the box), I decided I would dedicate the time to create the module and rpm for Fedora. One of the prerequisites of the module is a kernel version 3.14 or higher, so this won’t work on current versions of RHEL/CentOS.

The rpm I created uses DKMS to recompile the module automatically when the kernel is updated. I also included an udev rule so that the appropriate service is started when the adapter is plugged in, and stopped when it’s removed, something that is missing from the Ubuntu installer provided by DisplayLink. It was initially developed on Fedora 22, and now I’m using it on F23 with the latest kernel as of May 2016.

 

IMPORTANT:

Current working version of the rpm is 1.0.335, with the matching driver version from DisplayLink. RPM created on FC23, running kernel 4.4.9-300.fc23.x86_64 and xorg-x11-server-Xorg-1.18.3-2.fc23.x86_64. You do NOT need to downgrade Xorg with this version. You can get this version here: http://nothen.com.ar/resources/displaylink-1.0.335-1.x86_64.rpm

There’s also an updated rpm with driver version 1.1.62 released by DisplayLink on May 16, 2016, but it’s not activating the screen on my current setup. I haven’t figured out why yet, altough reading the comments below I believe it could be an issue with Xorg. Feel free to give it a try and let me know if it works on your setup. You can get this version here: http://nothen.com.ar/resources/displaylink-1.1.65-2.x86_64.rpm

 

To install the RPM:

  1. Import the GPG I used to sign the rpm:
    [root@xps13 ~]# rpm --import http://bit.ly/1J3EjlG
  2. Download the rpm:
    [root@xps13 ~]# wget -q http://nothen.com.ar/resources/displaylink-1.0.68-2.x86_64.rpm
  3. Before installing, verify that there’s nothing hidden on the rpm.Basic information:
    [root@xps13 ~]# rpm -qip displaylink-1.0.68-2.x86_64.rpm 
    Name : displaylink
    Version : 1.0.68
    Release : 2
    Architecture: x86_64
    Install Date: (not installed)
    Group : User Interface/X Hardware Support
    Size : 7416983
    License : GPL v2.0, LGPL v2.1 and others
    Signature : RSA/SHA256, Wed 19 Aug 2015 05:42:29 PM ART, Key ID 3b2d50d677f09132
    Source RPM : displaylink-1.0.68-2.src.rpm
    Build Date : Wed 19 Aug 2015 05:42:04 PM ART
    Build Host : xps13.nothen.com.ar
    Relocations : (not relocatable)
    Packager : Eric Nothen
    URL : http://nothen.com.ar
    Summary : DisplayLink VGA/HDMI driver for Dell's 4-in-1 adapter (DA100)
    Description :
    This package installs the DisplayLink "Plug and Display" module for the USB 3.0 to HDMI/VGA/Ethernet/USB2.0 Dell Adapter (DA100). Based on DisplayLink's officially supported Ubuntu driver, and repackaged for Fedora/CentOS/RHEL distros. Module is added to DKMS so that it's recompiled on future kernel updates.

    Files that the rpm deploys:

    [root@xps13 ~]# rpm -qlp displaylink-1.0.68-2.x86_64.rpm 
    /etc/systemd/system/displaylink.service
    /etc/udev/rules.d/99-displaylink.rules
    /usr/lib/displaylink
    /usr/lib/displaylink/DLInstrumentationDirectoryLock
    /usr/lib/displaylink/DisplayLinkManager
    /usr/lib/displaylink/LICENSE
    /usr/lib/displaylink/firefly-monitor-release.spkg
    /usr/lib/displaylink/libevdi.so
    /usr/lib/displaylink/libusb-1.0.so.0.1.0
    /usr/src/evdi-1.0.68
    /usr/src/evdi-1.0.68/Kconfig
    /usr/src/evdi-1.0.68/LICENSE
    /usr/src/evdi-1.0.68/Makefile
    /usr/src/evdi-1.0.68/dkms.conf
    /usr/src/evdi-1.0.68/evdi.mod.c
    /usr/src/evdi-1.0.68/evdi_connector.c
    /usr/src/evdi-1.0.68/evdi_debug.c
    /usr/src/evdi-1.0.68/evdi_debug.h
    /usr/src/evdi-1.0.68/evdi_drv.c
    /usr/src/evdi-1.0.68/evdi_drv.h
    /usr/src/evdi-1.0.68/evdi_encoder.c
    /usr/src/evdi-1.0.68/evdi_fb.c
    /usr/src/evdi-1.0.68/evdi_gem.c
    /usr/src/evdi-1.0.68/evdi_ioctl.h
    /usr/src/evdi-1.0.68/evdi_main.c
    /usr/src/evdi-1.0.68/evdi_modeset.c
    /usr/src/evdi-1.0.68/evdi_painter.c
    /usr/src/evdi-1.0.68/evdi_stats.c
    /var/log/displaylink

    Scripts that the rpm runs:

    [root@xps13 ~]# rpm -qp --scripts displaylink-1.0.68-2.x86_64.rpm 
    postinstall scriptlet (using /bin/sh):
    /usr/bin/systemctl daemon-reload
    /usr/bin/systemctl -q is-enabled dkms.service || /usr/bin/systemctl enable dkms.service
    for kernel in $(ls /lib/modules) ;do
     /sbin/dkms install evdi/1.0.68 -k $kernel >> /var/log/displaylink/displaylink.log 2>&1
    done
    preuninstall scriptlet (using /bin/sh):
    if [ $1 -eq 0 ] ;then
     /usr/bin/systemctl -q is-active displaylink.service && /usr/bin/systemctl stop displaylink.service
     /sbin/dkms remove evdi/1.0.68 --all >> /var/log/displaylink/displaylink.log
    fi
    postuninstall scriptlet (using /bin/sh):
    /usr/bin/systemctl daemon-reload

    Triggers?:

    [root@xps13 ~]# rpm -qp --triggers displaylink-1.0.68-2.x86_64.rpm 
    [root@xps13 ~]#
  4. All good? ok, install the rpm:
    [root@xps13 ~]# rpm -ivh displaylink-1.0.68-2.x86_64.rpm 
    Preparing... ################################# [100%]
    Updating / installing...
     1:displaylink-1.0.68-2 ################################# [100%]
    [root@xps13 ~]#
  5. Verify that the module has been compiled correctly:
    [root@xps13 ~]# ll /lib/modules/$(uname -r)/extra/evdi.ko
    -rw-r--r--. 1 root root 63072 Aug 14 01:36 /lib/modules/4.1.4-200.fc22.x86_64/extra/evdi.ko
  6. That’s all! When you plug-in the adapter, the displaylink service should be started automatically:

screen

 

For those that prefer to do a manual install rather than using the rpm, here goes a step-by-step. Remember to install dkms and kernel-devel before starting this process, if you haven’t done yet.

  1. Download the tarball with the module files:
    [root@xps13 ~]# wget -q http://nothen.com.ar/resources/displaylink-1.0.68.txz
  2. Untar:
    [root@xps13 ~]# tar -xJvf displaylink-1.0.68.txz -C /
    usr/src/evdi-1.0.68/
    usr/src/evdi-1.0.68/evdi_drv.c
    usr/src/evdi-1.0.68/evdi_drv.h
    usr/src/evdi-1.0.68/evdi_connector.c
    usr/src/evdi-1.0.68/dkms.conf
    usr/src/evdi-1.0.68/evdi_painter.c
    usr/src/evdi-1.0.68/evdi_debug.c
    usr/src/evdi-1.0.68/evdi_modeset.c
    usr/src/evdi-1.0.68/evdi_ioctl.h
    usr/src/evdi-1.0.68/Kconfig
    usr/src/evdi-1.0.68/evdi_stats.c
    usr/src/evdi-1.0.68/Makefile
    usr/src/evdi-1.0.68/evdi.mod.c
    usr/src/evdi-1.0.68/evdi_debug.h
    usr/src/evdi-1.0.68/evdi_gem.c
    usr/src/evdi-1.0.68/evdi_encoder.c
    usr/src/evdi-1.0.68/evdi_main.c
    usr/src/evdi-1.0.68/LICENSE
    usr/src/evdi-1.0.68/evdi_fb.c
    usr/lib/displaylink/
    usr/lib/displaylink/firefly-monitor-release.spkg
    usr/lib/displaylink/DLInstrumentationDirectoryLock
    usr/lib/displaylink/DisplayLinkManager
    usr/lib/displaylink/libusb-1.0.so.0.1.0
    usr/lib/displaylink/libevdi.so
    usr/lib/displaylink/LICENSE
    var/log/displaylink/
    var/log/displaylink/displaylink.log
    etc/systemd/system/displaylink.service
    etc/udev/rules.d/99-displaylink.rules
    [root@xps13 ~]#
  3. Compile the module for the running kernel (optionally, you could compile for all installed kernels):
    [root@xps13 ~]# dkms install evdi/1.0.68
    
    Creating symlink /var/lib/dkms/evdi/1.0.68/source ->
     /usr/src/evdi-1.0.68
    
    DKMS: add completed.
    
    Kernel preparation unnecessary for this kernel. Skipping...
    
    Building module:
    cleaning build area...(bad exit status: 2)
    make KERNELRELEASE=4.1.4-200.fc22.x86_64 all INCLUDEDIR=/lib/modules/4.1.4-200.fc22.x86_64/build/include KVERSION=4.1.4-200.fc22.x86_64 DKMS_BUILD=1...
    cleaning build area...(bad exit status: 2)
    
    DKMS: build completed.
    
    evdi.ko:
    Running module version sanity check.
     - Original module
     - No original module exists within this kernel
     - Installation
     - Installing to /lib/modules/4.1.4-200.fc22.x86_64/extra/
    Adding any weak-modules
    
    depmod...
    
    DKMS: install completed.
    [root@xps13 ~]#

 

Same as with the RPM, remember to validate that the displaylink service is started when you plug-in the adapter, and that the dkms service is enabled and running, so that future kernel updates will recompile the kernel.

Leave a comment

Your email address will not be published. Required fields are marked *

174 thoughts on “Fedora support for DisplayLink adapters”