drivers/gpu/drm/sprd/sprd_dpu.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/sprd/sprd_dpu.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/sprd/sprd_dpu.h- Extension
.h- Size
- 2512 bytes
- Lines
- 110
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bug.hlinux/delay.hlinux/device.hlinux/kernel.hlinux/platform_device.hlinux/string.hvideo/videomode.hdrm/drm_crtc.hdrm/drm_fourcc.hdrm/drm_print.hdrm/drm_vblank.huapi/drm/drm_mode.h
Detected Declarations
struct dpu_contextstruct sprd_dpufunction dpu_reg_setfunction dpu_reg_clrfunction layer_reg_rdfunction layer_reg_wr
Annotated Snippet
struct dpu_context {
void __iomem *base;
int irq;
u8 if_type;
struct videomode vm;
bool stopped;
wait_queue_head_t wait_queue;
bool evt_update;
bool evt_stop;
};
/**
* Sprd DPU device structure
*
* @crtc: crtc object
* @drm: A point to drm device
* @ctx: DPU's implementation specific context object
*/
struct sprd_dpu {
struct drm_crtc base;
struct drm_device *drm;
struct dpu_context ctx;
};
static inline struct sprd_dpu *to_sprd_crtc(struct drm_crtc *crtc)
{
return container_of(crtc, struct sprd_dpu, base);
}
static inline void
dpu_reg_set(struct dpu_context *ctx, u32 offset, u32 set_bits)
{
u32 bits = readl_relaxed(ctx->base + offset);
writel(bits | set_bits, ctx->base + offset);
}
static inline void
dpu_reg_clr(struct dpu_context *ctx, u32 offset, u32 clr_bits)
{
u32 bits = readl_relaxed(ctx->base + offset);
writel(bits & ~clr_bits, ctx->base + offset);
}
static inline u32
layer_reg_rd(struct dpu_context *ctx, u32 offset, int index)
{
u32 layer_offset = offset + index * DPU_LAY_REG_OFFSET;
return readl(ctx->base + layer_offset);
}
static inline void
layer_reg_wr(struct dpu_context *ctx, u32 offset, u32 cfg_bits, int index)
{
u32 layer_offset = offset + index * DPU_LAY_REG_OFFSET;
writel(cfg_bits, ctx->base + layer_offset);
}
void sprd_dpu_run(struct sprd_dpu *dpu);
void sprd_dpu_stop(struct sprd_dpu *dpu);
#endif
Annotation
- Immediate include surface: `linux/bug.h`, `linux/delay.h`, `linux/device.h`, `linux/kernel.h`, `linux/platform_device.h`, `linux/string.h`, `video/videomode.h`, `drm/drm_crtc.h`.
- Detected declarations: `struct dpu_context`, `struct sprd_dpu`, `function dpu_reg_set`, `function dpu_reg_clr`, `function layer_reg_rd`, `function layer_reg_wr`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.