Evdi (Extensible Virtual Device Interface) is a kernel module developed by the DisplayLink team and the goal of it is to provide a virtual monitor device which processes can draw on. These devices are typically named like DVI-I-1-1 and can be listed by programs like xrandr.
This article is using the kernel version 5.15.19-gentoo with evdi version 1.10.0. Because the drm/drm_irq.h header file was [removed from kernel 5.14+], one can not install 1.9.1 version of evdi into newer kernels.
There is currently no evdi ebuild available in the official gentoo repository, but one can easily setup an alternative repositories to install a package from. These unofficial ebuild containers called overlays and one can add a new source with the eselect repository command:
eselect repository add brelod git https://github.com/brelod/gentoo-public
emerge -avt =evdi-1.10.0
This will create a directory at /usr/src/evdi-1.10.0 which contains the source code of the kernel module wich can be installed either manually or with the dkms tool. In this article we're going to use the second way.
dkms install evdi/1.10.0
To a kernel module - just like to any other programs - one can pass arguments, to modify the behavior. In case of modules these parameters are typically stored in a configuration file at /etc/modprobe.d/ or /lib/modprobe.d. The files in this director are scanned when a kernel module is loaded and the parameters (options) in it will be passed to the executable.
One can find information about the available parameters of a module by
modinfo evdi | grep parm
parm: initial_loglevel:Initial log level (int) parm: initial_device_count:Initial DRM device count (default: 0) (ushort) parm: disable_texture_import:Disable fast path GPU texture import (default: 0, set 1 to disable) (ushort)
Set the initial device count to 4 as default:
echo 'options evdi initial_device_count=4' > /etc/modprobe.d/evdi.conf
Load the module by
Check the newly available virtual display devices:
xrandr | grep DVI
DVI-I-4-4 disconnected (normal left inverted right x axis y axis) DVI-I-3-3 disconnected (normal left inverted right x axis y axis) DVI-I-2-2 disconnected (normal left inverted right x axis y axis) DVI-I-1-1 disconnected (normal left inverted right x axis y axis)