@@ -1291,7 +1291,8 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data,
return -EOPNOTSUPP;
if (args->selector != DRM_SYNCOBJ_TIMELINE_ARRAY_SELECTOR_SIGNALED_POINT &&
- args->selector != DRM_SYNCOBJ_TIMELINE_ARRAY_SELECTOR_SIDEBAND_PAYLOAD)
+ args->selector != DRM_SYNCOBJ_TIMELINE_ARRAY_SELECTOR_SIDEBAND_PAYLOAD &&
+ args->selector != DRM_SYNCOBJ_TIMELINE_ARRAY_SELECTOR_SUBMIT_POINT)
return -EINVAL;
if (args->count_handles == 0)
@@ -1346,6 +1347,18 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data,
if (ret)
goto error;
break;
+
+ case DRM_SYNCOBJ_TIMELINE_ARRAY_SELECTOR_SUBMIT_POINT:
+ fence = drm_syncobj_fence_get(syncobjs[i]);
+ chain = to_dma_fence_chain(fence);
+ point = chain ? chain->base.seqno : 0;
+ dma_fence_put(fence);
+
+ ret = copy_to_user(&points[i], &point, sizeof(uint64_t));
+ ret = ret ? -EFAULT : 0;
+ if (ret)
+ goto error;
+ break;
}
}
@@ -785,6 +785,7 @@ struct drm_syncobj_timeline_array {
__u32 selector;
#define DRM_SYNCOBJ_TIMELINE_ARRAY_SELECTOR_SIGNALED_POINT (0)
#define DRM_SYNCOBJ_TIMELINE_ARRAY_SELECTOR_SIDEBAND_PAYLOAD (1)
+#define DRM_SYNCOBJ_TIMELINE_ARRAY_SELECTOR_SUBMIT_POINT (2)
};
This feature was talked about by David. It allows userspace to query the last submitted point on a timeline. Following the previous commit it made sense to add it. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> --- drivers/gpu/drm/drm_syncobj.c | 15 ++++++++++++++- include/uapi/drm/drm.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-)