1 // SPDX-License-Identifier: GPL-2.0+
2 /* Copyright (C) 2017-2018 Broadcom */
6 struct dma_fence
*v3d_fence_create(struct v3d_dev
*v3d
, enum v3d_queue queue
)
8 struct v3d_fence
*fence
;
10 fence
= kzalloc(sizeof(*fence
), GFP_KERNEL
);
12 return ERR_PTR(-ENOMEM
);
14 fence
->dev
= &v3d
->drm
;
16 fence
->seqno
= ++v3d
->queue
[queue
].emit_seqno
;
17 dma_fence_init(&fence
->base
, &v3d_fence_ops
, &v3d
->job_lock
,
18 v3d
->queue
[queue
].fence_context
, fence
->seqno
);
23 static const char *v3d_fence_get_driver_name(struct dma_fence
*fence
)
28 static const char *v3d_fence_get_timeline_name(struct dma_fence
*fence
)
30 struct v3d_fence
*f
= to_v3d_fence(fence
);
44 const struct dma_fence_ops v3d_fence_ops
= {
45 .get_driver_name
= v3d_fence_get_driver_name
,
46 .get_timeline_name
= v3d_fence_get_timeline_name
,