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
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
3940
4041 #define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
4142 #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
4344 #define DRM_IOCTL_V3D_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo)
4445 #define DRM_IOCTL_V3D_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_PARAM, struct drm_v3d_get_param)
4546 #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)
4648
4749 /**
4850 * struct drm_v3d_submit_cl - ioctl argument for submitting commands to the 3D
@@ -179,6 +181,7 @@ enum drm_v3d_param { · 130 unmodified lines
179181 DRM_V3D_PARAM_V3D_CORE0_IDENT0,
180182 DRM_V3D_PARAM_V3D_CORE0_IDENT1,
181183 DRM_V3D_PARAM_V3D_CORE0_IDENT2,
184+ DRM_V3D_PARAM_SUPPORTS_TFU,
182185 };
183186
184187 struct drm_v3d_get_param {
@@ -197,6 +200,28 @@ struct drm_v3d_get_bo_offset { · 12 unmodified lines
197200 __u32 offset;
198201 };
199202
203+struct 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+
200225 #if defined(__cplusplus)
201226 }
202227 #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