Compiling displaylink for use with USB displays

Hey,

Help is welcome. As owner of a super handy USB screen I seek to install displaylink/evdi on SLED 15.5

Which operating systems does DisplayLink currently support? – DisplayLink Support

However, this is the typical ordeal as with almost any other distro outside of Ubuntu.

Working with Rocky/RHEL9.X i managed to get the rpm to compile with minor modifcation.

install fail on Rocky Linux 9.1 , root cause identified + patch proposed in issue · Issue #232 · displaylink-rpm/displaylink-rpm · GitHub

root cause dma-buf-map.h is now iosys-map
solution changes required in just one file evdi_gem.c

  1. rename dma-buf-map.h to iosys-map.h
  2. change dma_buf_map to iosys_map
  3. change DMA_BUF_MAP_INIT_VADDR to IOSYS_MAP_INIT_VADDR

Not with SLED 15.5 though; code for evdi/displaylink appears to have changed even more, the OpenSuse repo packages all fail to install and i don’t find the work around to have it compile.

https://software.opensuse.org/package/displaylink?search_term=DisplayLink

@JLT Here’s a quick patch for the 1.14.0 evdi version…

diff -Nuar a/module/evdi_drm_drv.h b/module/evdi_drm_drv.h
--- a/module/evdi_drm_drv.h	2023-05-16 07:47:57.000000000 -0500
+++ b/module/evdi_drm_drv.h	2023-07-29 10:10:30.139876763 -0500
@@ -26,7 +26,7 @@
 #else
 #include <drm/drmP.h>
 #endif
-#if KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE || defined(EL8) || defined(EL9)
+#if KERNEL_VERSION(5, 14, 0) <= LINUX_VERSION_CODE
 #include <drm/drm_framebuffer.h>
 #else
 #include <drm/drm_irq.h>
diff -Nuar a/module/evdi_gem.c b/module/evdi_gem.c
--- a/module/evdi_gem.c	2023-05-16 07:47:57.000000000 -0500
+++ b/module/evdi_gem.c	2023-07-29 10:21:48.032411571 -0500
@@ -10,10 +10,7 @@
 
 #include <linux/sched.h>
 #include <linux/version.h>
-#if KERNEL_VERSION(5, 18, 0) <= LINUX_VERSION_CODE || defined(EL8) || defined(EL9)
-#elif KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
-#include <linux/dma-buf-map.h>
-#endif
+#include <linux/iosys-map.h>
 #if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE || defined(EL9)
 #include <drm/drm_prime.h>
 #include <drm/drm_file.h>
@@ -292,7 +289,7 @@
 #if KERNEL_VERSION(5, 18, 0) <= LINUX_VERSION_CODE || defined(EL8) || defined(EL9)
 		struct iosys_map map = IOSYS_MAP_INIT_VADDR(NULL);
 #elif KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
-		struct dma_buf_map map = DMA_BUF_MAP_INIT_VADDR(NULL);
+		struct iosys_map map = IOSYS_MAP_INIT_VADDR(NULL);
 #endif
 
 #if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
@@ -333,12 +330,12 @@
 		dma_buf_vunmap(obj->base.import_attach->dmabuf, &map);
 
 #elif KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE || defined(EL8)
-		struct dma_buf_map map;
+		struct iosys_map map;
 
 		if (obj->vmap_is_iomem)
-			dma_buf_map_set_vaddr_iomem(&map, obj->vmapping);
+			iosys_map_set_vaddr_iomem(&map, obj->vmapping);
 		else
-			dma_buf_map_set_vaddr(&map, obj->vmapping);
+			iosys_map_set_vaddr(&map, obj->vmapping);
 
 		dma_buf_vunmap(obj->base.import_attach->dmabuf, &map);
 #else
diff -Nuar a/module/evdi_params.h b/module/evdi_params.h
--- a/module/evdi_params.h	2023-05-16 07:47:57.000000000 -0500
+++ b/module/evdi_params.h	2023-07-29 10:13:36.520544757 -0500
@@ -12,4 +12,7 @@
 extern unsigned int evdi_loglevel;
 extern unsigned short int evdi_initial_device_count;
 
+#include <linux/module.h>
+MODULE_IMPORT_NS(DMA_BUF);
+
 #endif /* EVDI_PARAMS_H */

@JLT Here is the build if wanting to use that… https://build.opensuse.org/package/show/home:malcolmlewis:SLE_15_General/evdi