# Compiling displaylink for use with USB displays

**URL:** <https://forums.suse.com/t/compiling-displaylink-for-use-with-usb-displays/41219>\
**Category:** SLED Hardware\
**Created:** [July 28, 2023, 4:26pm UTC](https://forums.suse.com/t/compiling-displaylink-for-use-with-usb-displays/41219 "2023-07-28T16:26:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JLT](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/jlt/32/10386_2.png) [@JLT](https://forums.suse.com/u/JLT)\
**Post date:** [July 28, 2023, 4:26pm UTC](https://forums.suse.com/t/compiling-displaylink-for-use-with-usb-displays/41219/1 "2023-07-28T16:26:19Z")

</div>

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](https://support.displaylink.com/knowledgebase/articles/543910-which-operating-systems-does-displaylink-currently)

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](https://github.com/displaylink-rpm/displaylink-rpm/issues/232)

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](https://software.opensuse.org/package/displaylink?search_term=DisplayLink)

---

<div class="post-metadata">

**Author:** ![malcolmlewis1](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis1/32/10022_2.png) [@malcolmlewis1](https://forums.suse.com/u/malcolmlewis1)\
**Post date:** [July 29, 2023, 3:24pm UTC](https://forums.suse.com/t/compiling-displaylink-for-use-with-usb-displays/41219/2 "2023-07-29T15:24:28Z")

</div>

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

```auto
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 */

```

---

<div class="post-metadata">

**Author:** ![malcolmlewis1](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis1/32/10022_2.png) [@malcolmlewis1](https://forums.suse.com/u/malcolmlewis1)\
**Post date:** [July 29, 2023, 4:09pm UTC](https://forums.suse.com/t/compiling-displaylink-for-use-with-usb-displays/41219/3 "2023-07-29T16:09:08Z")

</div>

@JLT Here is the build if wanting to use that… [https://build.opensuse.org/package/show/home:malcolmlewis:SLE\_15\_General/evdi](https://build.opensuse.org/package/show/home:malcolmlewis:SLE_15_General/evdi)
