Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:isgleas
displaylink-non-oss
Tumbleweed.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Tumbleweed.patch of Package displaylink-non-oss
From b884877267f11edaeb2a0f05201943e4252e22f2 Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez <rymg19@gmail.com> Date: Fri, 10 Jun 2022 20:35:18 -0500 Subject: [PATCH 1/6] Fix crashes with dmabufs not from external kernel modules In particular, when software rendering, it is entirely possible to have a dmabuf that did not come from an externally loaded kernel module. As a result, the owner field is NULL, and checking the owner's name segfaults. Tested on the Asahi Linux kernel, where software rendering is used. --- module/evdi_gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/evdi_gem.c b/module/evdi_gem.c index 4b3449e..22612c5 100644 --- a/module/evdi_gem.c +++ b/module/evdi_gem.c @@ -62,10 +62,10 @@ static bool evdi_was_called_by_mutter(void) static bool evdi_drm_gem_object_use_import_attach(struct drm_gem_object *obj) { - if (!obj || !obj->import_attach) + if (!obj || !obj->import_attach || !obj->import_attach->dmabuf->owner) return false; - return obj->import_attach && strcmp(obj->import_attach->dmabuf->owner->name, "amdgpu") != 0; + return strcmp(obj->import_attach->dmabuf->owner->name, "amdgpu") != 0; } uint32_t evdi_gem_object_handle_lookup(struct drm_file *filp, -- 2.38.0 From fce103b825b7b43540b8b5222f585a6a2f12587c Mon Sep 17 00:00:00 2001 From: Kevin Abraham <Kevin.Abraham@gtri.gatech.edu> Date: Tue, 14 Jun 2022 21:11:40 -0400 Subject: [PATCH 2/6] Fix build on RHEL 8.6 --- module/evdi_modeset.c | 14 +++++++------- module/evdi_painter.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/module/evdi_modeset.c b/module/evdi_modeset.c index cb5edbb..9ced209 100644 --- a/module/evdi_modeset.c +++ b/module/evdi_modeset.c @@ -29,7 +29,7 @@ #include "evdi_drm_drv.h" #include "evdi_cursor.h" #include "evdi_params.h" -#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE || defined(EL8) #include <drm/drm_gem_atomic_helper.h> #else #include <drm/drm_gem_framebuffer_helper.h> @@ -220,14 +220,14 @@ static const struct drm_crtc_funcs evdi_crtc_funcs = { }; static void evdi_plane_atomic_update(struct drm_plane *plane, -#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE || defined(EL8) struct drm_atomic_state *atom_state #else struct drm_plane_state *old_state #endif ) { -#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE || defined(EL8) struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(atom_state, plane); #else #endif @@ -318,14 +318,14 @@ static void evdi_cursor_atomic_get_rect(struct drm_clip_rect *rect, } static void evdi_cursor_atomic_update(struct drm_plane *plane, -#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE || defined(EL8) struct drm_atomic_state *atom_state #else struct drm_plane_state *old_state #endif ) { -#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE || defined(EL8) struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(atom_state, plane); #else #endif @@ -395,7 +395,7 @@ static void evdi_cursor_atomic_update(struct drm_plane *plane, static const struct drm_plane_helper_funcs evdi_plane_helper_funcs = { .atomic_update = evdi_plane_atomic_update, -#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE || defined(EL8) .prepare_fb = drm_gem_plane_helper_prepare_fb #else .prepare_fb = drm_gem_fb_prepare_fb @@ -404,7 +404,7 @@ static const struct drm_plane_helper_funcs evdi_plane_helper_funcs = { static const struct drm_plane_helper_funcs evdi_cursor_helper_funcs = { .atomic_update = evdi_cursor_atomic_update, -#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 13, 0) <= LINUX_VERSION_CODE || defined(EL8) .prepare_fb = drm_gem_plane_helper_prepare_fb #else .prepare_fb = drm_gem_fb_prepare_fb diff --git a/module/evdi_painter.c b/module/evdi_painter.c index eff8395..681019d 100644 --- a/module/evdi_painter.c +++ b/module/evdi_painter.c @@ -727,7 +727,7 @@ void evdi_painter_dpms_notify(struct evdi_device *evdi, int mode) static void evdi_log_pixel_format(uint32_t pixel_format, char *buf, size_t size) { -#if KERNEL_VERSION(5, 14, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 14, 0) <= LINUX_VERSION_CODE || defined(EL8) snprintf(buf, size, "pixel format %p4cc", &pixel_format); #else struct drm_format_name_buf format_name; -- 2.38.0 From 2dd909cf33cdc016c7987b85fcd14dd64727f20f Mon Sep 17 00:00:00 2001 From: "Michael L. Young" <elgueromexicano@gmail.com> Date: Thu, 21 Jul 2022 21:30:45 -0400 Subject: [PATCH 3/6] Fix Compiling On EL 8 Systems There are backports from newer kernels that have been put in the older kernels support by EL 8 based systems. This patch fixes compiling on such systems. --- module/evdi_drm_drv.c | 6 +++--- module/evdi_modeset.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/evdi_drm_drv.c b/module/evdi_drm_drv.c index 722cca7..f03825c 100644 --- a/module/evdi_drm_drv.c +++ b/module/evdi_drm_drv.c @@ -24,7 +24,7 @@ #if KERNEL_VERSION(5, 1, 0) <= LINUX_VERSION_CODE || defined(EL8) #include <drm/drm_probe_helper.h> #endif -#if KERNEL_VERSION(5, 8, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 8, 0) <= LINUX_VERSION_CODE || defined(EL8) #include <drm/drm_managed.h> #endif #include <drm/drm_atomic_helper.h> @@ -146,7 +146,7 @@ static struct drm_driver driver = { .patchlevel = DRIVER_PATCH, }; -#if KERNEL_VERSION(5, 8, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 8, 0) <= LINUX_VERSION_CODE || defined(EL8) static void evdi_drm_device_release_cb(__always_unused struct drm_device *dev, __always_unused void *ptr) { @@ -192,7 +192,7 @@ static int evdi_drm_device_setup(struct drm_device *dev) drm_kms_helper_poll_init(dev); -#if KERNEL_VERSION(5, 8, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 8, 0) <= LINUX_VERSION_CODE || defined(EL8) ret = drmm_add_action_or_reset(dev, evdi_drm_device_release_cb, NULL); if (ret) goto err_fb; diff --git a/module/evdi_modeset.c b/module/evdi_modeset.c index 9ced209..308691d 100644 --- a/module/evdi_modeset.c +++ b/module/evdi_modeset.c @@ -538,7 +538,7 @@ void evdi_modeset_init(struct drm_device *dev) void evdi_modeset_cleanup(__maybe_unused struct drm_device *dev) { -#if KERNEL_VERSION(5, 8, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 8, 0) <= LINUX_VERSION_CODE || defined(EL8) #else drm_mode_config_cleanup(dev); #endif -- 2.38.0 From 05d90fe65151e78fdba9d207100653ab14ccd9f0 Mon Sep 17 00:00:00 2001 From: "Michael L. Young" <elgueromexicano@gmail.com> Date: Thu, 21 Jul 2022 21:32:58 -0400 Subject: [PATCH 4/6] Add support for EL 9 systems --- module/Makefile | 9 +++++++-- module/evdi_drm_drv.c | 2 +- module/evdi_drm_drv.h | 2 +- module/evdi_gem.c | 4 ++-- module/evdi_ioc32.c | 14 +++++++------- module/evdi_modeset.c | 2 +- module/evdi_painter.c | 4 ++-- 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/module/Makefile b/module/Makefile index f346fd7..026ac09 100644 --- a/module/Makefile +++ b/module/Makefile @@ -11,6 +11,11 @@ ifneq (,$(findstring 1, $(EL8))) EL8FLAG := -DEL8 endif +EL9 := $(shell cat /etc/redhat-release 2>/dev/null | grep -c " 9." ) +ifneq (,$(findstring 1, $(EL9))) +EL9FLAG := -DEL9 +endif + Raspbian := $(shell grep -Eic 'raspb(erry|ian)' /proc/cpuinfo /etc/os-release 2>/dev/null ) ifeq (,$(findstring 0, $(Raspbian))) RPIFLAG := -DRPI @@ -22,7 +27,7 @@ ifneq ($(DKMS_BUILD),) KERN_DIR := /lib/modules/$(KERNELRELEASE)/build -ccflags-y := -Iinclude/drm $(EL8FLAG) $(RPIFLAG) +ccflags-y := -Iinclude/drm $(EL8FLAG) $(EL9FLAG) $(RPIFLAG) evdi-y := evdi_platform_drv.o evdi_platform_dev.o evdi_sysfs.o evdi_modeset.o evdi_connector.o evdi_encoder.o evdi_drm_drv.o evdi_fb.o evdi_gem.o evdi_painter.o evdi_params.o evdi_cursor.o evdi_debug.o evdi_i2c.o evdi-$(CONFIG_COMPAT) += evdi_ioc32.o obj-m := evdi.o @@ -45,7 +50,7 @@ ifneq ($(KERNELRELEASE),) # inside kbuild # Note: this can be removed once it is in kernel tree and Kconfig is properly used CONFIG_DRM_EVDI := m -ccflags-y := -isystem include/drm $(CFLAGS) $(EL8FLAG) $(RPIFLAG) +ccflags-y := -isystem include/drm $(CFLAGS) $(EL8FLAG) $(EL9FLAG) $(RPIFLAG) evdi-y := evdi_platform_drv.o evdi_platform_dev.o evdi_sysfs.o evdi_modeset.o evdi_connector.o evdi_encoder.o evdi_drm_drv.o evdi_fb.o evdi_gem.o evdi_painter.o evdi_params.o evdi_cursor.o evdi_debug.o evdi_i2c.o evdi-$(CONFIG_COMPAT) += evdi_ioc32.o obj-$(CONFIG_DRM_EVDI) := evdi.o diff --git a/module/evdi_drm_drv.c b/module/evdi_drm_drv.c index f03825c..0374161 100644 --- a/module/evdi_drm_drv.c +++ b/module/evdi_drm_drv.c @@ -12,7 +12,7 @@ */ #include <linux/version.h> -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE || defined(EL9) #include <drm/drm_ioctl.h> #include <drm/drm_file.h> #include <drm/drm_drv.h> diff --git a/module/evdi_drm_drv.h b/module/evdi_drm_drv.h index f9ed869..0899dd4 100644 --- a/module/evdi_drm_drv.h +++ b/module/evdi_drm_drv.h @@ -25,7 +25,7 @@ #else #include <drm/drmP.h> #endif -#if KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE || defined(EL9) #include <drm/drm_legacy.h> #else #include <drm/drm_irq.h> diff --git a/module/evdi_gem.c b/module/evdi_gem.c index 22612c5..4c14356 100644 --- a/module/evdi_gem.c +++ b/module/evdi_gem.c @@ -14,7 +14,7 @@ #elif KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE #include <linux/dma-buf-map.h> #endif -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE || defined(EL9) #include <drm/drm_prime.h> #include <drm/drm_file.h> #elif KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) @@ -27,7 +27,7 @@ #include <linux/dma-buf.h> #include <drm/drm_cache.h> -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE || defined(EL9) MODULE_IMPORT_NS(DMA_BUF); #endif diff --git a/module/evdi_ioc32.c b/module/evdi_ioc32.c index 6eae9ff..31ba142 100644 --- a/module/evdi_ioc32.c +++ b/module/evdi_ioc32.c @@ -22,7 +22,7 @@ #include <linux/compat.h> #include <linux/version.h> -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE || defined(EL9) #include <drm/drm_ioctl.h> #elif KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else @@ -62,10 +62,10 @@ static int compat_evdi_connect(struct file *file, if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) return -EFAULT; -#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE && KERNEL_VERSION(5, 14, 0) >= LINUX_VERSION_CODE || defined(EL8) - request = compat_alloc_user_space(sizeof(*request)); -#else +#if KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE || defined(EL9) request = kmalloc(sizeof(*request), GFP_USER); +#elif KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE || defined(EL8) + request = compat_alloc_user_space(sizeof(*request)); #endif #if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE || defined(EL8) if (!access_ok(request, sizeof(*request)) @@ -95,10 +95,10 @@ static int compat_evdi_grabpix(struct file *file, if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) return -EFAULT; -#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE && KERNEL_VERSION(5, 14, 0) >= LINUX_VERSION_CODE || defined(EL8) - request = compat_alloc_user_space(sizeof(*request)); -#else +#if KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE || defined(EL9) request = kmalloc(sizeof(*request), GFP_USER); +#elif KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE || defined(EL8) + request = compat_alloc_user_space(sizeof(*request)); #endif #if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE || defined(EL8) if (!access_ok(request, sizeof(*request)) diff --git a/module/evdi_modeset.c b/module/evdi_modeset.c index 308691d..23f22cb 100644 --- a/module/evdi_modeset.c +++ b/module/evdi_modeset.c @@ -12,7 +12,7 @@ */ #include <linux/version.h> -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE || defined(EL9) #include <drm/drm_vblank.h> #include <drm/drm_damage_helper.h> #elif KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE || defined(EL8) diff --git a/module/evdi_painter.c b/module/evdi_painter.c index 681019d..6b5b392 100644 --- a/module/evdi_painter.c +++ b/module/evdi_painter.c @@ -10,7 +10,7 @@ #include "linux/thread_info.h" #include "linux/mm.h" #include <linux/version.h> -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE || defined(EL9) #include <drm/drm_file.h> #include <drm/drm_vblank.h> #include <drm/drm_ioctl.h> @@ -31,7 +31,7 @@ #include <linux/dma-buf.h> -#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 16, 0) <= LINUX_VERSION_CODE || defined(EL9) MODULE_IMPORT_NS(DMA_BUF); #endif -- 2.38.0 From e034f773c6f2f7d925c93b3d5a7c8c84da33548a Mon Sep 17 00:00:00 2001 From: Andrea Righi <andrea.righi@canonical.com> Date: Wed, 27 Jul 2022 08:57:02 +0200 Subject: [PATCH 5/6] support USB-less systems Allow to use evdi in systems with USB support disabled. Signed-off-by: Andrea Righi <andrea.righi@canonical.com> --- module/evdi_platform_drv.c | 12 ++++++++++++ module/evdi_sysfs.c | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/module/evdi_platform_drv.c b/module/evdi_platform_drv.c index 1b802c3..8233e79 100644 --- a/module/evdi_platform_drv.c +++ b/module/evdi_platform_drv.c @@ -12,7 +12,9 @@ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/dma-mapping.h> +#ifdef CONFIG_USB_SUPPORT #include <linux/usb.h> +#endif #include "evdi_params.h" #include "evdi_debug.h" @@ -30,7 +32,9 @@ static struct evdi_platform_drv_context { struct device *root_dev; unsigned int dev_count; struct platform_device *devices[EVDI_DEVICE_COUNT_MAX]; +#ifdef CONFIG_USB_SUPPORT struct notifier_block usb_notifier; +#endif struct mutex lock; } g_ctx; @@ -40,6 +44,7 @@ static struct evdi_platform_drv_context { #define evdi_platform_drv_context_unlock(ctx) \ mutex_unlock(&ctx->lock) +#ifdef CONFIG_USB_SUPPORT static int evdi_platform_drv_usb(__always_unused struct notifier_block *nb, unsigned long action, void *data) @@ -69,6 +74,7 @@ static int evdi_platform_drv_usb(__always_unused struct notifier_block *nb, } return 0; } +#endif static int evdi_platform_drv_get_free_idx(struct evdi_platform_drv_context *ctx) { @@ -213,11 +219,15 @@ static int __init evdi_init(void) memset(&g_ctx, 0, sizeof(g_ctx)); g_ctx.root_dev = root_device_register(DRIVER_NAME); +#ifdef CONFIG_USB_SUPPORT g_ctx.usb_notifier.notifier_call = evdi_platform_drv_usb; +#endif mutex_init(&g_ctx.lock); dev_set_drvdata(g_ctx.root_dev, &g_ctx); +#ifdef CONFIG_USB_SUPPORT usb_register_notify(&g_ctx.usb_notifier); +#endif evdi_sysfs_init(g_ctx.root_dev); ret = platform_driver_register(&evdi_platform_driver); if (ret) @@ -238,7 +248,9 @@ static void __exit evdi_exit(void) if (!PTR_ERR_OR_ZERO(g_ctx.root_dev)) { evdi_sysfs_exit(g_ctx.root_dev); +#ifdef CONFIG_USB_SUPPORT usb_unregister_notify(&g_ctx.usb_notifier); +#endif dev_set_drvdata(g_ctx.root_dev, NULL); root_device_unregister(g_ctx.root_dev); } diff --git a/module/evdi_sysfs.c b/module/evdi_sysfs.c index 7f90d0d..a643434 100644 --- a/module/evdi_sysfs.c +++ b/module/evdi_sysfs.c @@ -51,6 +51,7 @@ struct evdi_usb_addr { struct usb_device *usb; }; +#ifdef CONFIG_USB_SUPPORT static int evdi_platform_device_attach(struct device *device, struct evdi_usb_addr *parent_addr); @@ -166,6 +167,16 @@ static int evdi_platform_device_attach(struct device *device, return evdi_platform_device_add(device, parent); } +#else /* !CONFIG_USB_SUPPORT */ + +static ssize_t add_device_with_usb_path(struct device *dev, + const char *buf, size_t count) +{ + return -EINVAL; +} + +#endif /* CONFIG_USB_SUPPORT */ + static ssize_t add_store(struct device *dev, __always_unused struct device_attribute *attr, const char *buf, size_t count) -- 2.38.0 From bdc258b25df4d00f222fde0e3c5003bf88ef17b5 Mon Sep 17 00:00:00 2001 From: Adam Tazul <71192298+SimPilotAdamT@users.noreply.github.com> Date: Thu, 13 Oct 2022 10:50:00 +0100 Subject: [PATCH 6/6] Add support for kernel 6.0 + a minor fix (#381) * Add support for kernel 6.0 Fixes #376 by implementing @Crashdummyy's fix as posted [here](https://github.com/DisplayLink/evdi/issues/376#issuecomment-1237450695) * Fixing the style used in evdi_painter.c * Update evdi_painter.c * drm_framebuffer is only included on 5.15 and later * drm_framebuffer is only included on 6.0.0 and later * drm_framebuffer is only included on 6.0.0 and later * drm_framebuffer is only included on 6.0.0 and later * drm_framebuffer is only included on 5.15.0 and later --- module/evdi_drm_drv.h | 2 +- module/evdi_painter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/evdi_drm_drv.h b/module/evdi_drm_drv.h index 0899dd4..4914da3 100644 --- a/module/evdi_drm_drv.h +++ b/module/evdi_drm_drv.h @@ -26,7 +26,7 @@ #include <drm/drmP.h> #endif #if KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE || defined(EL9) -#include <drm/drm_legacy.h> +#include <drm/drm_framebuffer.h> #else #include <drm/drm_irq.h> #endif diff --git a/module/evdi_painter.c b/module/evdi_painter.c index 6b5b392..f40e55a 100644 --- a/module/evdi_painter.c +++ b/module/evdi_painter.c @@ -885,7 +885,7 @@ evdi_painter_connect(struct evdi_device *evdi, painter_lock(painter); - evdi->pixel_area_limit = pixel_area_limit; + evdi->pixel_area_limit = pixel_area_limit; evdi->pixel_per_second_limit = pixel_per_second_limit; painter->drm_filp = file; kfree(painter->edid); -- 2.38.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor