History

drm/msm: Add MSM_SUBMIT_FENCE_SN_IN

Add a way for userspace to specify the sequence number fence used to track completion of the submit. As the seqno fence is simply an incrementing counter which is local to the submitqueue, it is easy for userspace to know the next value. This is useful for native userspace drivers in a vm guest, as the guest to host roundtrip can have high latency. Assigning the fence seqno in the guest userspace allows the guest to continue without waiting for response from the host.

Rob Clark committed 4 years ago

Commit 17154ad1 parent 5f9ffe83 files · +41 −8Browse files

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

Unified · Split

include/uapi/drm/msm_drm.h+3−1
@@ -232,6 +232,7 @@ struct drm_msm_gem_submit_bo { · 231 unmodified lines
232232 #define MSM_SUBMIT_SUDO 0x10000000 /* run submitted cmds from RB */
233233 #define MSM_SUBMIT_SYNCOBJ_IN 0x08000000 /* enable input syncobj */
234234 #define MSM_SUBMIT_SYNCOBJ_OUT 0x04000000 /* enable output syncobj */
235+#define MSM_SUBMIT_FENCE_SN_IN 0x02000000 /* userspace passes in seqno fence */
235236 #define MSM_SUBMIT_FLAGS ( \
236237 MSM_SUBMIT_NO_IMPLICIT | \
237238 MSM_SUBMIT_FENCE_FD_IN | \
@@ -239,6 +240,7 @@ struct drm_msm_gem_submit_bo { · 1 unmodified line
239240 MSM_SUBMIT_SUDO | \
240241 MSM_SUBMIT_SYNCOBJ_IN | \
241242 MSM_SUBMIT_SYNCOBJ_OUT | \
243+ MSM_SUBMIT_FENCE_SN_IN | \
242244 0)
243245
244246 #define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */
@@ -258,7 +260,7 @@ struct drm_msm_gem_submit_syncobj { · 13 unmodified lines
258260 */
259261 struct drm_msm_gem_submit {
260262 __u32 flags; /* MSM_PIPE_x | MSM_SUBMIT_x */
261− __u32 fence; /* out */
263+ __u32 fence; /* out (or in with MSM_SUBMIT_FENCE_SN_IN flag) */
262264 __u32 nr_bos; /* in, number of submit_bo's */
263265 __u32 nr_cmds; /* in, number of submit_cmd's */
264266 __u64 bos; /* in, ptr to array of submit_bo's */