drivers/media/platform/renesas/rcar_jpu.c

Source file repositories/reference/linux-study-clean/drivers/media/platform/renesas/rcar_jpu.c

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/renesas/rcar_jpu.c
Extension
.c
Size
49397 bytes
Lines
1738
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 jpu {
	struct mutex	mutex;
	spinlock_t	lock;
	struct v4l2_device	v4l2_dev;
	struct video_device	vfd_encoder;
	struct video_device	vfd_decoder;
	struct v4l2_m2m_dev	*m2m_dev;
	struct jpu_ctx		*curr;

	void __iomem		*regs;
	unsigned int		irq;
	struct clk		*clk;
	struct device		*dev;
	int			ref_count;
};

/**
 * struct jpu_buffer - driver's specific video buffer
 * @buf: m2m buffer
 * @compr_quality: destination image quality in compression mode
 * @subsampling: source image subsampling in decompression mode
 */
struct jpu_buffer {
	struct v4l2_m2m_buffer buf;
	unsigned short	compr_quality;
	unsigned char	subsampling;
};

/**
 * struct jpu_fmt - driver's internal format data
 * @fourcc: the fourcc code, 0 if not applicable
 * @colorspace: the colorspace specifier
 * @bpp: number of bits per pixel per plane
 * @h_align: horizontal alignment order (align to 2^h_align)
 * @v_align: vertical alignment order (align to 2^v_align)
 * @subsampling: (horizontal:4 | vertical:4) subsampling factor
 * @num_planes: number of planes
 * @types: types of queue this format is applicable to
 */
struct jpu_fmt {
	u32 fourcc;
	u32 colorspace;
	u8 bpp[2];
	u8 h_align;
	u8 v_align;
	u8 subsampling;
	u8 num_planes;
	u16 types;
};

/**
 * struct jpu_q_data - parameters of one queue
 * @fmtinfo: driver-specific format of this queue
 * @format: multiplanar format of this queue
 * @sequence: sequence number
 */
struct jpu_q_data {
	struct jpu_fmt *fmtinfo;
	struct v4l2_pix_format_mplane format;
	unsigned int sequence;
};

/**
 * struct jpu_ctx - the device context data
 * @jpu: JPEG IP device for this context
 * @encoder: compression (encode) operation or decompression (decode)
 * @compr_quality: destination image quality in compression (encode) mode
 * @out_q: source (output) queue information
 * @cap_q: destination (capture) queue information
 * @fh: file handler
 * @ctrl_handler: controls handler
 */
struct jpu_ctx {
	struct jpu		*jpu;
	bool			encoder;
	unsigned short		compr_quality;
	struct jpu_q_data	out_q;
	struct jpu_q_data	cap_q;
	struct v4l2_fh		fh;
	struct v4l2_ctrl_handler ctrl_handler;
};

 /**
 * jpeg_buffer - description of memory containing input JPEG data
 * @end: end position in the buffer
 * @curr: current position in the buffer
 */
struct jpeg_buffer {
	void *end;
	void *curr;

Annotation

Implementation Notes