History

drm/v3d: Add support for submitting jobs to the TFU.

The TFU can copy from raster, UIF, and SAND input images to UIF output images, with optional mipmap generation. This will certainly be useful for media EGL image input, but is also useful immediately for mipmap generation without bogging the V3D core down. For now we only run the queue 1 job deep, and don't have any hang recovery (though I don't think we should need it, with TFU). Queuing multiple jobs in the HW will require synchronizing the YUV coefficient regs updates since they don't get FIFOed with the job. v2: Change the ioctl to IOW instead of IOWR, always set COEF0, explain why TFU is AUTH, clarify the syncing docs, drop the unused TFU interrupt regs (you're expected to use the hub's), don't take &bo->base for NULL bos. v3: Fix a little whitespace alignment (noticed by checkpatch), rebase on drm_sched_job_cleanup() changes.

Eric Anholt committed 7 years ago

Commit 1584f161 parent 1d8224e8 files · +427 −51Browse files

Showing the changes to include/uapi (1 of 8 files). Show all

Unified · Split

include/uapi/drm/v3d_drm.h+25−0
@@ -36,6 +36,7 @@ extern "C" { · 35 unmodified lines
36#define DRM_V3D_MMAP_BO 0x0336#define DRM_V3D_MMAP_BO 0x03
37#define DRM_V3D_GET_PARAM 0x0437#define DRM_V3D_GET_PARAM 0x04
38#define DRM_V3D_GET_BO_OFFSET 0x0538#define DRM_V3D_GET_BO_OFFSET 0x05
39#define DRM_V3D_SUBMIT_TFU 0x06
39 40
40#define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)41#define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
41#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)42#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
@@ -43,6 +44,7 @@ extern "C" { · 1 unmodified line
43#define DRM_IOCTL_V3D_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo)44#define DRM_IOCTL_V3D_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo)
44#define DRM_IOCTL_V3D_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_PARAM, struct drm_v3d_get_param)45#define DRM_IOCTL_V3D_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_PARAM, struct drm_v3d_get_param)
45#define DRM_IOCTL_V3D_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset)46#define DRM_IOCTL_V3D_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset)
47#define DRM_IOCTL_V3D_SUBMIT_TFU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_TFU, struct drm_v3d_submit_tfu)
46 48
47/**49/**
48 * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D50 * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D
@@ -179,6 +181,7 @@ enum drm_v3d_param { · 130 unmodified lines
179 DRM_V3D_PARAM_V3D_CORE0_IDENT0,181 DRM_V3D_PARAM_V3D_CORE0_IDENT0,
180 DRM_V3D_PARAM_V3D_CORE0_IDENT1,182 DRM_V3D_PARAM_V3D_CORE0_IDENT1,
181 DRM_V3D_PARAM_V3D_CORE0_IDENT2,183 DRM_V3D_PARAM_V3D_CORE0_IDENT2,
184 DRM_V3D_PARAM_SUPPORTS_TFU,
182};185};
183 186
184struct drm_v3d_get_param {187struct drm_v3d_get_param {
@@ -197,6 +200,28 @@ struct drm_v3d_get_bo_offset { · 12 unmodified lines
197 __u32 offset;200 __u32 offset;
198};201};
199 202
203struct drm_v3d_submit_tfu {
204 __u32 icfg;
205 __u32 iia;
206 __u32 iis;
207 __u32 ica;
208 __u32 iua;
209 __u32 ioa;
210 __u32 ios;
211 __u32 coef[4];
212 /* First handle is the output BO, following are other inputs.
213 * 0 for unused.
214 */
215 __u32 bo_handles[4];
216 /* sync object to block on before running the TFU job. Each TFU
217 * job will execute in the order submitted to its FD. Synchronization
218 * against rendering jobs requires using sync objects.
219 */
220 __u32 in_sync;
221 /* Sync object to signal when the TFU job is done. */
222 __u32 out_sync;
223};
224
200#if defined(__cplusplus)225#if defined(__cplusplus)
201}226}
202#endif227#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t