drivers/gpu/drm/omapdrm/omap_dmm_priv.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/omapdrm/omap_dmm_priv.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/omapdrm/omap_dmm_priv.h
Extension
.h
Size
4669 bytes
Lines
194
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 pat_ctrl {
	u32 start:4;
	u32 dir:4;
	u32 lut_id:8;
	u32 sync:12;
	u32 ini:4;
};

struct pat {
	u32 next_pa;
	struct pat_area area;
	struct pat_ctrl ctrl;
	u32 data_pa;
};

#define DMM_FIXED_RETRY_COUNT 1000

/* create refill buffer big enough to refill all slots, plus 3 descriptors..
 * 3 descriptors is probably the worst-case for # of 2d-slices in a 1d area,
 * but I guess you don't hit that worst case at the same time as full area
 * refill
 */
#define DESCR_SIZE 128
#define REFILL_BUFFER_SIZE ((4 * 128 * 256) + (3 * DESCR_SIZE))

/* For OMAP5, a fixed offset is added to all Y coordinates for 1D buffers.
 * This is used in programming to address the upper portion of the LUT
*/
#define OMAP5_LUT_OFFSET       128

struct dmm;

struct dmm_txn {
	void *engine_handle;
	struct tcm *tcm;

	u8 *current_va;
	dma_addr_t current_pa;

	struct pat *last_pat;
};

struct refill_engine {
	int id;
	struct dmm *dmm;
	struct tcm *tcm;

	u8 *refill_va;
	dma_addr_t refill_pa;

	/* only one trans per engine for now */
	struct dmm_txn txn;

	bool async;

	struct completion compl;

	struct list_head idle_node;
};

struct dmm_platform_data {
	u32 cpu_cache_flags;
};

struct dmm {
	struct device *dev;
	dma_addr_t phys_base;
	void __iomem *base;
	int irq;

	struct page *dummy_page;
	dma_addr_t dummy_pa;

	void *refill_va;
	dma_addr_t refill_pa;

	/* refill engines */
	wait_queue_head_t engine_queue;
	struct list_head idle_head;
	struct refill_engine *engines;
	int num_engines;
	atomic_t engine_counter;

	/* container information */
	int container_width;
	int container_height;
	int lut_width;
	int lut_height;
	int num_lut;

Annotation

Implementation Notes