blob: 29eb8720565653f7d230cf5c8950e88d5dab7895 [file] [log] [blame]
Christopher Ferris106b3a82016-08-24 12:15:38 -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 _UAPI_VC4_DRM_H_
20#define _UAPI_VC4_DRM_H_
21#include "drm.h"
22#ifdef __cplusplus
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#endif
24#define DRM_VC4_SUBMIT_CL 0x00
25#define DRM_VC4_WAIT_SEQNO 0x01
26#define DRM_VC4_WAIT_BO 0x02
Christopher Ferris106b3a82016-08-24 12:15:38 -070027#define DRM_VC4_CREATE_BO 0x03
28#define DRM_VC4_MMAP_BO 0x04
29#define DRM_VC4_CREATE_SHADER_BO 0x05
30#define DRM_VC4_GET_HANG_STATE 0x06
Christopher Ferris49f525c2016-12-12 14:55:36 -080031#define DRM_VC4_GET_PARAM 0x07
Christopher Ferris1308ad32017-11-14 17:32:13 -080032#define DRM_VC4_SET_TILING 0x08
33#define DRM_VC4_GET_TILING 0x09
34#define DRM_VC4_LABEL_BO 0x0a
Christopher Ferris934ec942018-01-31 15:29:16 -080035#define DRM_VC4_GEM_MADVISE 0x0b
Christopher Ferris76a1d452018-06-27 14:12:29 -070036#define DRM_VC4_PERFMON_CREATE 0x0c
37#define DRM_VC4_PERFMON_DESTROY 0x0d
38#define DRM_VC4_PERFMON_GET_VALUES 0x0e
Christopher Ferris106b3a82016-08-24 12:15:38 -070039#define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl)
40#define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno)
41#define DRM_IOCTL_VC4_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_BO, struct drm_vc4_wait_bo)
Christopher Ferris49f525c2016-12-12 14:55:36 -080042#define DRM_IOCTL_VC4_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_BO, struct drm_vc4_create_bo)
Christopher Ferris106b3a82016-08-24 12:15:38 -070043#define DRM_IOCTL_VC4_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_MMAP_BO, struct drm_vc4_mmap_bo)
44#define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo)
45#define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state)
Christopher Ferris49f525c2016-12-12 14:55:36 -080046#define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param)
Christopher Ferris1308ad32017-11-14 17:32:13 -080047#define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling)
48#define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling)
49#define DRM_IOCTL_VC4_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_LABEL_BO, struct drm_vc4_label_bo)
Christopher Ferris934ec942018-01-31 15:29:16 -080050#define DRM_IOCTL_VC4_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GEM_MADVISE, struct drm_vc4_gem_madvise)
Christopher Ferris76a1d452018-06-27 14:12:29 -070051#define DRM_IOCTL_VC4_PERFMON_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_CREATE, struct drm_vc4_perfmon_create)
52#define DRM_IOCTL_VC4_PERFMON_DESTROY DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_DESTROY, struct drm_vc4_perfmon_destroy)
53#define DRM_IOCTL_VC4_PERFMON_GET_VALUES DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_PERFMON_GET_VALUES, struct drm_vc4_perfmon_get_values)
Christopher Ferris49f525c2016-12-12 14:55:36 -080054struct drm_vc4_submit_rcl_surface {
Christopher Ferris106b3a82016-08-24 12:15:38 -070055 __u32 hindex;
56 __u32 offset;
57 __u16 bits;
58#define VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -070059 __u16 flags;
60};
61struct drm_vc4_submit_cl {
62 __u64 bin_cl;
Christopher Ferris106b3a82016-08-24 12:15:38 -070063 __u64 shader_rec;
64 __u64 uniforms;
65 __u64 bo_handles;
66 __u32 bin_cl_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -070067 __u32 shader_rec_size;
68 __u32 shader_rec_count;
69 __u32 uniforms_size;
70 __u32 bo_handle_count;
Christopher Ferris106b3a82016-08-24 12:15:38 -070071 __u16 width;
72 __u16 height;
73 __u8 min_x_tile;
74 __u8 min_y_tile;
Christopher Ferris106b3a82016-08-24 12:15:38 -070075 __u8 max_x_tile;
76 __u8 max_y_tile;
77 struct drm_vc4_submit_rcl_surface color_read;
78 struct drm_vc4_submit_rcl_surface color_write;
Christopher Ferris106b3a82016-08-24 12:15:38 -070079 struct drm_vc4_submit_rcl_surface zs_read;
80 struct drm_vc4_submit_rcl_surface zs_write;
81 struct drm_vc4_submit_rcl_surface msaa_color_write;
82 struct drm_vc4_submit_rcl_surface msaa_zs_write;
Christopher Ferris106b3a82016-08-24 12:15:38 -070083 __u32 clear_color[2];
84 __u32 clear_z;
85 __u8 clear_s;
86 __u32 pad : 24;
Christopher Ferris106b3a82016-08-24 12:15:38 -070087#define VC4_SUBMIT_CL_USE_CLEAR_COLOR (1 << 0)
Christopher Ferris1308ad32017-11-14 17:32:13 -080088#define VC4_SUBMIT_CL_FIXED_RCL_ORDER (1 << 1)
89#define VC4_SUBMIT_CL_RCL_ORDER_INCREASING_X (1 << 2)
90#define VC4_SUBMIT_CL_RCL_ORDER_INCREASING_Y (1 << 3)
Christopher Ferris106b3a82016-08-24 12:15:38 -070091 __u32 flags;
92 __u64 seqno;
Christopher Ferris76a1d452018-06-27 14:12:29 -070093 __u32 perfmonid;
Christopher Ferris9ce28842018-10-25 12:11:39 -070094 __u32 in_sync;
95 __u32 out_sync;
Christopher Ferris76a1d452018-06-27 14:12:29 -070096 __u32 pad2;
Christopher Ferris106b3a82016-08-24 12:15:38 -070097};
Christopher Ferris106b3a82016-08-24 12:15:38 -070098struct drm_vc4_wait_seqno {
99 __u64 seqno;
100 __u64 timeout_ns;
101};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700102struct drm_vc4_wait_bo {
103 __u32 handle;
104 __u32 pad;
105 __u64 timeout_ns;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700106};
107struct drm_vc4_create_bo {
108 __u32 size;
109 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700110 __u32 handle;
111 __u32 pad;
112};
113struct drm_vc4_mmap_bo {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700114 __u32 handle;
115 __u32 flags;
116 __u64 offset;
117};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700118struct drm_vc4_create_shader_bo {
119 __u32 size;
120 __u32 flags;
121 __u64 data;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700122 __u32 handle;
123 __u32 pad;
124};
125struct drm_vc4_get_hang_state_bo {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700126 __u32 handle;
127 __u32 paddr;
128 __u32 size;
129 __u32 pad;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700130};
131struct drm_vc4_get_hang_state {
132 __u64 bo;
133 __u32 bo_count;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700134 __u32 start_bin, start_render;
135 __u32 ct0ca, ct0ea;
136 __u32 ct1ca, ct1ea;
137 __u32 ct0cs, ct1cs;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700138 __u32 ct0ra0, ct1ra0;
139 __u32 bpca, bpcs;
140 __u32 bpoa, bpos;
141 __u32 vpmbase;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700142 __u32 dbge;
143 __u32 fdbgo;
144 __u32 fdbgb;
145 __u32 fdbgr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700146 __u32 fdbgs;
147 __u32 errstat;
148 __u32 pad[16];
149};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800150#define DRM_VC4_PARAM_V3D_IDENT0 0
151#define DRM_VC4_PARAM_V3D_IDENT1 1
Christopher Ferris49f525c2016-12-12 14:55:36 -0800152#define DRM_VC4_PARAM_V3D_IDENT2 2
153#define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800154#define DRM_VC4_PARAM_SUPPORTS_ETC1 4
155#define DRM_VC4_PARAM_SUPPORTS_THREADED_FS 5
Christopher Ferris1308ad32017-11-14 17:32:13 -0800156#define DRM_VC4_PARAM_SUPPORTS_FIXED_RCL_ORDER 6
Christopher Ferris934ec942018-01-31 15:29:16 -0800157#define DRM_VC4_PARAM_SUPPORTS_MADVISE 7
Christopher Ferris76a1d452018-06-27 14:12:29 -0700158#define DRM_VC4_PARAM_SUPPORTS_PERFMON 8
Christopher Ferris49f525c2016-12-12 14:55:36 -0800159struct drm_vc4_get_param {
160 __u32 param;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800161 __u32 pad;
162 __u64 value;
163};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800164struct drm_vc4_get_tiling {
165 __u32 handle;
166 __u32 flags;
167 __u64 modifier;
168};
169struct drm_vc4_set_tiling {
170 __u32 handle;
171 __u32 flags;
172 __u64 modifier;
173};
174struct drm_vc4_label_bo {
175 __u32 handle;
176 __u32 len;
177 __u64 name;
178};
Christopher Ferris934ec942018-01-31 15:29:16 -0800179#define VC4_MADV_WILLNEED 0
180#define VC4_MADV_DONTNEED 1
181#define __VC4_MADV_PURGED 2
182#define __VC4_MADV_NOTSUPP 3
183struct drm_vc4_gem_madvise {
184 __u32 handle;
185 __u32 madv;
186 __u32 retained;
187 __u32 pad;
188};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700189enum {
190 VC4_PERFCNT_FEP_VALID_PRIMS_NO_RENDER,
191 VC4_PERFCNT_FEP_VALID_PRIMS_RENDER,
192 VC4_PERFCNT_FEP_CLIPPED_QUADS,
193 VC4_PERFCNT_FEP_VALID_QUADS,
194 VC4_PERFCNT_TLB_QUADS_NOT_PASSING_STENCIL,
195 VC4_PERFCNT_TLB_QUADS_NOT_PASSING_Z_AND_STENCIL,
196 VC4_PERFCNT_TLB_QUADS_PASSING_Z_AND_STENCIL,
197 VC4_PERFCNT_TLB_QUADS_ZERO_COVERAGE,
198 VC4_PERFCNT_TLB_QUADS_NON_ZERO_COVERAGE,
199 VC4_PERFCNT_TLB_QUADS_WRITTEN_TO_COLOR_BUF,
200 VC4_PERFCNT_PLB_PRIMS_OUTSIDE_VIEWPORT,
201 VC4_PERFCNT_PLB_PRIMS_NEED_CLIPPING,
202 VC4_PERFCNT_PSE_PRIMS_REVERSED,
203 VC4_PERFCNT_QPU_TOTAL_IDLE_CYCLES,
204 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_VERTEX_COORD_SHADING,
205 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_FRAGMENT_SHADING,
206 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_EXEC_VALID_INST,
207 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_TMUS,
208 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_SCOREBOARD,
209 VC4_PERFCNT_QPU_TOTAL_CLK_CYCLES_WAITING_VARYINGS,
210 VC4_PERFCNT_QPU_TOTAL_INST_CACHE_HIT,
211 VC4_PERFCNT_QPU_TOTAL_INST_CACHE_MISS,
212 VC4_PERFCNT_QPU_TOTAL_UNIFORM_CACHE_HIT,
213 VC4_PERFCNT_QPU_TOTAL_UNIFORM_CACHE_MISS,
214 VC4_PERFCNT_TMU_TOTAL_TEXT_QUADS_PROCESSED,
215 VC4_PERFCNT_TMU_TOTAL_TEXT_CACHE_MISS,
216 VC4_PERFCNT_VPM_TOTAL_CLK_CYCLES_VDW_STALLED,
217 VC4_PERFCNT_VPM_TOTAL_CLK_CYCLES_VCD_STALLED,
218 VC4_PERFCNT_L2C_TOTAL_L2_CACHE_HIT,
219 VC4_PERFCNT_L2C_TOTAL_L2_CACHE_MISS,
220 VC4_PERFCNT_NUM_EVENTS,
221};
222#define DRM_VC4_MAX_PERF_COUNTERS 16
223struct drm_vc4_perfmon_create {
224 __u32 id;
225 __u32 ncounters;
226 __u8 events[DRM_VC4_MAX_PERF_COUNTERS];
227};
228struct drm_vc4_perfmon_destroy {
229 __u32 id;
230};
231struct drm_vc4_perfmon_get_values {
232 __u32 id;
233 __u64 values_ptr;
234};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700235#ifdef __cplusplus
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800236#endif
237#endif