blob: 2c38494fa84a517e3ddbc57c7238071eb3725971 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __NOUVEAU_DRM_H__
20#define __NOUVEAU_DRM_H__
Christopher Ferris82d75042015-01-26 10:57:07 -080021#define DRM_NOUVEAU_EVENT_NVIF 0x80000000
Christopher Ferris106b3a82016-08-24 12:15:38 -070022#include "drm.h"
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#ifdef __cplusplus
Christopher Ferris48fe0ae2019-01-10 15:59:33 -080024extern "C" {
Christopher Ferris106b3a82016-08-24 12:15:38 -070025#endif
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070026#define NOUVEAU_GETPARAM_PCI_VENDOR 3
27#define NOUVEAU_GETPARAM_PCI_DEVICE 4
28#define NOUVEAU_GETPARAM_BUS_TYPE 5
29#define NOUVEAU_GETPARAM_FB_SIZE 8
30#define NOUVEAU_GETPARAM_AGP_SIZE 9
31#define NOUVEAU_GETPARAM_CHIPSET_ID 11
32#define NOUVEAU_GETPARAM_VM_VRAM_BASE 12
33#define NOUVEAU_GETPARAM_GRAPH_UNITS 13
34#define NOUVEAU_GETPARAM_PTIMER_TIME 14
35#define NOUVEAU_GETPARAM_HAS_BO_USAGE 15
36#define NOUVEAU_GETPARAM_HAS_PAGEFLIP 16
37#define NOUVEAU_GETPARAM_EXEC_PUSH_MAX 17
38struct drm_nouveau_getparam {
39 __u64 param;
40 __u64 value;
41};
42struct drm_nouveau_channel_alloc {
43 __u32 fb_ctxdma_handle;
44 __u32 tt_ctxdma_handle;
45 __s32 channel;
46 __u32 pushbuf_domains;
47 __u32 notifier_handle;
48 struct {
49 __u32 handle;
50 __u32 grclass;
51 } subchan[8];
52 __u32 nr_subchan;
53};
54struct drm_nouveau_channel_free {
55 __s32 channel;
56};
Christopher Ferris106b3a82016-08-24 12:15:38 -070057#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -080058#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
60#define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3)
Christopher Ferris05d08e92016-02-04 13:16:38 -080061#define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4)
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070062#define NOUVEAU_GEM_DOMAIN_NO_SHARE (1 << 5)
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define NOUVEAU_GEM_TILE_COMP 0x00030000
64#define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define NOUVEAU_GEM_TILE_16BPP 0x00000001
66#define NOUVEAU_GEM_TILE_32BPP 0x00000002
67#define NOUVEAU_GEM_TILE_ZETA 0x00000004
68#define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008
Ben Cheng655a7c02013-10-16 16:09:24 -070069struct drm_nouveau_gem_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -070070 __u32 handle;
71 __u32 domain;
Christopher Ferris106b3a82016-08-24 12:15:38 -070072 __u64 size;
73 __u64 offset;
74 __u64 map_handle;
75 __u32 tile_mode;
Christopher Ferris106b3a82016-08-24 12:15:38 -070076 __u32 tile_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070077};
78struct drm_nouveau_gem_new {
Tao Baod7db5942015-01-28 10:07:51 -080079 struct drm_nouveau_gem_info info;
Christopher Ferris106b3a82016-08-24 12:15:38 -070080 __u32 channel_hint;
81 __u32 align;
Ben Cheng655a7c02013-10-16 16:09:24 -070082};
83#define NOUVEAU_GEM_MAX_BUFFERS 1024
Christopher Ferris106b3a82016-08-24 12:15:38 -070084struct drm_nouveau_gem_pushbuf_bo_presumed {
85 __u32 valid;
86 __u32 domain;
87 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -070088};
Ben Cheng655a7c02013-10-16 16:09:24 -070089struct drm_nouveau_gem_pushbuf_bo {
Christopher Ferris106b3a82016-08-24 12:15:38 -070090 __u64 user_priv;
91 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -070092 __u32 read_domains;
93 __u32 write_domains;
94 __u32 valid_domains;
Tao Baod7db5942015-01-28 10:07:51 -080095 struct drm_nouveau_gem_pushbuf_bo_presumed presumed;
Ben Cheng655a7c02013-10-16 16:09:24 -070096};
Ben Cheng655a7c02013-10-16 16:09:24 -070097#define NOUVEAU_GEM_RELOC_LOW (1 << 0)
98#define NOUVEAU_GEM_RELOC_HIGH (1 << 1)
99#define NOUVEAU_GEM_RELOC_OR (1 << 2)
100#define NOUVEAU_GEM_MAX_RELOCS 1024
Ben Cheng655a7c02013-10-16 16:09:24 -0700101struct drm_nouveau_gem_pushbuf_reloc {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700102 __u32 reloc_bo_index;
103 __u32 reloc_bo_offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700104 __u32 bo_index;
105 __u32 flags;
106 __u32 data;
107 __u32 vor;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700108 __u32 tor;
Ben Cheng655a7c02013-10-16 16:09:24 -0700109};
110#define NOUVEAU_GEM_MAX_PUSH 512
111struct drm_nouveau_gem_pushbuf_push {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700112 __u32 bo_index;
113 __u32 pad;
114 __u64 offset;
115 __u64 length;
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700116#define NOUVEAU_GEM_PUSHBUF_NO_PREFETCH (1 << 23)
Ben Cheng655a7c02013-10-16 16:09:24 -0700117};
Ben Cheng655a7c02013-10-16 16:09:24 -0700118struct drm_nouveau_gem_pushbuf {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700119 __u32 channel;
120 __u32 nr_buffers;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700121 __u64 buffers;
122 __u32 nr_relocs;
123 __u32 nr_push;
124 __u64 relocs;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700125 __u64 push;
126 __u32 suffix0;
127 __u32 suffix1;
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700128#define NOUVEAU_GEM_PUSHBUF_SYNC (1ULL << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700129 __u64 vram_available;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700130 __u64 gart_available;
Ben Cheng655a7c02013-10-16 16:09:24 -0700131};
132#define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001
133#define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004
134struct drm_nouveau_gem_cpu_prep {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700135 __u32 handle;
136 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700137};
138struct drm_nouveau_gem_cpu_fini {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700139 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700140};
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700141struct drm_nouveau_sync {
142 __u32 flags;
143#define DRM_NOUVEAU_SYNC_SYNCOBJ 0x0
144#define DRM_NOUVEAU_SYNC_TIMELINE_SYNCOBJ 0x1
145#define DRM_NOUVEAU_SYNC_TYPE_MASK 0xf
146 __u32 handle;
147 __u64 timeline_value;
148};
149struct drm_nouveau_vm_init {
150 __u64 kernel_managed_addr;
151 __u64 kernel_managed_size;
152};
153struct drm_nouveau_vm_bind_op {
154 __u32 op;
155#define DRM_NOUVEAU_VM_BIND_OP_MAP 0x0
156#define DRM_NOUVEAU_VM_BIND_OP_UNMAP 0x1
157 __u32 flags;
158#define DRM_NOUVEAU_VM_BIND_SPARSE (1 << 8)
159 __u32 handle;
160 __u32 pad;
161 __u64 addr;
162 __u64 bo_offset;
163 __u64 range;
164};
165struct drm_nouveau_vm_bind {
166 __u32 op_count;
167 __u32 flags;
168#define DRM_NOUVEAU_VM_BIND_RUN_ASYNC 0x1
169 __u32 wait_count;
170 __u32 sig_count;
171 __u64 wait_ptr;
172 __u64 sig_ptr;
173 __u64 op_ptr;
174};
175struct drm_nouveau_exec_push {
176 __u64 va;
177 __u32 va_len;
178 __u32 flags;
179#define DRM_NOUVEAU_EXEC_PUSH_NO_PREFETCH 0x1
180};
181struct drm_nouveau_exec {
182 __u32 channel;
183 __u32 push_count;
184 __u32 wait_count;
185 __u32 sig_count;
186 __u64 wait_ptr;
187 __u64 sig_ptr;
188 __u64 push_ptr;
189};
Ben Cheng655a7c02013-10-16 16:09:24 -0700190#define DRM_NOUVEAU_GETPARAM 0x00
191#define DRM_NOUVEAU_SETPARAM 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700192#define DRM_NOUVEAU_CHANNEL_ALLOC 0x02
193#define DRM_NOUVEAU_CHANNEL_FREE 0x03
194#define DRM_NOUVEAU_GROBJ_ALLOC 0x04
195#define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700196#define DRM_NOUVEAU_GPUOBJ_FREE 0x06
Christopher Ferris82d75042015-01-26 10:57:07 -0800197#define DRM_NOUVEAU_NVIF 0x07
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700198#define DRM_NOUVEAU_SVM_INIT 0x08
199#define DRM_NOUVEAU_SVM_BIND 0x09
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700200#define DRM_NOUVEAU_VM_INIT 0x10
201#define DRM_NOUVEAU_VM_BIND 0x11
202#define DRM_NOUVEAU_EXEC 0x12
Ben Cheng655a7c02013-10-16 16:09:24 -0700203#define DRM_NOUVEAU_GEM_NEW 0x40
204#define DRM_NOUVEAU_GEM_PUSHBUF 0x41
Christopher Ferris82d75042015-01-26 10:57:07 -0800205#define DRM_NOUVEAU_GEM_CPU_PREP 0x42
Ben Cheng655a7c02013-10-16 16:09:24 -0700206#define DRM_NOUVEAU_GEM_CPU_FINI 0x43
207#define DRM_NOUVEAU_GEM_INFO 0x44
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700208struct drm_nouveau_svm_init {
209 __u64 unmanaged_addr;
210 __u64 unmanaged_size;
211};
212struct drm_nouveau_svm_bind {
213 __u64 header;
214 __u64 va_start;
215 __u64 va_end;
216 __u64 npages;
217 __u64 stride;
218 __u64 result;
219 __u64 reserved0;
220 __u64 reserved1;
221};
222#define NOUVEAU_SVM_BIND_COMMAND_SHIFT 0
223#define NOUVEAU_SVM_BIND_COMMAND_BITS 8
224#define NOUVEAU_SVM_BIND_COMMAND_MASK ((1 << 8) - 1)
225#define NOUVEAU_SVM_BIND_PRIORITY_SHIFT 8
226#define NOUVEAU_SVM_BIND_PRIORITY_BITS 8
227#define NOUVEAU_SVM_BIND_PRIORITY_MASK ((1 << 8) - 1)
228#define NOUVEAU_SVM_BIND_TARGET_SHIFT 16
229#define NOUVEAU_SVM_BIND_TARGET_BITS 32
230#define NOUVEAU_SVM_BIND_TARGET_MASK 0xffffffff
231#define NOUVEAU_SVM_BIND_VALID_BITS 48
232#define NOUVEAU_SVM_BIND_VALID_MASK ((1ULL << NOUVEAU_SVM_BIND_VALID_BITS) - 1)
233#define NOUVEAU_SVM_BIND_COMMAND__MIGRATE 0
234#define NOUVEAU_SVM_BIND_TARGET__GPU_VRAM (1UL << 31)
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700235#define DRM_IOCTL_NOUVEAU_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GETPARAM, struct drm_nouveau_getparam)
236#define DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_ALLOC, struct drm_nouveau_channel_alloc)
237#define DRM_IOCTL_NOUVEAU_CHANNEL_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_FREE, struct drm_nouveau_channel_free)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700238#define DRM_IOCTL_NOUVEAU_SVM_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SVM_INIT, struct drm_nouveau_svm_init)
239#define DRM_IOCTL_NOUVEAU_SVM_BIND DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SVM_BIND, struct drm_nouveau_svm_bind)
Ben Cheng655a7c02013-10-16 16:09:24 -0700240#define DRM_IOCTL_NOUVEAU_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_NEW, struct drm_nouveau_gem_new)
Christopher Ferris82d75042015-01-26 10:57:07 -0800241#define DRM_IOCTL_NOUVEAU_GEM_PUSHBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_PUSHBUF, struct drm_nouveau_gem_pushbuf)
Tao Baod7db5942015-01-28 10:07:51 -0800242#define DRM_IOCTL_NOUVEAU_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_PREP, struct drm_nouveau_gem_cpu_prep)
243#define DRM_IOCTL_NOUVEAU_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_FINI, struct drm_nouveau_gem_cpu_fini)
Ben Cheng655a7c02013-10-16 16:09:24 -0700244#define DRM_IOCTL_NOUVEAU_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_INFO, struct drm_nouveau_gem_info)
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700245#define DRM_IOCTL_NOUVEAU_VM_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_VM_INIT, struct drm_nouveau_vm_init)
246#define DRM_IOCTL_NOUVEAU_VM_BIND DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_VM_BIND, struct drm_nouveau_vm_bind)
247#define DRM_IOCTL_NOUVEAU_EXEC DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_EXEC, struct drm_nouveau_exec)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700248#ifdef __cplusplus
Christopher Ferris48fe0ae2019-01-10 15:59:33 -0800249}
Christopher Ferris82d75042015-01-26 10:57:07 -0800250#endif
Christopher Ferris106b3a82016-08-24 12:15:38 -0700251#endif