View | Details | Raw Unified | Return to bug 1043231
Collapse All | Expand All

(-)a/drivers/gpu/drm/ast/ast_drv.c (-2 lines)
Lines 188-196 static const struct file_operations ast_fops = { Link Here
188
	.unlocked_ioctl = drm_ioctl,
188
	.unlocked_ioctl = drm_ioctl,
189
	.mmap = ast_mmap,
189
	.mmap = ast_mmap,
190
	.poll = drm_poll,
190
	.poll = drm_poll,
191
#ifdef CONFIG_COMPAT
192
	.compat_ioctl = drm_compat_ioctl,
191
	.compat_ioctl = drm_compat_ioctl,
193
#endif
194
	.read = drm_read,
192
	.read = drm_read,
195
};
193
};
196
194
(-)a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c (-2 lines)
Lines 680-688 static const struct file_operations fops = { Link Here
680
	.open               = drm_open,
680
	.open               = drm_open,
681
	.release            = drm_release,
681
	.release            = drm_release,
682
	.unlocked_ioctl     = drm_ioctl,
682
	.unlocked_ioctl     = drm_ioctl,
683
#ifdef CONFIG_COMPAT
684
	.compat_ioctl       = drm_compat_ioctl,
683
	.compat_ioctl       = drm_compat_ioctl,
685
#endif
686
	.poll               = drm_poll,
684
	.poll               = drm_poll,
687
	.read               = drm_read,
685
	.read               = drm_read,
688
	.llseek             = no_llseek,
686
	.llseek             = no_llseek,
(-)a/drivers/gpu/drm/bochs/bochs_drv.c (-2 lines)
Lines 69-77 static const struct file_operations bochs_fops = { Link Here
69
	.open		= drm_open,
69
	.open		= drm_open,
70
	.release	= drm_release,
70
	.release	= drm_release,
71
	.unlocked_ioctl	= drm_ioctl,
71
	.unlocked_ioctl	= drm_ioctl,
72
#ifdef CONFIG_COMPAT
73
	.compat_ioctl	= drm_compat_ioctl,
72
	.compat_ioctl	= drm_compat_ioctl,
74
#endif
75
	.poll		= drm_poll,
73
	.poll		= drm_poll,
76
	.read		= drm_read,
74
	.read		= drm_read,
77
	.llseek		= no_llseek,
75
	.llseek		= no_llseek,
(-)a/drivers/gpu/drm/cirrus/cirrus_drv.c (-2 lines)
Lines 125-133 static const struct file_operations cirrus_driver_fops = { Link Here
125
	.unlocked_ioctl = drm_ioctl,
125
	.unlocked_ioctl = drm_ioctl,
126
	.mmap = cirrus_mmap,
126
	.mmap = cirrus_mmap,
127
	.poll = drm_poll,
127
	.poll = drm_poll,
128
#ifdef CONFIG_COMPAT
129
	.compat_ioctl = drm_compat_ioctl,
128
	.compat_ioctl = drm_compat_ioctl,
130
#endif
131
};
129
};
132
static struct drm_driver driver = {
130
static struct drm_driver driver = {
133
	.driver_features = DRIVER_MODESET | DRIVER_GEM,
131
	.driver_features = DRIVER_MODESET | DRIVER_GEM,
(-)a/drivers/gpu/drm/drm_fops.c (+39 lines)
Lines 44-49 Link Here
44
/* from BKL pushdown */
44
/* from BKL pushdown */
45
DEFINE_MUTEX(drm_global_mutex);
45
DEFINE_MUTEX(drm_global_mutex);
46
46
47
/**
48
 * DOC: file operations
49
 *
50
 * Drivers must define the file operations structure that forms the DRM
51
 * userspace API entry point, even though most of those operations are
52
 * implemented in the DRM core. The mandatory functions are drm_open(),
53
 * drm_read(), drm_ioctl() and drm_compat_ioctl() if CONFIG_COMPAT is enabled
54
 * (note that drm_compat_ioctl will be NULL if CONFIG_COMPAT=n). Drivers which
55
 * implement private ioctls that require 32/64 bit compatibility support must
56
 * provide their own .compat_ioctl() handler that processes private ioctls and
57
 * calls drm_compat_ioctl() for core ioctls.
58
 *
59
 * In addition drm_read() and drm_poll() provide support for DRM events. DRM
60
 * events are a generic and extensible means to send asynchronous events to
61
 * userspace through the file descriptor. They are used to send vblank event and
62
 * page flip completions by the KMS API. But drivers can also use it for their
63
 * own needs, e.g. to signal completion of rendering.
64
 *
65
 * The memory mapping implementation will vary depending on how the driver
66
 * manages memory. Legacy drivers will use the deprecated drm_legacy_mmap()
67
 * function, modern drivers should use one of the provided memory-manager
68
 * specific implementations. For GEM-based drivers this is drm_gem_mmap().
69
 *
70
 * No other file operations are supported by the DRM userspace API. Overall the
71
 * following is an example #file_operations structure::
72
 *
73
 *     static const example_drm_fops = {
74
 *             .owner = THIS_MODULE,
75
 *             .open = drm_open,
76
 *             .release = drm_release,
77
 *             .unlocked_ioctl = drm_ioctl,
78
 *             .compat_ioctl = drm_compat_ioctl, // NULL if CONFIG_COMPAT=n
79
 *             .poll = drm_poll,
80
 *             .read = drm_read,
81
 *             .llseek = no_llseek,
82
 *             .mmap = drm_gem_mmap,
83
 *     };
84
 */
85
47
static int drm_open_helper(struct file *filp, struct drm_minor *minor);
86
static int drm_open_helper(struct file *filp, struct drm_minor *minor);
48
87
49
static int drm_setup(struct drm_device * dev)
88
static int drm_setup(struct drm_device * dev)
(-)a/drivers/gpu/drm/exynos/exynos_drm_drv.c (-2 lines)
Lines 433-441 static const struct file_operations exynos_drm_driver_fops = { Link Here
433
	.poll		= drm_poll,
433
	.poll		= drm_poll,
434
	.read		= drm_read,
434
	.read		= drm_read,
435
	.unlocked_ioctl	= drm_ioctl,
435
	.unlocked_ioctl	= drm_ioctl,
436
#ifdef CONFIG_COMPAT
437
	.compat_ioctl = drm_compat_ioctl,
436
	.compat_ioctl = drm_compat_ioctl,
438
#endif
439
	.release	= drm_release,
437
	.release	= drm_release,
440
};
438
};
441
439
(-)a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c (-2 lines)
Lines 177-185 static const struct file_operations fsl_dcu_drm_fops = { Link Here
177
	.open		= drm_open,
177
	.open		= drm_open,
178
	.release	= drm_release,
178
	.release	= drm_release,
179
	.unlocked_ioctl	= drm_ioctl,
179
	.unlocked_ioctl	= drm_ioctl,
180
#ifdef CONFIG_COMPAT
181
	.compat_ioctl	= drm_compat_ioctl,
180
	.compat_ioctl	= drm_compat_ioctl,
182
#endif
183
	.poll		= drm_poll,
181
	.poll		= drm_poll,
184
	.read		= drm_read,
182
	.read		= drm_read,
185
	.llseek		= no_llseek,
183
	.llseek		= no_llseek,
(-)a/drivers/gpu/drm/gma500/psb_drv.c (-2 lines)
Lines 484-492 static const struct file_operations psb_gem_fops = { Link Here
484
	.open = drm_open,
484
	.open = drm_open,
485
	.release = drm_release,
485
	.release = drm_release,
486
	.unlocked_ioctl = psb_unlocked_ioctl,
486
	.unlocked_ioctl = psb_unlocked_ioctl,
487
#ifdef CONFIG_COMPAT
488
	.compat_ioctl = drm_compat_ioctl,
487
	.compat_ioctl = drm_compat_ioctl,
489
#endif
490
	.mmap = drm_gem_mmap,
488
	.mmap = drm_gem_mmap,
491
	.poll = drm_poll,
489
	.poll = drm_poll,
492
	.read = drm_read,
490
	.read = drm_read,
(-)a/drivers/gpu/drm/i810/i810_dma.c (-2 lines)
Lines 113-121 static const struct file_operations i810_buffer_fops = { Link Here
113
	.release = drm_release,
113
	.release = drm_release,
114
	.unlocked_ioctl = drm_ioctl,
114
	.unlocked_ioctl = drm_ioctl,
115
	.mmap = i810_mmap_buffers,
115
	.mmap = i810_mmap_buffers,
116
#ifdef CONFIG_COMPAT
117
	.compat_ioctl = drm_compat_ioctl,
116
	.compat_ioctl = drm_compat_ioctl,
118
#endif
119
	.llseek = noop_llseek,
117
	.llseek = noop_llseek,
120
};
118
};
121
119
(-)a/drivers/gpu/drm/i810/i810_drv.c (-2 lines)
Lines 49-57 static const struct file_operations i810_driver_fops = { Link Here
49
	.unlocked_ioctl = drm_ioctl,
49
	.unlocked_ioctl = drm_ioctl,
50
	.mmap = drm_legacy_mmap,
50
	.mmap = drm_legacy_mmap,
51
	.poll = drm_poll,
51
	.poll = drm_poll,
52
#ifdef CONFIG_COMPAT
53
	.compat_ioctl = drm_compat_ioctl,
52
	.compat_ioctl = drm_compat_ioctl,
54
#endif
55
	.llseek = noop_llseek,
53
	.llseek = noop_llseek,
56
};
54
};
57
55
(-)a/drivers/gpu/drm/i915/i915_drv.c (-2 lines)
Lines 1766-1774 static const struct file_operations i915_driver_fops = { Link Here
1766
	.mmap = drm_gem_mmap,
1766
	.mmap = drm_gem_mmap,
1767
	.poll = drm_poll,
1767
	.poll = drm_poll,
1768
	.read = drm_read,
1768
	.read = drm_read,
1769
#ifdef CONFIG_COMPAT
1770
	.compat_ioctl = i915_compat_ioctl,
1769
	.compat_ioctl = i915_compat_ioctl,
1771
#endif
1772
	.llseek = noop_llseek,
1770
	.llseek = noop_llseek,
1773
};
1771
};
1774
1772
(-)a/drivers/gpu/drm/i915/i915_drv.h (+2 lines)
Lines 2721-2726 extern void i915_driver_postclose(struct drm_device *dev, Link Here
2721
#ifdef CONFIG_COMPAT
2721
#ifdef CONFIG_COMPAT
2722
extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
2722
extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
2723
			      unsigned long arg);
2723
			      unsigned long arg);
2724
#else
2725
#define i915_compat_ioctl NULL
2724
#endif
2726
#endif
2725
extern int intel_gpu_reset(struct drm_device *dev);
2727
extern int intel_gpu_reset(struct drm_device *dev);
2726
extern bool intel_has_gpu_reset(struct drm_device *dev);
2728
extern bool intel_has_gpu_reset(struct drm_device *dev);
(-)a/drivers/gpu/drm/mgag200/mgag200_drv.c (-2 lines)
Lines 126-134 static const struct file_operations mgag200_driver_fops = { Link Here
126
	.unlocked_ioctl = drm_ioctl,
126
	.unlocked_ioctl = drm_ioctl,
127
	.mmap = mgag200_mmap,
127
	.mmap = mgag200_mmap,
128
	.poll = drm_poll,
128
	.poll = drm_poll,
129
#ifdef CONFIG_COMPAT
130
	.compat_ioctl = drm_compat_ioctl,
129
	.compat_ioctl = drm_compat_ioctl,
131
#endif
132
	.read = drm_read,
130
	.read = drm_read,
133
};
131
};
134
132
(-)a/drivers/gpu/drm/msm/msm_drv.c (-2 lines)
Lines 948-956 static const struct file_operations fops = { Link Here
948
	.open               = drm_open,
948
	.open               = drm_open,
949
	.release            = drm_release,
949
	.release            = drm_release,
950
	.unlocked_ioctl     = drm_ioctl,
950
	.unlocked_ioctl     = drm_ioctl,
951
#ifdef CONFIG_COMPAT
952
	.compat_ioctl       = drm_compat_ioctl,
951
	.compat_ioctl       = drm_compat_ioctl,
953
#endif
954
	.poll               = drm_poll,
952
	.poll               = drm_poll,
955
	.read               = drm_read,
953
	.read               = drm_read,
956
	.llseek             = no_llseek,
954
	.llseek             = no_llseek,
(-)a/drivers/gpu/drm/rcar-du/rcar_du_drv.c (-2 lines)
Lines 257-265 static const struct file_operations rcar_du_fops = { Link Here
257
	.open		= drm_open,
257
	.open		= drm_open,
258
	.release	= drm_release,
258
	.release	= drm_release,
259
	.unlocked_ioctl	= drm_ioctl,
259
	.unlocked_ioctl	= drm_ioctl,
260
#ifdef CONFIG_COMPAT
261
	.compat_ioctl	= drm_compat_ioctl,
260
	.compat_ioctl	= drm_compat_ioctl,
262
#endif
263
	.poll		= drm_poll,
261
	.poll		= drm_poll,
264
	.read		= drm_read,
262
	.read		= drm_read,
265
	.llseek		= no_llseek,
263
	.llseek		= no_llseek,
(-)a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c (-2 lines)
Lines 263-271 static const struct file_operations rockchip_drm_driver_fops = { Link Here
263
	.poll = drm_poll,
263
	.poll = drm_poll,
264
	.read = drm_read,
264
	.read = drm_read,
265
	.unlocked_ioctl = drm_ioctl,
265
	.unlocked_ioctl = drm_ioctl,
266
#ifdef CONFIG_COMPAT
267
	.compat_ioctl = drm_compat_ioctl,
266
	.compat_ioctl = drm_compat_ioctl,
268
#endif
269
	.release = drm_release,
267
	.release = drm_release,
270
};
268
};
271
269
(-)a/drivers/gpu/drm/savage/savage_drv.c (-2 lines)
Lines 42-50 static const struct file_operations savage_driver_fops = { Link Here
42
	.unlocked_ioctl = drm_ioctl,
42
	.unlocked_ioctl = drm_ioctl,
43
	.mmap = drm_legacy_mmap,
43
	.mmap = drm_legacy_mmap,
44
	.poll = drm_poll,
44
	.poll = drm_poll,
45
#ifdef CONFIG_COMPAT
46
	.compat_ioctl = drm_compat_ioctl,
45
	.compat_ioctl = drm_compat_ioctl,
47
#endif
48
	.llseek = noop_llseek,
46
	.llseek = noop_llseek,
49
};
47
};
50
48
(-)a/drivers/gpu/drm/shmobile/shmob_drm_drv.c (-2 lines)
Lines 252-260 static const struct file_operations shmob_drm_fops = { Link Here
252
	.open		= drm_open,
252
	.open		= drm_open,
253
	.release	= drm_release,
253
	.release	= drm_release,
254
	.unlocked_ioctl	= drm_ioctl,
254
	.unlocked_ioctl	= drm_ioctl,
255
#ifdef CONFIG_COMPAT
256
	.compat_ioctl	= drm_compat_ioctl,
255
	.compat_ioctl	= drm_compat_ioctl,
257
#endif
258
	.poll		= drm_poll,
256
	.poll		= drm_poll,
259
	.read		= drm_read,
257
	.read		= drm_read,
260
	.llseek		= no_llseek,
258
	.llseek		= no_llseek,
(-)a/drivers/gpu/drm/sis/sis_drv.c (-2 lines)
Lines 72-80 static const struct file_operations sis_driver_fops = { Link Here
72
	.unlocked_ioctl = drm_ioctl,
72
	.unlocked_ioctl = drm_ioctl,
73
	.mmap = drm_legacy_mmap,
73
	.mmap = drm_legacy_mmap,
74
	.poll = drm_poll,
74
	.poll = drm_poll,
75
#ifdef CONFIG_COMPAT
76
	.compat_ioctl = drm_compat_ioctl,
75
	.compat_ioctl = drm_compat_ioctl,
77
#endif
78
	.llseek = noop_llseek,
76
	.llseek = noop_llseek,
79
};
77
};
80
78
(-)a/drivers/gpu/drm/sti/sti_drv.c (-2 lines)
Lines 174-182 static const struct file_operations sti_driver_fops = { Link Here
174
	.poll = drm_poll,
174
	.poll = drm_poll,
175
	.read = drm_read,
175
	.read = drm_read,
176
	.unlocked_ioctl = drm_ioctl,
176
	.unlocked_ioctl = drm_ioctl,
177
#ifdef CONFIG_COMPAT
178
	.compat_ioctl = drm_compat_ioctl,
177
	.compat_ioctl = drm_compat_ioctl,
179
#endif
180
	.release = drm_release,
178
	.release = drm_release,
181
};
179
};
182
180
(-)a/drivers/gpu/drm/tdfx/tdfx_drv.c (-2 lines)
Lines 49-57 static const struct file_operations tdfx_driver_fops = { Link Here
49
	.unlocked_ioctl = drm_ioctl,
49
	.unlocked_ioctl = drm_ioctl,
50
	.mmap = drm_legacy_mmap,
50
	.mmap = drm_legacy_mmap,
51
	.poll = drm_poll,
51
	.poll = drm_poll,
52
#ifdef CONFIG_COMPAT
53
	.compat_ioctl = drm_compat_ioctl,
52
	.compat_ioctl = drm_compat_ioctl,
54
#endif
55
	.llseek = noop_llseek,
53
	.llseek = noop_llseek,
56
};
54
};
57
55
(-)a/drivers/gpu/drm/tegra/drm.c (-2 lines)
Lines 803-811 static const struct file_operations tegra_drm_fops = { Link Here
803
	.mmap = tegra_drm_mmap,
803
	.mmap = tegra_drm_mmap,
804
	.poll = drm_poll,
804
	.poll = drm_poll,
805
	.read = drm_read,
805
	.read = drm_read,
806
#ifdef CONFIG_COMPAT
807
	.compat_ioctl = drm_compat_ioctl,
806
	.compat_ioctl = drm_compat_ioctl,
808
#endif
809
	.llseek = noop_llseek,
807
	.llseek = noop_llseek,
810
};
808
};
811
809
(-)a/drivers/gpu/drm/tilcdc/tilcdc_drv.c (-2 lines)
Lines 543-551 static const struct file_operations fops = { Link Here
543
	.open               = drm_open,
543
	.open               = drm_open,
544
	.release            = drm_release,
544
	.release            = drm_release,
545
	.unlocked_ioctl     = drm_ioctl,
545
	.unlocked_ioctl     = drm_ioctl,
546
#ifdef CONFIG_COMPAT
547
	.compat_ioctl       = drm_compat_ioctl,
546
	.compat_ioctl       = drm_compat_ioctl,
548
#endif
549
	.poll               = drm_poll,
547
	.poll               = drm_poll,
550
	.read               = drm_read,
548
	.read               = drm_read,
551
	.llseek             = no_llseek,
549
	.llseek             = no_llseek,
(-)a/drivers/gpu/drm/udl/udl_drv.c (-2 lines)
Lines 30-38 static const struct file_operations udl_driver_fops = { Link Here
30
	.read = drm_read,
30
	.read = drm_read,
31
	.unlocked_ioctl	= drm_ioctl,
31
	.unlocked_ioctl	= drm_ioctl,
32
	.release = drm_release,
32
	.release = drm_release,
33
#ifdef CONFIG_COMPAT
34
	.compat_ioctl = drm_compat_ioctl,
33
	.compat_ioctl = drm_compat_ioctl,
35
#endif
36
	.llseek = noop_llseek,
34
	.llseek = noop_llseek,
37
};
35
};
38
36
(-)a/drivers/gpu/drm/vc4/vc4_drv.c (-2 lines)
Lines 59-67 static const struct file_operations vc4_drm_fops = { Link Here
59
	.mmap = vc4_mmap,
59
	.mmap = vc4_mmap,
60
	.poll = drm_poll,
60
	.poll = drm_poll,
61
	.read = drm_read,
61
	.read = drm_read,
62
#ifdef CONFIG_COMPAT
63
	.compat_ioctl = drm_compat_ioctl,
62
	.compat_ioctl = drm_compat_ioctl,
64
#endif
65
	.llseek = noop_llseek,
63
	.llseek = noop_llseek,
66
};
64
};
67
65
(-)a/drivers/gpu/drm/via/via_drv.c (-2 lines)
Lines 64-72 static const struct file_operations via_driver_fops = { Link Here
64
	.unlocked_ioctl = drm_ioctl,
64
	.unlocked_ioctl = drm_ioctl,
65
	.mmap = drm_legacy_mmap,
65
	.mmap = drm_legacy_mmap,
66
	.poll = drm_poll,
66
	.poll = drm_poll,
67
#ifdef CONFIG_COMPAT
68
	.compat_ioctl = drm_compat_ioctl,
67
	.compat_ioctl = drm_compat_ioctl,
69
#endif
70
	.llseek = noop_llseek,
68
	.llseek = noop_llseek,
71
};
69
};
72
70
(-)a/drivers/gpu/drm/virtio/virtgpu_drv.c (-2 lines)
Lines 108-116 static const struct file_operations virtio_gpu_driver_fops = { Link Here
108
	.read = drm_read,
108
	.read = drm_read,
109
	.unlocked_ioctl	= drm_ioctl,
109
	.unlocked_ioctl	= drm_ioctl,
110
	.release = drm_release,
110
	.release = drm_release,
111
#ifdef CONFIG_COMPAT
112
	.compat_ioctl = drm_compat_ioctl,
111
	.compat_ioctl = drm_compat_ioctl,
113
#endif
114
	.llseek = noop_llseek,
112
	.llseek = noop_llseek,
115
};
113
};
116
114
(-)a/include/drm/drmP.h (-1 / +5 lines)
Lines 915-922 static inline bool drm_is_primary_client(const struct drm_file *file_priv) Link Here
915
extern int drm_ioctl_permit(u32 flags, struct drm_file *file_priv);
915
extern int drm_ioctl_permit(u32 flags, struct drm_file *file_priv);
916
extern long drm_ioctl(struct file *filp,
916
extern long drm_ioctl(struct file *filp,
917
		      unsigned int cmd, unsigned long arg);
917
		      unsigned int cmd, unsigned long arg);
918
#ifdef CONFIG_COMPAT
918
extern long drm_compat_ioctl(struct file *filp,
919
extern long drm_compat_ioctl(struct file *filp,
919
			     unsigned int cmd, unsigned long arg);
920
			     unsigned int cmd, unsigned long arg);
921
#else
922
/* Let drm_compat_ioctl be assigned to .compat_ioctl unconditionally */
923
#define drm_compat_ioctl NULL
924
#endif
920
extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags);
925
extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags);
921
926
922
				/* Device support (drm_fops.h) */
927
				/* Device support (drm_fops.h) */
923
- 

Return to bug 1043231