include/drm/drm_syncobj.h
Source file repositories/reference/linux-study-clean/include/drm/drm_syncobj.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/drm_syncobj.h- Extension
.h- Size
- 4045 bytes
- Lines
- 137
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/dma-fence.hlinux/dma-fence-chain.h
Detected Declarations
struct drm_filestruct drm_syncobjfunction drm_syncobj_getfunction drm_syncobj_putfunction drm_syncobj_fence_get
Annotated Snippet
struct drm_syncobj {
/**
* @refcount: Reference count of this object.
*/
struct kref refcount;
/**
* @fence:
* NULL or a pointer to the fence bound to this object.
*
* This field should not be used directly. Use drm_syncobj_fence_get()
* and drm_syncobj_replace_fence() instead.
*/
struct dma_fence __rcu *fence;
/**
* @cb_list: List of callbacks to call when the &fence gets replaced.
*/
struct list_head cb_list;
/**
* @ev_fd_list: List of registered eventfd.
*/
struct list_head ev_fd_list;
/**
* @lock: Protects &cb_list and &ev_fd_list, and write-locks &fence.
*/
spinlock_t lock;
/**
* @file: A file backing for this syncobj.
*/
struct file *file;
};
void drm_syncobj_free(struct kref *kref);
/**
* drm_syncobj_get - acquire a syncobj reference
* @obj: sync object
*
* This acquires an additional reference to @obj. It is illegal to call this
* without already holding a reference. No locks required.
*/
static inline void
drm_syncobj_get(struct drm_syncobj *obj)
{
kref_get(&obj->refcount);
}
/**
* drm_syncobj_put - release a reference to a sync object.
* @obj: sync object.
*/
static inline void
drm_syncobj_put(struct drm_syncobj *obj)
{
kref_put(&obj->refcount, drm_syncobj_free);
}
/**
* drm_syncobj_fence_get - get a reference to a fence in a sync object
* @syncobj: sync object.
*
* This acquires additional reference to &drm_syncobj.fence contained in @obj,
* if not NULL. It is illegal to call this without already holding a reference.
* No locks required.
*
* Returns:
* Either the fence of @obj or NULL if there's none.
*/
static inline struct dma_fence *
drm_syncobj_fence_get(struct drm_syncobj *syncobj)
{
struct dma_fence *fence;
rcu_read_lock();
fence = dma_fence_get_rcu_safe(&syncobj->fence);
rcu_read_unlock();
return fence;
}
struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
u32 handle);
void drm_syncobj_add_point(struct drm_syncobj *syncobj,
struct dma_fence_chain *chain,
struct dma_fence *fence,
uint64_t point);
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);
Annotation
- Immediate include surface: `linux/dma-fence.h`, `linux/dma-fence-chain.h`.
- Detected declarations: `struct drm_file`, `struct drm_syncobj`, `function drm_syncobj_get`, `function drm_syncobj_put`, `function drm_syncobj_fence_get`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.