hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/uapi/drm/v3d_drm.h
....@@ -36,6 +36,8 @@
3636 #define DRM_V3D_MMAP_BO 0x03
3737 #define DRM_V3D_GET_PARAM 0x04
3838 #define DRM_V3D_GET_BO_OFFSET 0x05
39
+#define DRM_V3D_SUBMIT_TFU 0x06
40
+#define DRM_V3D_SUBMIT_CSD 0x07
3941
4042 #define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
4143 #define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
....@@ -43,6 +45,10 @@
4345 #define DRM_IOCTL_V3D_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo)
4446 #define DRM_IOCTL_V3D_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_PARAM, struct drm_v3d_get_param)
4547 #define DRM_IOCTL_V3D_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset)
48
+#define DRM_IOCTL_V3D_SUBMIT_TFU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_TFU, struct drm_v3d_submit_tfu)
49
+#define DRM_IOCTL_V3D_SUBMIT_CSD DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CSD, struct drm_v3d_submit_csd)
50
+
51
+#define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x01
4652
4753 /**
4854 * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D
....@@ -50,6 +56,14 @@
5056 *
5157 * This asks the kernel to have the GPU execute an optional binner
5258 * command list, and a render command list.
59
+ *
60
+ * The L1T, slice, L2C, L2T, and GCA caches will be flushed before
61
+ * each CL executes. The VCD cache should be flushed (if necessary)
62
+ * by the submitted CLs. The TLB writes are guaranteed to have been
63
+ * flushed by the time the render done IRQ happens, which is the
64
+ * trigger for out_sync. Any dirtying of cachelines by the job (only
65
+ * possible using TMU writes) must be flushed by the caller using the
66
+ * DRM_V3D_SUBMIT_CL_FLUSH_CACHE_FLAG flag.
5367 */
5468 struct drm_v3d_submit_cl {
5569 /* Pointer to the binner command list.
....@@ -58,10 +72,15 @@
5872 * coordinate shader to determine where primitives land on the screen,
5973 * then writes out the state updates and draw calls necessary per tile
6074 * to the tile allocation BO.
75
+ *
76
+ * This BCL will block on any previous BCL submitted on the
77
+ * same FD, but not on any RCL or BCLs submitted by other
78
+ * clients -- that is left up to the submitter to control
79
+ * using in_sync_bcl if necessary.
6180 */
6281 __u32 bcl_start;
6382
64
- /** End address of the BCL (first byte after the BCL) */
83
+ /** End address of the BCL (first byte after the BCL) */
6584 __u32 bcl_end;
6685
6786 /* Offset of the render command list.
....@@ -69,10 +88,15 @@
6988 * This is the second set of commands executed, which will either
7089 * execute the tiles that have been set up by the BCL, or a fixed set
7190 * of tiles (in the case of RCL-only blits).
91
+ *
92
+ * This RCL will block on this submit's BCL, and any previous
93
+ * RCL submitted on the same FD, but not on any RCL or BCLs
94
+ * submitted by other clients -- that is left up to the
95
+ * submitter to control using in_sync_rcl if necessary.
7296 */
7397 __u32 rcl_start;
7498
75
- /** End address of the RCL (first byte after the RCL) */
99
+ /** End address of the RCL (first byte after the RCL) */
76100 __u32 rcl_end;
77101
78102 /** An optional sync object to wait on before starting the BCL. */
....@@ -102,8 +126,7 @@
102126 /* Number of BO handles passed in (size is that times 4). */
103127 __u32 bo_handle_count;
104128
105
- /* Pad, must be zero-filled. */
106
- __u32 pad;
129
+ __u32 flags;
107130 };
108131
109132 /**
....@@ -169,6 +192,9 @@
169192 DRM_V3D_PARAM_V3D_CORE0_IDENT0,
170193 DRM_V3D_PARAM_V3D_CORE0_IDENT1,
171194 DRM_V3D_PARAM_V3D_CORE0_IDENT2,
195
+ DRM_V3D_PARAM_SUPPORTS_TFU,
196
+ DRM_V3D_PARAM_SUPPORTS_CSD,
197
+ DRM_V3D_PARAM_SUPPORTS_CACHE_FLUSH,
172198 };
173199
174200 struct drm_v3d_get_param {
....@@ -187,6 +213,53 @@
187213 __u32 offset;
188214 };
189215
216
+struct drm_v3d_submit_tfu {
217
+ __u32 icfg;
218
+ __u32 iia;
219
+ __u32 iis;
220
+ __u32 ica;
221
+ __u32 iua;
222
+ __u32 ioa;
223
+ __u32 ios;
224
+ __u32 coef[4];
225
+ /* First handle is the output BO, following are other inputs.
226
+ * 0 for unused.
227
+ */
228
+ __u32 bo_handles[4];
229
+ /* sync object to block on before running the TFU job. Each TFU
230
+ * job will execute in the order submitted to its FD. Synchronization
231
+ * against rendering jobs requires using sync objects.
232
+ */
233
+ __u32 in_sync;
234
+ /* Sync object to signal when the TFU job is done. */
235
+ __u32 out_sync;
236
+};
237
+
238
+/* Submits a compute shader for dispatch. This job will block on any
239
+ * previous compute shaders submitted on this fd, and any other
240
+ * synchronization must be performed with in_sync/out_sync.
241
+ */
242
+struct drm_v3d_submit_csd {
243
+ __u32 cfg[7];
244
+ __u32 coef[4];
245
+
246
+ /* Pointer to a u32 array of the BOs that are referenced by the job.
247
+ */
248
+ __u64 bo_handles;
249
+
250
+ /* Number of BO handles passed in (size is that times 4). */
251
+ __u32 bo_handle_count;
252
+
253
+ /* sync object to block on before running the CSD job. Each
254
+ * CSD job will execute in the order submitted to its FD.
255
+ * Synchronization against rendering/TFU jobs or CSD from
256
+ * other fds requires using sync objects.
257
+ */
258
+ __u32 in_sync;
259
+ /* Sync object to signal when the CSD job is done. */
260
+ __u32 out_sync;
261
+};
262
+
190263 #if defined(__cplusplus)
191264 }
192265 #endif