include/drm/drm_file.h
Source file repositories/reference/linux-study-clean/include/drm/drm_file.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/drm_file.h- Extension
.h- Size
- 15275 bytes
- Lines
- 533
- 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/types.hlinux/completion.hlinux/idr.hlinux/xarray.huapi/drm/drm.hdrm/drm_prime.h
Detected Declarations
struct dma_fencestruct drm_filestruct drm_devicestruct drm_printerstruct devicestruct filestruct drm_minorstruct drm_pending_eventstruct drm_filestruct drm_memory_statsenum drm_minor_typeenum drm_gem_object_statusfunction drm_is_primary_clientfunction drm_is_render_clientfunction drm_is_accel_client
Annotated Snippet
struct drm_minor {
/* private: */
int index; /* Minor device number */
int type; /* Control or render or accel */
struct device *kdev; /* Linux device */
struct drm_device *dev;
struct dentry *debugfs_symlink;
struct dentry *debugfs_root;
};
/**
* struct drm_pending_event - Event queued up for userspace to read
*
* This represents a DRM event. Drivers can use this as a generic completion
* mechanism, which supports kernel-internal &struct completion, &struct dma_fence
* and also the DRM-specific &struct drm_event delivery mechanism.
*/
struct drm_pending_event {
/**
* @completion:
*
* Optional pointer to a kernel internal completion signalled when
* drm_send_event() is called, useful to internally synchronize with
* nonblocking operations.
*/
struct completion *completion;
/**
* @completion_release:
*
* Optional callback currently only used by the atomic modeset helpers
* to clean up the reference count for the structure @completion is
* stored in.
*/
void (*completion_release)(struct completion *completion);
/**
* @event:
*
* Pointer to the actual event that should be sent to userspace to be
* read using drm_read(). Can be optional, since nowadays events are
* also used to signal kernel internal threads with @completion or DMA
* transactions using @fence.
*/
struct drm_event *event;
/**
* @fence:
*
* Optional DMA fence to unblock other hardware transactions which
* depend upon the nonblocking DRM operation this event represents.
*/
struct dma_fence *fence;
/**
* @file_priv:
*
* &struct drm_file where @event should be delivered to. Only set when
* @event is set.
*/
struct drm_file *file_priv;
/**
* @link:
*
* Double-linked list to keep track of this event. Can be used by the
* driver up to the point when it calls drm_send_event(), after that
* this list entry is owned by the core for its own book-keeping.
*/
struct list_head link;
/**
* @pending_link:
*
* Entry on &drm_file.pending_event_list, to keep track of all pending
* events for @file_priv, to allow correct unwinding of them when
* userspace closes the file before the event is delivered.
*/
struct list_head pending_link;
};
/**
* struct drm_file - DRM file private data
*
* This structure tracks DRM state per open file descriptor.
*/
struct drm_file {
/**
* @authenticated:
Annotation
- Immediate include surface: `linux/types.h`, `linux/completion.h`, `linux/idr.h`, `linux/xarray.h`, `uapi/drm/drm.h`, `drm/drm_prime.h`.
- Detected declarations: `struct dma_fence`, `struct drm_file`, `struct drm_device`, `struct drm_printer`, `struct device`, `struct file`, `struct drm_minor`, `struct drm_pending_event`, `struct drm_file`, `struct drm_memory_stats`.
- 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.