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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/unaligned.hlinux/clk.hlinux/err.hlinux/interrupt.hlinux/io.hlinux/kernel.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/slab.hlinux/spinlock.hlinux/string.hlinux/videodev2.hmedia/jpeg.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-event.hmedia/v4l2-fh.hmedia/v4l2-mem2mem.hmedia/v4l2-ioctl.hmedia/videobuf2-v4l2.hmedia/videobuf2-dma-contig.h
Detected Declarations
struct jpustruct jpu_bufferstruct jpu_fmtstruct jpu_q_datastruct jpu_ctxstruct jpeg_bufferfunction jpu_readfunction jpu_writefunction jpu_set_tblfunction jpu_set_qtblfunction jpu_set_htblfunction jpu_wait_resetfunction jpu_resetfunction put_qtblfunction put_htblfunction jpu_generate_hdrfunction get_bytefunction get_word_befunction skipfunction jpu_parse_hdrfunction jpu_querycapfunction jpu_enum_fmtfunction jpu_enum_fmt_capfunction jpu_enum_fmt_outfunction jpu_bound_align_imagefunction __jpu_try_fmtfunction jpu_try_fmtfunction jpu_s_fmtfunction jpu_g_fmtfunction jpu_s_ctrlfunction jpu_streamonfunction jpu_controls_createfunction jpu_queue_setupfunction jpu_buf_preparefunction jpu_buf_queuefunction jpu_buf_finishfunction jpu_start_streamingfunction jpu_stop_streamingfunction jpu_queue_initfunction jpu_openfunction jpu_releasefunction jpu_cleanupfunction jpu_device_runfunction jpu_irq_handlerfunction jpu_probefunction jpu_removefunction jpu_suspendfunction jpu_resume
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
- Immediate include surface: `linux/unaligned.h`, `linux/clk.h`, `linux/err.h`, `linux/interrupt.h`, `linux/io.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `struct jpu`, `struct jpu_buffer`, `struct jpu_fmt`, `struct jpu_q_data`, `struct jpu_ctx`, `struct jpeg_buffer`, `function jpu_read`, `function jpu_write`, `function jpu_set_tbl`, `function jpu_set_qtbl`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.