render/drm_syncobj: add wlr_drm_syncobj_timeline_export()

master
Simon Ser 9 months ago
parent 5552de65f8
commit edb867bc05

@ -62,6 +62,10 @@ struct wlr_drm_syncobj_timeline *wlr_drm_syncobj_timeline_ref(struct wlr_drm_syn
* Unreference a synchronization timeline.
*/
void wlr_drm_syncobj_timeline_unref(struct wlr_drm_syncobj_timeline *timeline);
/**
* Export a drm_syncobj FD from a timeline.
*/
int wlr_drm_syncobj_timeline_export(struct wlr_drm_syncobj_timeline *timeline);
/**
* Transfer a point from a timeline to another.
*

@ -67,6 +67,15 @@ void wlr_drm_syncobj_timeline_unref(struct wlr_drm_syncobj_timeline *timeline) {
free(timeline);
}
int wlr_drm_syncobj_timeline_export(struct wlr_drm_syncobj_timeline *timeline) {
int drm_syncobj_fd = -1;
if (drmSyncobjHandleToFD(timeline->drm_fd, timeline->handle, &drm_syncobj_fd) != 0) {
wlr_log_errno(WLR_ERROR, "drmSyncobjHandleToFD failed");
return -1;
}
return drm_syncobj_fd;
}
bool wlr_drm_syncobj_timeline_transfer(struct wlr_drm_syncobj_timeline *dst,
uint64_t dst_point, struct wlr_drm_syncobj_timeline *src, uint64_t src_point) {
assert(dst->drm_fd == src->drm_fd);

Loading…
Cancel
Save