include/drm/drm_drv.h
Source file repositories/reference/linux-study-clean/include/drm/drm_drv.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/drm_drv.h- Extension
.h- Size
- 18198 bytes
- Lines
- 598
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hlinux/irqreturn.hvideo/nomodeset.hdrm/drm_device.h
Detected Declarations
struct dmem_cgroup_regionstruct drm_fb_helperstruct drm_fb_helper_surface_sizestruct drm_filestruct drm_gem_objectstruct drm_masterstruct drm_minorstruct dma_bufstruct dma_buf_attachmentstruct drm_display_modestruct drm_mode_create_dumbstruct drm_printerstruct sg_tablestruct drm_driverenum drm_driver_featurefunction drm_dev_unplugfunction drm_core_check_all_featuresfunction drm_core_check_featurefunction atomic_commitfunction drm_firmware_drivers_onlyfunction drm_debugfs_dev_init
Annotated Snippet
const struct file_operations *fops;
};
void *__devm_drm_dev_alloc(struct device *parent,
const struct drm_driver *driver,
size_t size, size_t offset);
struct dmem_cgroup_region *
drmm_cgroup_register_region(struct drm_device *dev,
const char *region_name, u64 size);
/**
* devm_drm_dev_alloc - Resource managed allocation of a &drm_device instance
* @parent: Parent device object
* @driver: DRM driver
* @type: the type of the struct which contains struct &drm_device
* @member: the name of the &drm_device within @type.
*
* This allocates and initialize a new DRM device. No device registration is done.
* Call drm_dev_register() to advertice the device to user space and register it
* with other core subsystems. This should be done last in the device
* initialization sequence to make sure userspace can't access an inconsistent
* state.
*
* The initial ref-count of the object is 1. Use drm_dev_get() and
* drm_dev_put() to take and drop further ref-counts.
*
* It is recommended that drivers embed &struct drm_device into their own device
* structure.
*
* Note that this manages the lifetime of the resulting &drm_device
* automatically using devres. The DRM device initialized with this function is
* automatically put on driver detach using drm_dev_put().
*
* RETURNS:
* Pointer to new DRM device, or ERR_PTR on failure.
*/
#define devm_drm_dev_alloc(parent, driver, type, member) \
((type *) __devm_drm_dev_alloc(parent, driver, sizeof(type), \
offsetof(type, member)))
struct drm_device *drm_dev_alloc(const struct drm_driver *driver,
struct device *parent);
void *__drm_dev_alloc(struct device *parent,
const struct drm_driver *driver,
size_t size, size_t offset);
int drm_dev_register(struct drm_device *dev, unsigned long flags);
void drm_dev_unregister(struct drm_device *dev);
void drm_dev_get(struct drm_device *dev);
void drm_dev_put(struct drm_device *dev);
void drm_put_dev(struct drm_device *dev);
bool drm_dev_enter(struct drm_device *dev, int *idx);
void drm_dev_exit(int idx);
void drm_dev_unplug(struct drm_device *dev);
int drm_dev_wedged_event(struct drm_device *dev, unsigned long method,
struct drm_wedge_task_info *info);
/**
* drm_dev_is_unplugged - is a DRM device unplugged
* @dev: DRM device
*
* This function can be called to check whether a hotpluggable is unplugged.
* Unplugging itself is singalled through drm_dev_unplug(). If a device is
* unplugged, these two functions guarantee that any store before calling
* drm_dev_unplug() is visible to callers of this function after it completes
*
* WARNING: This function fundamentally races against drm_dev_unplug(). It is
* recommended that drivers instead use the underlying drm_dev_enter() and
* drm_dev_exit() function pairs.
*/
static inline bool drm_dev_is_unplugged(struct drm_device *dev)
{
int idx;
if (drm_dev_enter(dev, &idx)) {
drm_dev_exit(idx);
return false;
}
return true;
}
/**
* drm_core_check_all_features - check driver feature flags mask
* @dev: DRM device to check
* @features: feature flag(s) mask
*
Annotation
- Immediate include surface: `linux/list.h`, `linux/irqreturn.h`, `video/nomodeset.h`, `drm/drm_device.h`.
- Detected declarations: `struct dmem_cgroup_region`, `struct drm_fb_helper`, `struct drm_fb_helper_surface_size`, `struct drm_file`, `struct drm_gem_object`, `struct drm_master`, `struct drm_minor`, `struct dma_buf`, `struct dma_buf_attachment`, `struct drm_display_mode`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: pattern 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.