drivers/media/platform/imagination/e5010-jpeg-enc.h

Source file repositories/reference/linux-study-clean/drivers/media/platform/imagination/e5010-jpeg-enc.h

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/imagination/e5010-jpeg-enc.h
Extension
.h
Size
3887 bytes
Lines
174
Domain
Driver Families
Bucket
drivers/media
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 e5010_q_data {
	struct e5010_fmt	*fmt;
	u32			width;
	u32			height;
	u32			width_adjusted;
	u32			height_adjusted;
	u32			sizeimage[MAX_PLANES];
	u32			bytesperline[MAX_PLANES];
	u32			sequence;
	struct v4l2_rect	crop;
	bool			crop_set;
};

/*
 * Driver device structure
 * Holds all memory handles and global parameters
 * Shared by all instances
 */
struct e5010_dev {
	struct device *dev;
	struct v4l2_device	v4l2_dev;
	struct v4l2_m2m_dev	*m2m_dev;
	struct video_device	*vdev;
	void __iomem		*core_base;
	void __iomem		*mmu_base;
	struct clk		*clk;
	struct e5010_context	*last_context_run;
	/* Protect access to device data */
	struct mutex		mutex;
	/* Protect access to hardware*/
	spinlock_t		hw_lock;
};

/*
 * Driver context structure
 * One of these exists for every m2m context
 * Holds context specific data
 */
struct e5010_context {
	struct v4l2_fh			fh;
	struct e5010_dev		*e5010;
	struct e5010_q_data		out_queue;
	struct e5010_q_data		cap_queue;
	int				quality;
	bool				update_qp;
	struct v4l2_ctrl_handler	ctrl_handler;
	u8				luma_qp[QP_TABLE_SIZE];
	u8				chroma_qp[QP_TABLE_SIZE];
};

static inline struct e5010_context *to_e5010_context(struct file *filp)
{
	return container_of(file_to_v4l2_fh(filp), struct e5010_context, fh);
}

/*
 * Buffer structure
 * Contains info for all buffers
 */
struct e5010_buffer {
	struct v4l2_m2m_buffer buffer;
};

enum {
	CHROMA_ORDER_CB_CR = 0, //UV ordering
	CHROMA_ORDER_CR_CB = 1, //VU ordering
};

enum {
	SUBSAMPLING_420 = 1,
	SUBSAMPLING_422 = 2,
};

/*
 * e5010 format structure
 * contains format information
 */
struct e5010_fmt {
	u32					fourcc;
	unsigned int				num_planes;
	unsigned int				type;
	u32					subsampling;
	u32					chroma_order;
	const struct v4l2_frmsize_stepwise	frmsize;
};

/*
 * struct e5010_ctrl - contains info for each supported v4l2 control
 */
struct e5010_ctrl {

Annotation

Implementation Notes