HowTo build Displaylink driver for OpenSuse Tumbleweed with latest kernel

OpenSuse Tumbleweed

New laptop, new dock, latest software…great, isn’t it? I always like those “fresh starts” with new hardware and a new setup. Not only because you have cool new hardware, but also, because it’s a possibility to cut off old pigtails. And, you then have best performance and security with latest software…

Well, if there wouldn’t be commercial software for hardware drivers.

With my new ThinkPad, I’m using a USB-C dock and therefore planned to connect my external monitors to this dock.

The specific USB-C dock I’ve got, a Thinkpad Dock 40AF (without knowing the problem), uses a DisplayLink chip internally, for all non-USB connectors. Similar as in the figure below (Source). For the 40AF, DisplayLink is used for all graphic ports, so the DisplayPort and the HDMI.

DisplayLink block diagram

Consequently, I need to install the DisplayLink driver on my OpenSuse Tumbleweed system.

First, the DisplayLink driver isn’t open source and therefore can’t be integrated in the driver (read e.g. here). Hence, everyone needs to install it separately, because non-commercial use is allowed.

Next, the DisplayLink company is supporting Ubuntu, but that’s not Linux and I won’t switch the distribution just for that. The free alternative, udl, which is a re-written open source driver for DisplayLink that is included in the kernel, didn’t work for me. And even if it would, there are various performance issues. Another alternative, the displaylink-rpm (a great effort by the community, btw) isn’t/wasn’t compatible with my kernel (the latest 5.6), sadly.

As a summary, I had to build the DisplayLink driver by myself.

Actually, the DisplayLink driver consists of two components: the evdi kernel module and the displaylink package (including DisplayLinkManger etc.).

I had to search quite some time (especially this, this, and this posts/threads were helpful) and needed several attempts, but here are the steps to successfully install evdi and displaylink on OpenSuse Tumbleweed with kernel 5.6:

1. Preparation

Since udl didn’t work for me and could create some troubles in combination with evdi, I blacklisted it. Hence, I inserted blacklist udl in /etc/modprobe.d/98_no_udl.conf.

Next, I needed some libraries:

zypper install libdrm-devel kernel-sources

(Default development tools are also required, of course).

2. Build evdi kernel module

At the time as I needed it, there was no release that included kernel 5.6. Therefore, I build it from the latest git commit:

$ git clone https://github.com/DisplayLink/evdi.git
$ cd evdi
$ make 
$ make install
$ cd module
$ su 
$ rm -rf /usr/src/evdi-* # to remove previous attempts
$ mkdir /usr/src/evdi-1.6.4
$ mv * /usr/src/evdi-1.6.4/
$ dkms add -m evdi/1.6.4
# in case of: "Error! DKMS tree already contains: evdi-1.6.4 \
# You cannot add the same module/version combo more than once."
# execute: dkms remove evdi/1.6.4 --all
$ dkms add -m evdi/1.6.4
$ dkms install evdi/1.6.4
$ modprobe evdi  # should now work without errors...

The reason, why displaylink-rpm alone didn’t work for me was the incompatibility of the included evdi module version with kernel 5.6. That’s why I needed to compile and install evdi before in a separate way. Otherwise, the installation of the rpm would fail because modprobe evdi fails.

Since I installed evdi before, I could now build and install the displaylink package:

$ git clone https://github.com/displaylink-rpm/displaylink-rpm.git
$ cd displaylink-rpm
$ make
$ sudo zypper install x86_64/displaylink-1.6.4-2.x86_64.rpm

4. Modifications for AMD GPUs

I’m happy to have a ThinkPad with AMD Vega GPU, hence I also want to use it. Therefore, I modified /etc/X11/xorg.conf.d/20-displaylink.conf based on this helpful post:

# add in the beginning
Section "Device"
    Identifier "AMDGPU"
    Driver "amdgpu"
    Option "kmsdev" "/dev/dri/card0"
    Option "PageFlip" "off"
    Option "SWCursor" "on"
    Option "ShadowFB" "true"
EndSection

For me, this modification also fixed the crash of the graphical session when I connected the USB-C dock the first time after a reboot.

Alternative Solution

Buy another Dock. I didn’t get the advantages of the DisplayLink “compression protocol” yet. Especially with USB 3.1 gen 2 or Thunderboldt 3.

Since the Displaylink driver eats sometimes a lot of CPU cycles, the best solution in the long run would be to get rid of this kind of Docks, IMHO.

Finally…

I hope this HowTo helps others with the same issue to get to a working system in a shorter period of time. I also hope I didn’t forget some steps from my earlier attempts that were important…in that case (and in all other cases ;) ), I would be happy to hear from you.

You have another opinion?
Great! Then let's reduce the fallacy together!

   

Why are there no comments?