XenevaOS
Loading...
Searching...
No Matches
drm_syncobj.h
Go to the documentation of this file.
1/*
2 * Copyright © 2017 Red Hat
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 * Authors:
24 *
25 */
26#ifndef __DRM_SYNCOBJ_H__
27#define __DRM_SYNCOBJ_H__
28
29#include <linux/dma-fence.h>
31
32struct drm_file;
33
69
71
79static inline void
80drm_syncobj_get(struct drm_syncobj *obj)
81{
82 kref_get(&obj->refcount);
83}
84
89static inline void
90drm_syncobj_put(struct drm_syncobj *obj)
91{
92 kref_put(&obj->refcount, drm_syncobj_free);
93}
94
106static inline struct dma_fence *
107drm_syncobj_fence_get(struct drm_syncobj *syncobj)
108{
109 struct dma_fence *fence;
110
112 fence = dma_fence_get_rcu_safe(&syncobj->fence);
114
115 return fence;
116}
117
118struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
119 u32 handle);
121 struct dma_fence_chain *chain,
122 struct dma_fence *fence,
123 uint64_t point);
125 struct dma_fence *fence);
126int drm_syncobj_find_fence(struct drm_file *file_private,
127 u32 handle, u64 point, u64 flags,
128 struct dma_fence **fence);
129void drm_syncobj_free(struct kref *kref);
131 struct dma_fence *fence);
132int drm_syncobj_get_handle(struct drm_file *file_private,
133 struct drm_syncobj *syncobj, u32 *handle);
134int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd);
135
136#endif
uint8_t flags
Definition virtio.h:0
unsigned int uint32_t
Definition acefiex.h:163
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
#define __rcu
Definition compiler_types.h:72
struct drm_syncobj * drm_syncobj_find(struct drm_file *file_private, u32 handle)
int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd)
void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, struct dma_fence *fence)
int drm_syncobj_find_fence(struct drm_file *file_private, u32 handle, u64 point, u64 flags, struct dma_fence **fence)
int drm_syncobj_get_handle(struct drm_file *file_private, struct drm_syncobj *syncobj, u32 *handle)
void drm_syncobj_free(struct kref *kref)
void drm_syncobj_add_point(struct drm_syncobj *syncobj, struct dma_fence_chain *chain, struct dma_fence *fence, uint64_t point)
uint64_t u64
Definition kernel.h:17
int spinlock_t
Definition kernel.h:44
uint32_t u32
Definition kernel.h:16
#define rcu_read_unlock()
Definition rcupdate.h:33
#define rcu_read_lock()
Definition rcupdate.h:32
Definition dma-fence-chain.h:25
Definition dma-fence.h:70
Definition drm_file.h:165
Definition drm.h:924
Definition drm_syncobj.h:39
struct kref refcount
Definition drm_syncobj.h:43
struct dma_fence __rcu * fence
Definition drm_syncobj.h:51
struct list_head cb_list
Definition drm_syncobj.h:55
struct list_head ev_fd_list
Definition drm_syncobj.h:59
struct file * file
Definition drm_syncobj.h:67
spinlock_t lock
Definition drm_syncobj.h:63
Definition fs.h:142
Definition kref.h:44
Definition list.h:11