Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: add i915_ioc32.h for compat

Keep reducing i915_drv.h.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227170047.31089-1-jani.nikula@intel.com

+23 -8
+2 -1
drivers/gpu/drm/i915/i915_drv.c
··· 70 70 71 71 #include "i915_debugfs.h" 72 72 #include "i915_drv.h" 73 + #include "i915_ioc32.h" 73 74 #include "i915_irq.h" 74 75 #include "i915_memcpy.h" 75 76 #include "i915_perf.h" ··· 1763 1762 .mmap = i915_gem_mmap, 1764 1763 .poll = drm_poll, 1765 1764 .read = drm_read, 1766 - .compat_ioctl = i915_compat_ioctl, 1765 + .compat_ioctl = i915_ioc32_compat_ioctl, 1767 1766 .llseek = noop_llseek, 1768 1767 }; 1769 1768
-5
drivers/gpu/drm/i915/i915_drv.h
··· 1699 1699 } 1700 1700 1701 1701 /* i915_drv.c */ 1702 - #ifdef CONFIG_COMPAT 1703 - long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); 1704 - #else 1705 - #define i915_compat_ioctl NULL 1706 - #endif 1707 1702 extern const struct dev_pm_ops i915_pm_ops; 1708 1703 1709 1704 int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
+4 -2
drivers/gpu/drm/i915/i915_ioc32.c
··· 29 29 #include <linux/compat.h> 30 30 31 31 #include <drm/drm_ioctl.h> 32 + 32 33 #include "i915_drv.h" 34 + #include "i915_ioc32.h" 33 35 34 36 struct drm_i915_getparam32 { 35 37 s32 param; ··· 68 66 }; 69 67 70 68 /** 71 - * i915_compat_ioctl - handle the mistakes of the past 69 + * i915_ioc32_compat_ioctl - handle the mistakes of the past 72 70 * @filp: the file pointer 73 71 * @cmd: the ioctl command (and encoded flags) 74 72 * @arg: the ioctl argument (from userspace) ··· 76 74 * Called whenever a 32-bit process running under a 64-bit kernel 77 75 * performs an ioctl on /dev/dri/card<n>. 78 76 */ 79 - long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 77 + long i915_ioc32_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 80 78 { 81 79 unsigned int nr = DRM_IOCTL_NR(cmd); 82 80 drm_ioctl_compat_t *fn = NULL;
+17
drivers/gpu/drm/i915/i915_ioc32.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* 3 + * Copyright © 2020 Intel Corporation 4 + */ 5 + 6 + #ifndef __I915_IOC32_H__ 7 + #define __I915_IOC32_H__ 8 + 9 + #ifdef CONFIG_COMPAT 10 + struct file; 11 + long i915_ioc32_compat_ioctl(struct file *filp, unsigned int cmd, 12 + unsigned long arg); 13 + #else 14 + #define i915_ioc32_compat_ioctl NULL 15 + #endif 16 + 17 + #endif /* __I915_IOC32_H__ */