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.

Dependency Surface

Detected Declarations

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

Implementation Notes