mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-27 07:58:59 -04:00
render/drm_syncobj: add wlr_drm_syncobj_timeline_transfer()
This commit is contained in:
parent
3067e45c2e
commit
5552de65f8
2 changed files with 20 additions and 0 deletions
|
|
@ -62,6 +62,13 @@ struct wlr_drm_syncobj_timeline *wlr_drm_syncobj_timeline_ref(struct wlr_drm_syn
|
||||||
* Unreference a synchronization timeline.
|
* Unreference a synchronization timeline.
|
||||||
*/
|
*/
|
||||||
void wlr_drm_syncobj_timeline_unref(struct wlr_drm_syncobj_timeline *timeline);
|
void wlr_drm_syncobj_timeline_unref(struct wlr_drm_syncobj_timeline *timeline);
|
||||||
|
/**
|
||||||
|
* Transfer a point from a timeline to another.
|
||||||
|
*
|
||||||
|
* Both timelines must have been created with the same DRM 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);
|
||||||
/**
|
/**
|
||||||
* Check if a timeline point has been signalled or has materialized.
|
* Check if a timeline point has been signalled or has materialized.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,19 @@ void wlr_drm_syncobj_timeline_unref(struct wlr_drm_syncobj_timeline *timeline) {
|
||||||
free(timeline);
|
free(timeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
if (drmSyncobjTransfer(dst->drm_fd, dst->handle, dst_point,
|
||||||
|
src->handle, src_point, 0) != 0) {
|
||||||
|
wlr_log_errno(WLR_ERROR, "drmSyncobjTransfer failed");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int wlr_drm_syncobj_timeline_export_sync_file(struct wlr_drm_syncobj_timeline *timeline,
|
int wlr_drm_syncobj_timeline_export_sync_file(struct wlr_drm_syncobj_timeline *timeline,
|
||||||
uint64_t src_point) {
|
uint64_t src_point) {
|
||||||
int sync_file_fd = -1;
|
int sync_file_fd = -1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue