include/drm/drm_device.h
Source file repositories/reference/linux-study-clean/include/drm/drm_device.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/drm_device.h- Extension
.h- Size
- 10447 bytes
- Lines
- 407
- 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/list.hlinux/kref.hlinux/mount.hlinux/mutex.hlinux/idr.hlinux/sched.hdrm/drm_mode_config.h
Detected Declarations
struct drm_driverstruct drm_minorstruct drm_masterstruct drm_vblank_crtcstruct drm_vma_offset_managerstruct drm_vram_mmstruct drm_fb_helperstruct inodestruct pci_devstruct pci_controllerstruct drm_wedge_task_infostruct drm_deviceenum switch_power_state
Annotated Snippet
struct drm_wedge_task_info {
/** @pid: pid of the task */
pid_t pid;
/** @comm: command name of the task */
char comm[TASK_COMM_LEN];
};
/**
* enum switch_power_state - power state of drm device
*/
enum switch_power_state {
/** @DRM_SWITCH_POWER_ON: Power state is ON */
DRM_SWITCH_POWER_ON = 0,
/** @DRM_SWITCH_POWER_OFF: Power state is OFF */
DRM_SWITCH_POWER_OFF = 1,
/** @DRM_SWITCH_POWER_CHANGING: Power state is changing */
DRM_SWITCH_POWER_CHANGING = 2,
/** @DRM_SWITCH_POWER_DYNAMIC_OFF: Suspended */
DRM_SWITCH_POWER_DYNAMIC_OFF = 3,
};
/**
* struct drm_device - DRM device structure
*
* This structure represent a complete card that
* may contain multiple heads.
*/
struct drm_device {
/** @if_version: Highest interface version set */
int if_version;
/** @ref: Object ref-count */
struct kref ref;
/** @dev: Device structure of bus-device */
struct device *dev;
/**
* @dma_dev:
*
* Device for DMA operations. Only required if the device @dev
* cannot perform DMA by itself. Should be NULL otherwise. Call
* drm_dev_dma_dev() to get the DMA device instead of using this
* field directly. Call drm_dev_set_dma_dev() to set this field.
*
* DRM devices are sometimes bound to virtual devices that cannot
* perform DMA by themselves. Drivers should set this field to the
* respective DMA controller.
*
* Devices on USB and other peripheral busses also cannot perform
* DMA by themselves. The @dma_dev field should point the bus
* controller that does DMA on behalve of such a device. Required
* for importing buffers via dma-buf.
*
* If set, the DRM core automatically releases the reference on the
* device.
*/
struct device *dma_dev;
/**
* @managed:
*
* Managed resources linked to the lifetime of this &drm_device as
* tracked by @ref.
*/
struct {
/** @managed.resources: managed resources list */
struct list_head resources;
/** @managed.final_kfree: pointer for final kfree() call */
void *final_kfree;
/** @managed.lock: protects @managed.resources */
spinlock_t lock;
} managed;
/** @driver: DRM driver managing the device */
const struct drm_driver *driver;
/**
* @dev_private:
*
* DRM driver private data. This is deprecated and should be left set to
* NULL.
*
* Instead of using this pointer it is recommended that drivers use
* devm_drm_dev_alloc() and embed struct &drm_device in their larger
* per-device structure.
Annotation
- Immediate include surface: `linux/list.h`, `linux/kref.h`, `linux/mount.h`, `linux/mutex.h`, `linux/idr.h`, `linux/sched.h`, `drm/drm_mode_config.h`.
- Detected declarations: `struct drm_driver`, `struct drm_minor`, `struct drm_master`, `struct drm_vblank_crtc`, `struct drm_vma_offset_manager`, `struct drm_vram_mm`, `struct drm_fb_helper`, `struct inode`, `struct pci_dev`, `struct pci_controller`.
- 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.