<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 6, 2018 at 4:56 PM, Keith Packard <span dir="ltr"><<a href="mailto:keithp@keithp.com" target="_blank">keithp@keithp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">crtc_queue_syncobj creates a new syncobj that will get signaled at a<br>
specified vblank sequence count.<br>
<br>
crtc_get_syncobj returns the time and vblank sequence count when the<br>
syncobj was signaled.<br>
<br>
The pair of these allows use of syncobjs instead of events for<br>
monitoring vblank activity.<br>
<br>
Signed-off-by: Keith Packard <<a href="mailto:keithp@keithp.com">keithp@keithp.com</a>><br>
---<br>
drivers/gpu/drm/drm_file.c | 5 +<br>
drivers/gpu/drm/drm_internal.h | 4 +<br>
drivers/gpu/drm/drm_ioctl.c | 2 +<br>
drivers/gpu/drm/drm_syncobj.c | 13 ++-<br>
drivers/gpu/drm/drm_vblank.c | 212 ++++++++++++++++++++++++++++++<wbr>+++++++----<br>
include/drm/drm_file.h | 11 ++-<br>
include/drm/drm_syncobj.h | 13 +++<br>
include/uapi/drm/drm.h | 17 ++++<br>
8 files changed, 253 insertions(+), 24 deletions(-)<br></blockquote><div><br>[...]<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h<br>
index 6fdff5945c8a..7a996f73e972 100644<br>
--- a/include/uapi/drm/drm.h<br>
+++ b/include/uapi/drm/drm.h<br>
@@ -759,6 +759,21 @@ struct drm_crtc_queue_sequence {<br>
__u64 user_data; /* user data passed to event */<br>
};<br>
<br>
+struct drm_crtc_queue_syncobj {<br>
+ __u32 crtc_id;<br>
+ __u32 flags;<br>
+ __u64 sequence;<br></blockquote><div><br></div><div>Is the given sequence number guaranteed to be hit in finite time?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ __u32 handle; /* return syncobj handle */<br>
+ __u32 pad;<br>
+};<br>
+<br>
+struct drm_crtc_get_syncobj {<br>
+ __u32 handle; /* signaled syncobj */<br>
+ __u32 pad;<br>
+ __u64 sequence; /* return: sequence when syncobj was signaled */<br>
+ __u64 sequence_ns; /* return: time when syncobj was signaled */<br></blockquote><div><br></div><div>Just to make sure I've got this straight, the client queues a syncobj with queue_syncobj to fire at a given sequence number. Once the syncobj has fired (which it can find out by waiting on it), it then calls get_syncobj to figure out when it was fired?<br><br></div><div>If so, what happens if a syncobj is re-used? Do you just loose the information?<br><br></div><div>If we have a finite time guarantee, I'm kind-of thinking a sync_file might be better as it's a one-shot and doesn't have the information loss problem. I'm not actually sure though.<br><br></div><div>This whole "wait for a syncobj and then ask when it fired" thing is a bit odd. I'll have to think on it.<br></div><div><br></div><div>--Jason<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+};<br>
+<br>
#if defined(__cplusplus)<br>
}<br>
#endif<br>
@@ -843,6 +858,8 @@ extern "C" {<br>
<br>
#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence)<br>
#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence)<br>
+#define DRM_IOCTL_CRTC_QUEUE_SYNCOBJ DRM_IOWR(0x3d, struct drm_crtc_queue_syncobj)<br>
+#define DRM_IOCTL_CRTC_GET_SYNCOBJ DRM_IOWR(0x3e, struct drm_crtc_get_syncobj)<br>
<br>
#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.16.2<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.<wbr>org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/dri-devel</a><br>
</div></div></blockquote></div><br></div></div>