xref: /linux/drivers/gpu/drm/nouveau/include/nvif/if000c.h (revision b8265621f4888af9494e1d685620871ec81bc33d)
1 #ifndef __NVIF_IF000C_H__
2 #define __NVIF_IF000C_H__
3 struct nvif_vmm_v0 {
4 	__u8  version;
5 	__u8  page_nr;
6 	__u8  managed;
7 	__u8  pad03[5];
8 	__u64 addr;
9 	__u64 size;
10 	__u8  data[];
11 };
12 
13 #define NVIF_VMM_V0_PAGE                                                   0x00
14 #define NVIF_VMM_V0_GET                                                    0x01
15 #define NVIF_VMM_V0_PUT                                                    0x02
16 #define NVIF_VMM_V0_MAP                                                    0x03
17 #define NVIF_VMM_V0_UNMAP                                                  0x04
18 #define NVIF_VMM_V0_PFNMAP                                                 0x05
19 #define NVIF_VMM_V0_PFNCLR                                                 0x06
20 #define NVIF_VMM_V0_MTHD(i)                                         ((i) + 0x80)
21 
22 struct nvif_vmm_page_v0 {
23 	__u8  version;
24 	__u8  index;
25 	__u8  shift;
26 	__u8  sparse;
27 	__u8  vram;
28 	__u8  host;
29 	__u8  comp;
30 	__u8  pad07[1];
31 };
32 
33 struct nvif_vmm_get_v0 {
34 	__u8  version;
35 #define NVIF_VMM_GET_V0_ADDR                                               0x00
36 #define NVIF_VMM_GET_V0_PTES                                               0x01
37 #define NVIF_VMM_GET_V0_LAZY	                                           0x02
38 	__u8  type;
39 	__u8  sparse;
40 	__u8  page;
41 	__u8  align;
42 	__u8  pad05[3];
43 	__u64 size;
44 	__u64 addr;
45 };
46 
47 struct nvif_vmm_put_v0 {
48 	__u8  version;
49 	__u8  pad01[7];
50 	__u64 addr;
51 };
52 
53 struct nvif_vmm_map_v0 {
54 	__u8  version;
55 	__u8  pad01[7];
56 	__u64 addr;
57 	__u64 size;
58 	__u64 memory;
59 	__u64 offset;
60 	__u8  data[];
61 };
62 
63 struct nvif_vmm_unmap_v0 {
64 	__u8  version;
65 	__u8  pad01[7];
66 	__u64 addr;
67 };
68 
69 struct nvif_vmm_pfnmap_v0 {
70 	__u8  version;
71 	__u8  page;
72 	__u8  pad02[6];
73 	__u64 addr;
74 	__u64 size;
75 #define NVIF_VMM_PFNMAP_V0_ADDR                           0xfffffffffffff000ULL
76 #define NVIF_VMM_PFNMAP_V0_ADDR_SHIFT                                        12
77 #define NVIF_VMM_PFNMAP_V0_APER                           0x00000000000000f0ULL
78 #define NVIF_VMM_PFNMAP_V0_HOST                           0x0000000000000000ULL
79 #define NVIF_VMM_PFNMAP_V0_VRAM                           0x0000000000000010ULL
80 #define NVIF_VMM_PFNMAP_V0_W                              0x0000000000000002ULL
81 #define NVIF_VMM_PFNMAP_V0_V                              0x0000000000000001ULL
82 #define NVIF_VMM_PFNMAP_V0_NONE                           0x0000000000000000ULL
83 	__u64 phys[];
84 };
85 
86 struct nvif_vmm_pfnclr_v0 {
87 	__u8  version;
88 	__u8  pad01[7];
89 	__u64 addr;
90 	__u64 size;
91 };
92 #endif
93