blob: 186ffcc5883fa6936e8a02ff451e0a96dadea0d6 [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
26#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -080027#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
29#define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3)
Christopher Ferris05d08e92016-02-04 13:16:38 -080030#define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define NOUVEAU_GEM_TILE_COMP 0x00030000
32#define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00
Ben Cheng655a7c02013-10-16 16:09:24 -070033#define NOUVEAU_GEM_TILE_16BPP 0x00000001
34#define NOUVEAU_GEM_TILE_32BPP 0x00000002
35#define NOUVEAU_GEM_TILE_ZETA 0x00000004
36#define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008
Ben Cheng655a7c02013-10-16 16:09:24 -070037struct drm_nouveau_gem_info {
Christopher Ferris106b3a82016-08-24 12:15:38 -070038 __u32 handle;
39 __u32 domain;
Christopher Ferris106b3a82016-08-24 12:15:38 -070040 __u64 size;
41 __u64 offset;
42 __u64 map_handle;
43 __u32 tile_mode;
Christopher Ferris106b3a82016-08-24 12:15:38 -070044 __u32 tile_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070045};
46struct drm_nouveau_gem_new {
Tao Baod7db5942015-01-28 10:07:51 -080047 struct drm_nouveau_gem_info info;
Christopher Ferris106b3a82016-08-24 12:15:38 -070048 __u32 channel_hint;
49 __u32 align;
Ben Cheng655a7c02013-10-16 16:09:24 -070050};
51#define NOUVEAU_GEM_MAX_BUFFERS 1024
Christopher Ferris106b3a82016-08-24 12:15:38 -070052struct drm_nouveau_gem_pushbuf_bo_presumed {
53 __u32 valid;
54 __u32 domain;
55 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -070056};
Ben Cheng655a7c02013-10-16 16:09:24 -070057struct drm_nouveau_gem_pushbuf_bo {
Christopher Ferris106b3a82016-08-24 12:15:38 -070058 __u64 user_priv;
59 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -070060 __u32 read_domains;
61 __u32 write_domains;
62 __u32 valid_domains;
Tao Baod7db5942015-01-28 10:07:51 -080063 struct drm_nouveau_gem_pushbuf_bo_presumed presumed;
Ben Cheng655a7c02013-10-16 16:09:24 -070064};
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define NOUVEAU_GEM_RELOC_LOW (1 << 0)
66#define NOUVEAU_GEM_RELOC_HIGH (1 << 1)
67#define NOUVEAU_GEM_RELOC_OR (1 << 2)
68#define NOUVEAU_GEM_MAX_RELOCS 1024
Ben Cheng655a7c02013-10-16 16:09:24 -070069struct drm_nouveau_gem_pushbuf_reloc {
Christopher Ferris106b3a82016-08-24 12:15:38 -070070 __u32 reloc_bo_index;
71 __u32 reloc_bo_offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -070072 __u32 bo_index;
73 __u32 flags;
74 __u32 data;
75 __u32 vor;
Christopher Ferris106b3a82016-08-24 12:15:38 -070076 __u32 tor;
Ben Cheng655a7c02013-10-16 16:09:24 -070077};
78#define NOUVEAU_GEM_MAX_PUSH 512
79struct drm_nouveau_gem_pushbuf_push {
Christopher Ferris106b3a82016-08-24 12:15:38 -070080 __u32 bo_index;
81 __u32 pad;
82 __u64 offset;
83 __u64 length;
Ben Cheng655a7c02013-10-16 16:09:24 -070084};
Ben Cheng655a7c02013-10-16 16:09:24 -070085struct drm_nouveau_gem_pushbuf {
Christopher Ferris106b3a82016-08-24 12:15:38 -070086 __u32 channel;
87 __u32 nr_buffers;
Christopher Ferris106b3a82016-08-24 12:15:38 -070088 __u64 buffers;
89 __u32 nr_relocs;
90 __u32 nr_push;
91 __u64 relocs;
Christopher Ferris106b3a82016-08-24 12:15:38 -070092 __u64 push;
93 __u32 suffix0;
94 __u32 suffix1;
95 __u64 vram_available;
Christopher Ferris106b3a82016-08-24 12:15:38 -070096 __u64 gart_available;
Ben Cheng655a7c02013-10-16 16:09:24 -070097};
98#define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001
99#define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004
100struct drm_nouveau_gem_cpu_prep {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700101 __u32 handle;
102 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700103};
104struct drm_nouveau_gem_cpu_fini {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700105 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700106};
107#define DRM_NOUVEAU_GETPARAM 0x00
108#define DRM_NOUVEAU_SETPARAM 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define DRM_NOUVEAU_CHANNEL_ALLOC 0x02
110#define DRM_NOUVEAU_CHANNEL_FREE 0x03
111#define DRM_NOUVEAU_GROBJ_ALLOC 0x04
112#define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700113#define DRM_NOUVEAU_GPUOBJ_FREE 0x06
Christopher Ferris82d75042015-01-26 10:57:07 -0800114#define DRM_NOUVEAU_NVIF 0x07
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700115#define DRM_NOUVEAU_SVM_INIT 0x08
116#define DRM_NOUVEAU_SVM_BIND 0x09
Ben Cheng655a7c02013-10-16 16:09:24 -0700117#define DRM_NOUVEAU_GEM_NEW 0x40
118#define DRM_NOUVEAU_GEM_PUSHBUF 0x41
Christopher Ferris82d75042015-01-26 10:57:07 -0800119#define DRM_NOUVEAU_GEM_CPU_PREP 0x42
Ben Cheng655a7c02013-10-16 16:09:24 -0700120#define DRM_NOUVEAU_GEM_CPU_FINI 0x43
121#define DRM_NOUVEAU_GEM_INFO 0x44
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700122struct drm_nouveau_svm_init {
123 __u64 unmanaged_addr;
124 __u64 unmanaged_size;
125};
126struct drm_nouveau_svm_bind {
127 __u64 header;
128 __u64 va_start;
129 __u64 va_end;
130 __u64 npages;
131 __u64 stride;
132 __u64 result;
133 __u64 reserved0;
134 __u64 reserved1;
135};
136#define NOUVEAU_SVM_BIND_COMMAND_SHIFT 0
137#define NOUVEAU_SVM_BIND_COMMAND_BITS 8
138#define NOUVEAU_SVM_BIND_COMMAND_MASK ((1 << 8) - 1)
139#define NOUVEAU_SVM_BIND_PRIORITY_SHIFT 8
140#define NOUVEAU_SVM_BIND_PRIORITY_BITS 8
141#define NOUVEAU_SVM_BIND_PRIORITY_MASK ((1 << 8) - 1)
142#define NOUVEAU_SVM_BIND_TARGET_SHIFT 16
143#define NOUVEAU_SVM_BIND_TARGET_BITS 32
144#define NOUVEAU_SVM_BIND_TARGET_MASK 0xffffffff
145#define NOUVEAU_SVM_BIND_VALID_BITS 48
146#define NOUVEAU_SVM_BIND_VALID_MASK ((1ULL << NOUVEAU_SVM_BIND_VALID_BITS) - 1)
147#define NOUVEAU_SVM_BIND_COMMAND__MIGRATE 0
148#define NOUVEAU_SVM_BIND_TARGET__GPU_VRAM (1UL << 31)
149#define DRM_IOCTL_NOUVEAU_SVM_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SVM_INIT, struct drm_nouveau_svm_init)
150#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 -0700151#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 -0800152#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 -0800153#define DRM_IOCTL_NOUVEAU_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_PREP, struct drm_nouveau_gem_cpu_prep)
154#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 -0700155#define DRM_IOCTL_NOUVEAU_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_INFO, struct drm_nouveau_gem_info)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700156#ifdef __cplusplus
Christopher Ferris48fe0ae2019-01-10 15:59:33 -0800157}
Christopher Ferris82d75042015-01-26 10:57:07 -0800158#endif
Christopher Ferris106b3a82016-08-24 12:15:38 -0700159#endif