xref: /linux/drivers/gpu/drm/nouveau/include/nvif/ioctl.h (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVIF_IOCTL_H__
3 #define __NVIF_IOCTL_H__
4 
5 struct nvif_ioctl_v0 {
6 	__u8  version;
7 #define NVIF_IOCTL_V0_SCLASS                                               0x01
8 #define NVIF_IOCTL_V0_NEW                                                  0x02
9 #define NVIF_IOCTL_V0_DEL                                                  0x03
10 #define NVIF_IOCTL_V0_MTHD                                                 0x04
11 #define NVIF_IOCTL_V0_MAP                                                  0x07
12 #define NVIF_IOCTL_V0_UNMAP                                                0x08
13 	__u8  type;
14 	__u8  pad02[4];
15 #define NVIF_IOCTL_V0_OWNER_NVIF                                           0x00
16 #define NVIF_IOCTL_V0_OWNER_ANY                                            0xff
17 	__u8  owner;
18 #define NVIF_IOCTL_V0_ROUTE_NVIF                                           0x00
19 #define NVIF_IOCTL_V0_ROUTE_HIDDEN                                         0xff
20 	__u8  route;
21 	__u64 token;
22 	__u64 object;
23 	__u8  data[];		/* ioctl data (below) */
24 };
25 
26 struct nvif_ioctl_sclass_v0 {
27 	/* nvif_ioctl ... */
28 	__u8  version;
29 	__u8  count;
30 	__u8  pad02[6];
31 	struct nvif_ioctl_sclass_oclass_v0 {
32 		__s32 oclass;
33 		__s16 minver;
34 		__s16 maxver;
35 	} oclass[];
36 };
37 
38 struct nvif_ioctl_new_v0 {
39 	/* nvif_ioctl ... */
40 	__u8  version;
41 	__u8  pad01[6];
42 	__u8  route;
43 	__u64 token;
44 	__u64 object;
45 	__u32 handle;
46 	__s32 oclass;
47 	__u8  data[];		/* class data (class.h) */
48 };
49 
50 struct nvif_ioctl_del {
51 };
52 
53 struct nvif_ioctl_mthd_v0 {
54 	/* nvif_ioctl ... */
55 	__u8  version;
56 	__u8  method;
57 	__u8  pad02[6];
58 	__u8  data[];		/* method data (class.h) */
59 };
60 
61 struct nvif_ioctl_map_v0 {
62 	/* nvif_ioctl ... */
63 	__u8  version;
64 #define NVIF_IOCTL_MAP_V0_IO                                               0x00
65 #define NVIF_IOCTL_MAP_V0_VA                                               0x01
66 	__u8  type;
67 	__u8  pad02[6];
68 	__u64 handle;
69 	__u64 length;
70 	__u8  data[];
71 };
72 
73 struct nvif_ioctl_unmap {
74 };
75 #endif
76