Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:isgleas
displaylink-non-oss
Tubleweed2.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Tubleweed2.patch of Package displaylink-non-oss
From 273fbb0a67eca5f60fd2aaab0e25076dae4d8a3a Mon Sep 17 00:00:00 2001 From: Michael Teuscher <michael.teuscher@pm.me> Date: Sun, 26 Sep 2021 13:02:25 +0200 Subject: [PATCH] Remove compat calls for 5.15 kernel --- module/Makefile | 2 - module/evdi_drm_drv.c | 3 - module/evdi_drm_drv.h | 5 -- module/evdi_ioc32.c | 143 ------------------------------------------ 4 files changed, 153 deletions(-) delete mode 100644 module/evdi_ioc32.c diff --git a/module/Makefile b/module/Makefile index 824fb83..111430a 100644 --- a/module/Makefile +++ b/module/Makefile @@ -19,7 +19,6 @@ KERN_DIR := /lib/modules/$(KERNELRELEASE)/build ccflags-y := -Iinclude/drm $(EL8FLAG) 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 KBUILD_VERBOSE ?= 1 @@ -43,7 +42,6 @@ CONFIG_DRM_EVDI := m LINUXINCLUDE := $(subst -I,-isystem,$(LINUXINCLUDE)) ccflags-y := -isystem include/drm $(CFLAGS) $(EL8FLAG) 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 else diff --git a/module/evdi_drm_drv.c b/module/evdi_drm_drv.c index 8d2afcd..8a82bb7 100644 --- a/module/evdi_drm_drv.c +++ b/module/evdi_drm_drv.c @@ -58,9 +58,6 @@ static const struct file_operations evdi_driver_fops = { .read = drm_read, .unlocked_ioctl = drm_ioctl, .release = drm_release, -#ifdef CONFIG_COMPAT - .compat_ioctl = evdi_compat_ioctl, -#endif .llseek = noop_llseek, }; diff --git a/module/evdi_drm_drv.h b/module/evdi_drm_drv.h index a862638..328f56e 100644 --- a/module/evdi_drm_drv.h +++ b/module/evdi_drm_drv.h @@ -20,7 +20,6 @@ #include <drm/drm_drv.h> #include <drm/drm_fourcc.h> #include <drm/drm_ioctl.h> -#include <drm/drm_irq.h> #include <drm/drm_vblank.h> #else #include <drm/drmP.h> @@ -92,10 +91,6 @@ int evdi_driver_open(struct drm_device *drm_dev, struct drm_file *file); void evdi_driver_preclose(struct drm_device *dev, struct drm_file *file_priv); void evdi_driver_postclose(struct drm_device *dev, struct drm_file *file_priv); -#ifdef CONFIG_COMPAT -long evdi_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); -#endif - #ifdef CONFIG_FB int evdi_fbdev_init(struct drm_device *dev); void evdi_fbdev_cleanup(struct drm_device *dev); diff --git a/module/evdi_ioc32.c b/module/evdi_ioc32.c deleted file mode 100644 index 5036efb..0000000 --- a/module/evdi_ioc32.c +++ /dev/null @@ -1,143 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * evdi_ioc32.c - * - * Copyright (c) 2016 The Chromium OS Authors - * Copyright (c) 2017 - 2020 DisplayLink (UK) Ltd. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include <linux/compat.h> - -#include <linux/version.h> -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) -#else -#include <drm/drmP.h> -#endif -#include <drm/drm_edid.h> -#include "evdi_drm.h" - -#include "evdi_drm_drv.h" - -struct drm_evdi_connect32 { - int32_t connected; - int32_t dev_index; - uint32_t edid_ptr32; - uint32_t edid_length; - uint32_t sku_area_limit; -}; - -struct drm_evdi_grabpix32 { - uint32_t mode; - int32_t buf_width; - int32_t buf_height; - int32_t buf_byte_stride; - uint32_t buffer_ptr32; - int32_t num_rects; - uint32_t rects_ptr32; -}; - -static int compat_evdi_connect(struct file *file, - unsigned int __always_unused cmd, - unsigned long arg) -{ - struct drm_evdi_connect32 req32; - struct drm_evdi_connect __user *request; - - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; - - request = compat_alloc_user_space(sizeof(*request)); -#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE || defined(EL8) - if (!access_ok(request, sizeof(*request)) -#else - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) -#endif - || __put_user(req32.connected, &request->connected) - || __put_user(req32.dev_index, &request->dev_index) - || __put_user((void __user *)(unsigned long)req32.edid_ptr32, - &request->edid) - || __put_user(req32.edid_length, &request->edid_length) - || __put_user(req32.sku_area_limit, &request->sku_area_limit)) - return -EFAULT; - - return drm_ioctl(file, DRM_IOCTL_EVDI_CONNECT, - (unsigned long)request); -} - -static int compat_evdi_grabpix(struct file *file, - unsigned int __always_unused cmd, - unsigned long arg) -{ - struct drm_evdi_grabpix32 req32; - struct drm_evdi_grabpix __user *request; - - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; - - request = compat_alloc_user_space(sizeof(*request)); -#if KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE || defined(EL8) - if (!access_ok(request, sizeof(*request)) -#else - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) -#endif - || __put_user(req32.mode, &request->mode) - || __put_user(req32.buf_width, &request->buf_width) - || __put_user(req32.buf_height, &request->buf_height) - || __put_user(req32.buf_byte_stride, &request->buf_byte_stride) - || __put_user((void __user *)(unsigned long)req32.buffer_ptr32, - &request->buffer) - || __put_user(req32.num_rects, &request->num_rects) - || __put_user((void __user *)(unsigned long)req32.rects_ptr32, - &request->rects)) - return -EFAULT; - - return drm_ioctl(file, DRM_IOCTL_EVDI_GRABPIX, - (unsigned long)request); -} - -static drm_ioctl_compat_t *evdi_compat_ioctls[] = { - [DRM_EVDI_CONNECT] = compat_evdi_connect, - [DRM_EVDI_GRABPIX] = compat_evdi_grabpix, -}; - -/** - * Called whenever a 32-bit process running under a 64-bit kernel - * performs an ioctl on /dev/dri/card<n>. - * - * \param filp file pointer. - * \param cmd command. - * \param arg user argument. - * \return zero on success or negative number on failure. - */ -long evdi_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) -{ - unsigned int nr = DRM_IOCTL_NR(cmd); - drm_ioctl_compat_t *fn = NULL; - int ret; - - if (nr < DRM_COMMAND_BASE || nr >= DRM_COMMAND_END) - return drm_compat_ioctl(filp, cmd, arg); - - if (nr < DRM_COMMAND_BASE + ARRAY_SIZE(evdi_compat_ioctls)) - fn = evdi_compat_ioctls[nr - DRM_COMMAND_BASE]; - - if (fn != NULL) - ret = (*fn) (filp, cmd, arg); - else - ret = drm_ioctl(filp, cmd, arg); - - return ret; -}
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