XenevaOS
Loading...
Searching...
No Matches
drm_ioctl.h
Go to the documentation of this file.
1/*
2 * Internal Header for the Direct Rendering Manager
3 *
4 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
6 * Copyright (c) 2009-2010, Code Aurora Forum.
7 * All rights reserved.
8 *
9 * Author: Rickard E. (Rik) Faith <faith@valinux.com>
10 * Author: Gareth Hughes <gareth@valinux.com>
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice (including the next
20 * paragraph) shall be included in all copies or substantial portions of the
21 * Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29 * OTHER DEALINGS IN THE SOFTWARE.
30 */
31
32#ifndef _DRM_IOCTL_H_
33#define _DRM_IOCTL_H_
34
35#include <linux/types.h>
36#include <linux/bitops.h>
37
38#include <asm/ioctl.h>
39
40struct drm_device;
41struct drm_file;
42struct file;
43
54typedef int drm_ioctl_t(struct drm_device *dev, void *data,
55 struct drm_file *file_priv);
56
67typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
68 unsigned long arg);
69
70#define DRM_IOCTL_NR(n) _IOC_NR(n)
71#define DRM_IOCTL_TYPE(n) _IOC_TYPE(n)
72#define DRM_MAJOR 226
73
123
135 unsigned int cmd;
138 const char *name;
139};
140
151#define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \
152 [DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = { \
153 .cmd = DRM_IOCTL_##ioctl, \
154 .func = _func, \
155 .flags = _flags, \
156 .name = #ioctl \
157 }
158
159/*
160 * DCL delta -- `uintptr_t`, not mainline's `unsigned long`.
161 *
162 * arg is the caller's ioctl pointer (DRM_IOCTL_VERSION passes the address
163 * of its struct drm_version, for example). This target is
164 * aarch64-unknown-windows, which is LLP64 (sizeof(long) == 4), so
165 * mainline's spelling would carry only the low half of the address; apps
166 * here link at 0x600000000. The vendored definition in
167 * drivers/gpu/drm/drm_ioctl.c carries the same delta, and
168 * DCL/linux_cdev_shim.c's ioctl_fn typedef
169 * follows so the call does not narrow at the ABI boundary.
170 */
171long drm_ioctl(struct file *filp, unsigned int cmd, uintptr_t arg);
172long drm_ioctl_kernel(struct file *, drm_ioctl_t, void *, u32);
173#ifdef CONFIG_COMPAT
174long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
175#else
176/* Let drm_compat_ioctl be assigned to .compat_ioctl unconditionally */
177#define drm_compat_ioctl NULL
178#endif
179bool drm_ioctl_flags(unsigned int nr, unsigned int *flags);
180
181int drm_noop(struct drm_device *dev, void *data,
182 struct drm_file *file_priv);
184 struct drm_file *file_priv);
185
186#endif /* _DRM_IOCTL_H_ */
unsigned int uintptr_t
Definition stdint.h:94
uint8_t flags
Definition virtio.h:0
#define BIT(nr)
Definition bitops.h:112
int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, unsigned long arg)
Definition drm_ioctl.h:67
long drm_ioctl(struct file *filp, unsigned int cmd, uintptr_t arg)
long drm_ioctl_kernel(struct file *, drm_ioctl_t, void *, u32)
int drm_noop(struct drm_device *dev, void *data, struct drm_file *file_priv)
#define drm_compat_ioctl
Definition drm_ioctl.h:177
drm_ioctl_flags
Definition drm_ioctl.h:80
@ DRM_RENDER_ALLOW
Definition drm_ioctl.h:121
@ DRM_AUTH
Definition drm_ioctl.h:88
@ DRM_ROOT_ONLY
Definition drm_ioctl.h:111
@ DRM_MASTER
Definition drm_ioctl.h:100
int drm_invalid_op(struct drm_device *dev, void *data, struct drm_file *file_priv)
int drm_ioctl_t(struct drm_device *dev, void *data, struct drm_file *file_priv)
Definition drm_ioctl.h:54
const struct device * dev
Definition drm_print.h:519
void * data
Definition kthread.h:30
uint32_t u32
Definition kernel.h:16
Definition drm_device.h:75
Definition drm_file.h:165
Definition drm_ioctl.h:134
unsigned int cmd
Definition drm_ioctl.h:135
drm_ioctl_t * func
Definition drm_ioctl.h:137
const char * name
Definition drm_ioctl.h:138
enum drm_ioctl_flags flags
Definition drm_ioctl.h:136
Definition fs.h:142