1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
2 /* Copyright (c) 2023 Imagination Technologies Ltd. */
7 #include <uapi/drm/pvr_drm.h>
9 /* Forward declaration from <linux/xarray.h>. */
12 /* Forward declaration from <drm/drm_file.h>. */
15 /* Forward declaration from <drm/gpu_scheduler.h>. */
18 /* Forward declaration from "pvr_device.h". */
22 * struct pvr_sync_signal - Object encoding a syncobj signal operation
24 * The job submission logic collects all signal operations in an array of
25 * pvr_sync_signal objects. This array also serves as a cache to get the
26 * latest dma_fence when multiple jobs are submitted at once, and one job
27 * signals a syncobj point that's later waited on by a subsequent job.
29 struct pvr_sync_signal {
30 /** @handle: Handle of the syncobj to signal. */
34 * @point: Point to signal in the syncobj.
36 * Only relevant for timeline syncobjs.
40 /** @syncobj: Syncobj retrieved from the handle. */
41 struct drm_syncobj *syncobj;
44 * @chain: Chain object used to link the new fence with the
45 * existing timeline syncobj.
47 * Should be zero when manipulating a regular syncobj.
49 struct dma_fence_chain *chain;
52 * @fence: New fence object to attach to the syncobj.
54 * This pointer starts with the current fence bound to
55 * the <handle,point> pair.
57 struct dma_fence *fence;
61 pvr_sync_signal_array_cleanup(struct xarray *array);
64 pvr_sync_signal_array_collect_ops(struct xarray *array,
65 struct drm_file *file,
67 const struct drm_pvr_sync_op *sync_ops);
70 pvr_sync_signal_array_update_fences(struct xarray *array,
72 const struct drm_pvr_sync_op *sync_ops,
73 struct dma_fence *done_fence);
76 pvr_sync_signal_array_push_fences(struct xarray *array);
79 pvr_sync_add_deps_to_job(struct pvr_file *pvr_file, struct drm_sched_job *job,
81 const struct drm_pvr_sync_op *sync_ops,
82 struct xarray *signal_array);
84 #endif /* PVR_SYNC_H */