1 /****************************************************************************
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 _PANFROST_DRM_H_
20 #define _PANFROST_DRM_H_
21 #include "drm.h"
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 #define DRM_PANFROST_SUBMIT 0x00
26 #define DRM_PANFROST_WAIT_BO 0x01
27 #define DRM_PANFROST_CREATE_BO 0x02
28 #define DRM_PANFROST_MMAP_BO 0x03
29 #define DRM_PANFROST_GET_PARAM 0x04
30 #define DRM_PANFROST_GET_BO_OFFSET 0x05
31 #define DRM_PANFROST_PERFCNT_ENABLE 0x06
32 #define DRM_PANFROST_PERFCNT_DUMP 0x07
33 #define DRM_PANFROST_MADVISE 0x08
34 #define DRM_IOCTL_PANFROST_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_SUBMIT, struct drm_panfrost_submit)
35 #define DRM_IOCTL_PANFROST_WAIT_BO DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_WAIT_BO, struct drm_panfrost_wait_bo)
36 #define DRM_IOCTL_PANFROST_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_CREATE_BO, struct drm_panfrost_create_bo)
37 #define DRM_IOCTL_PANFROST_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_MMAP_BO, struct drm_panfrost_mmap_bo)
38 #define DRM_IOCTL_PANFROST_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_GET_PARAM, struct drm_panfrost_get_param)
39 #define DRM_IOCTL_PANFROST_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_GET_BO_OFFSET, struct drm_panfrost_get_bo_offset)
40 #define DRM_IOCTL_PANFROST_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_MADVISE, struct drm_panfrost_madvise)
41 #define DRM_IOCTL_PANFROST_PERFCNT_ENABLE DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_PERFCNT_ENABLE, struct drm_panfrost_perfcnt_enable)
42 #define DRM_IOCTL_PANFROST_PERFCNT_DUMP DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_PERFCNT_DUMP, struct drm_panfrost_perfcnt_dump)
43 #define PANFROST_JD_REQ_FS (1 << 0)
44 struct drm_panfrost_submit {
45   __u64 jc;
46   __u64 in_syncs;
47   __u32 in_sync_count;
48   __u32 out_sync;
49   __u64 bo_handles;
50   __u32 bo_handle_count;
51   __u32 requirements;
52 };
53 struct drm_panfrost_wait_bo {
54   __u32 handle;
55   __u32 pad;
56   __s64 timeout_ns;
57 };
58 #define PANFROST_BO_NOEXEC 1
59 #define PANFROST_BO_HEAP 2
60 struct drm_panfrost_create_bo {
61   __u32 size;
62   __u32 flags;
63   __u32 handle;
64   __u32 pad;
65   __u64 offset;
66 };
67 struct drm_panfrost_mmap_bo {
68   __u32 handle;
69   __u32 flags;
70   __u64 offset;
71 };
72 enum drm_panfrost_param {
73   DRM_PANFROST_PARAM_GPU_PROD_ID,
74   DRM_PANFROST_PARAM_GPU_REVISION,
75   DRM_PANFROST_PARAM_SHADER_PRESENT,
76   DRM_PANFROST_PARAM_TILER_PRESENT,
77   DRM_PANFROST_PARAM_L2_PRESENT,
78   DRM_PANFROST_PARAM_STACK_PRESENT,
79   DRM_PANFROST_PARAM_AS_PRESENT,
80   DRM_PANFROST_PARAM_JS_PRESENT,
81   DRM_PANFROST_PARAM_L2_FEATURES,
82   DRM_PANFROST_PARAM_CORE_FEATURES,
83   DRM_PANFROST_PARAM_TILER_FEATURES,
84   DRM_PANFROST_PARAM_MEM_FEATURES,
85   DRM_PANFROST_PARAM_MMU_FEATURES,
86   DRM_PANFROST_PARAM_THREAD_FEATURES,
87   DRM_PANFROST_PARAM_MAX_THREADS,
88   DRM_PANFROST_PARAM_THREAD_MAX_WORKGROUP_SZ,
89   DRM_PANFROST_PARAM_THREAD_MAX_BARRIER_SZ,
90   DRM_PANFROST_PARAM_COHERENCY_FEATURES,
91   DRM_PANFROST_PARAM_TEXTURE_FEATURES0,
92   DRM_PANFROST_PARAM_TEXTURE_FEATURES1,
93   DRM_PANFROST_PARAM_TEXTURE_FEATURES2,
94   DRM_PANFROST_PARAM_TEXTURE_FEATURES3,
95   DRM_PANFROST_PARAM_JS_FEATURES0,
96   DRM_PANFROST_PARAM_JS_FEATURES1,
97   DRM_PANFROST_PARAM_JS_FEATURES2,
98   DRM_PANFROST_PARAM_JS_FEATURES3,
99   DRM_PANFROST_PARAM_JS_FEATURES4,
100   DRM_PANFROST_PARAM_JS_FEATURES5,
101   DRM_PANFROST_PARAM_JS_FEATURES6,
102   DRM_PANFROST_PARAM_JS_FEATURES7,
103   DRM_PANFROST_PARAM_JS_FEATURES8,
104   DRM_PANFROST_PARAM_JS_FEATURES9,
105   DRM_PANFROST_PARAM_JS_FEATURES10,
106   DRM_PANFROST_PARAM_JS_FEATURES11,
107   DRM_PANFROST_PARAM_JS_FEATURES12,
108   DRM_PANFROST_PARAM_JS_FEATURES13,
109   DRM_PANFROST_PARAM_JS_FEATURES14,
110   DRM_PANFROST_PARAM_JS_FEATURES15,
111   DRM_PANFROST_PARAM_NR_CORE_GROUPS,
112   DRM_PANFROST_PARAM_THREAD_TLS_ALLOC,
113 };
114 struct drm_panfrost_get_param {
115   __u32 param;
116   __u32 pad;
117   __u64 value;
118 };
119 struct drm_panfrost_get_bo_offset {
120   __u32 handle;
121   __u32 pad;
122   __u64 offset;
123 };
124 struct drm_panfrost_perfcnt_enable {
125   __u32 enable;
126   __u32 counterset;
127 };
128 struct drm_panfrost_perfcnt_dump {
129   __u64 buf_ptr;
130 };
131 #define PANFROST_MADV_WILLNEED 0
132 #define PANFROST_MADV_DONTNEED 1
133 struct drm_panfrost_madvise {
134   __u32 handle;
135   __u32 madv;
136   __u32 retained;
137 };
138 #ifdef __cplusplus
139 }
140 #endif
141 #endif
142