drivers/gpu/drm/msm/msm_drv.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/msm_drv.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/msm_drv.h- Extension
.h- Size
- 16403 bytes
- Lines
- 557
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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/kernel.hlinux/clk.hlinux/cpufreq.hlinux/devfreq.hlinux/module.hlinux/component.hlinux/platform_device.hlinux/pm.hlinux/pm_runtime.hlinux/slab.hlinux/list.hlinux/iommu.hlinux/types.hlinux/of_graph.hlinux/of_device.hlinux/sizes.hlinux/kthread.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/display/drm_dsc.hdrm/msm_drm.hdrm/drm_gem.h
Detected Declarations
struct drm_fb_helperstruct drm_fb_helper_surface_sizestruct msm_kmsstruct msm_gpustruct msm_mmustruct msm_mdssstruct msm_rd_statestruct msm_gem_submitstruct msm_fence_contextstruct msm_disp_statestruct msm_drm_privatestruct msm_pending_timerstruct hdmistruct msm_dsistruct msm_dpstruct msm_hrtimer_workenum msm_dp_controllerenum msm_dsi_controllerfunction msm_hdmi_modeset_initfunction msm_hdmi_registerfunction msm_dsi_registerfunction msm_dsi_snapshotfunction msm_dsi_is_bonded_dsifunction msm_dsi_is_master_dsifunction msm_dsi_wide_bus_enabledfunction msm_dp_registerfunction msm_dp_unregisterfunction msm_dp_snapshotfunction msm_dp_needs_periph_flushfunction msm_dp_wide_bus_availablefunction msm_mdp4_registerfunction msm_mdp_registerfunction msm_dpu_registerfunction msm_mdss_registerfunction msm_debugfs_late_initfunction msm_rd_dump_submitfunction msm_rmwfunction align_pitchfunction timeout_to_jiffies
Annotated Snippet
struct msm_drm_private {
struct drm_device *dev;
struct msm_kms *kms;
int (*kms_init)(struct drm_device *dev);
/* subordinate devices, if present: */
struct platform_device *gpu_pdev;
/* when we have more than one 'msm_gpu' these need to be an array: */
struct msm_gpu *gpu;
/* gpu is only set on open(), but we need this info earlier */
bool is_a2xx;
bool has_cached_coherent;
struct msm_rd_state *rd; /* debugfs to dump all submits */
struct msm_rd_state *hangrd; /* debugfs to dump hanging submits */
/**
* total_mem: Total/global amount of memory backing GEM objects.
*/
atomic64_t total_mem;
/**
* List of all GEM objects (mainly for debugfs, protected by obj_lock
* (acquire before per GEM object lock)
*/
struct list_head objects;
struct mutex obj_lock;
/**
* lru:
*
* The various LRU's that a GEM object is in at various stages of
* it's lifetime. Objects start out in the unbacked LRU. When
* pinned (for scannout or permanently mapped GPU buffers, like
* ringbuffer, memptr, fw, etc) it moves to the pinned LRU. When
* unpinned, it moves into willneed or dontneed LRU depending on
* madvise state. When backing pages are evicted (willneed) or
* purged (dontneed) it moves back into the unbacked LRU.
*
* The dontneed LRU is considered by the shrinker for objects
* that are candidate for purging, and the willneed LRU is
* considered for objects that could be evicted.
*/
struct {
/**
* unbacked:
*
* The LRU for GEM objects without backing pages allocated.
* This mostly exists so that objects are always is one
* LRU.
*/
struct drm_gem_lru unbacked;
/**
* pinned:
*
* The LRU for pinned GEM objects
*/
struct drm_gem_lru pinned;
/**
* willneed:
*
* The LRU for unpinned GEM objects which are in madvise
* WILLNEED state (ie. can be evicted)
*/
struct drm_gem_lru willneed;
/**
* dontneed:
*
* The LRU for unpinned GEM objects which are in madvise
* DONTNEED state (ie. can be purged)
*/
struct drm_gem_lru dontneed;
} lru;
struct notifier_block vmap_notifier;
struct shrinker *shrinker;
/**
* hangcheck_period: For hang detection, in ms
*
* Note that in practice, a submit/job will get at least two hangcheck
* periods, due to checking for progress being implemented as simply
* "have the CP position registers changed since last time?"
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/clk.h`, `linux/cpufreq.h`, `linux/devfreq.h`, `linux/module.h`, `linux/component.h`, `linux/platform_device.h`, `linux/pm.h`.
- Detected declarations: `struct drm_fb_helper`, `struct drm_fb_helper_surface_size`, `struct msm_kms`, `struct msm_gpu`, `struct msm_mmu`, `struct msm_mdss`, `struct msm_rd_state`, `struct msm_gem_submit`, `struct msm_fence_context`, `struct msm_disp_state`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.