drivers/media/platform/renesas/rcar-vin/rcar-dma.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/renesas/rcar-vin/rcar-dma.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/renesas/rcar-vin/rcar-dma.c- Extension
.c- Size
- 44596 bytes
- Lines
- 1607
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/interrupt.hlinux/pm_runtime.hmedia/v4l2-event.hmedia/videobuf2-dma-contig.hrcar-vin.h
Detected Declarations
struct rvin_bufferstruct vin_coefffunction rvin_writefunction rvin_readfunction rvin_scaler_neededfunction rvin_set_coefffunction rvin_scaler_gen2function rvin_uds_scale_ratiofunction rvin_uds_filter_widthfunction rvin_scaler_gen3function rvin_crop_scale_compfunction rvin_setupfunction rvin_capture_activefunction rvin_get_active_fieldfunction rvin_set_slot_addrfunction rvin_fill_hw_slotfunction rvin_capture_startfunction rvin_capture_stopfunction rvin_irqfunction return_unused_buffersfunction list_for_each_entry_safefunction rvin_queue_setupfunction rvin_buffer_preparefunction rvin_buffer_queuefunction rvin_mc_validate_formatfunction rvin_set_streamfunction rvin_start_streamingfunction rvin_start_streaming_vqfunction rvin_stop_streamingfunction rvin_stop_streaming_vqfunction rvin_dma_unregisterfunction rvin_dma_registerfunction rvin_set_channel_routingfunction rvin_set_alpha
Annotated Snippet
struct rvin_buffer {
struct vb2_v4l2_buffer vb;
struct list_head list;
};
#define to_buf_list(vb2_buffer) (&container_of(vb2_buffer, \
struct rvin_buffer, \
vb)->list)
static void rvin_write(struct rvin_dev *vin, u32 value, u32 offset)
{
iowrite32(value, vin->base + offset);
}
static u32 rvin_read(struct rvin_dev *vin, u32 offset)
{
return ioread32(vin->base + offset);
}
/* -----------------------------------------------------------------------------
* Crop and Scaling
*/
static bool rvin_scaler_needed(const struct rvin_dev *vin)
{
return !(vin->crop.width == vin->format.width &&
vin->compose.width == vin->format.width &&
vin->crop.height == vin->format.height &&
vin->compose.height == vin->format.height);
}
struct vin_coeff {
unsigned short xs_value;
u32 coeff_set[24];
};
static const struct vin_coeff vin_coeff_set[] = {
{ 0x0000, {
0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000 },
},
{ 0x1000, {
0x000fa400, 0x000fa400, 0x09625902,
0x000003f8, 0x00000403, 0x3de0d9f0,
0x001fffed, 0x00000804, 0x3cc1f9c3,
0x001003de, 0x00000c01, 0x3cb34d7f,
0x002003d2, 0x00000c00, 0x3d24a92d,
0x00200bca, 0x00000bff, 0x3df600d2,
0x002013cc, 0x000007ff, 0x3ed70c7e,
0x00100fde, 0x00000000, 0x3f87c036 },
},
{ 0x1200, {
0x002ffff1, 0x002ffff1, 0x02a0a9c8,
0x002003e7, 0x001ffffa, 0x000185bc,
0x002007dc, 0x000003ff, 0x3e52859c,
0x00200bd4, 0x00000002, 0x3d53996b,
0x00100fd0, 0x00000403, 0x3d04ad2d,
0x00000bd5, 0x00000403, 0x3d35ace7,
0x3ff003e4, 0x00000801, 0x3dc674a1,
0x3fffe800, 0x00000800, 0x3e76f461 },
},
{ 0x1400, {
0x00100be3, 0x00100be3, 0x04d1359a,
0x00000fdb, 0x002003ed, 0x0211fd93,
0x00000fd6, 0x002003f4, 0x0002d97b,
0x000007d6, 0x002ffffb, 0x3e93b956,
0x3ff003da, 0x001003ff, 0x3db49926,
0x3fffefe9, 0x00100001, 0x3d655cee,
0x3fffd400, 0x00000003, 0x3d65f4b6,
0x000fb421, 0x00000402, 0x3dc6547e },
},
{ 0x1600, {
0x00000bdd, 0x00000bdd, 0x06519578,
0x3ff007da, 0x00000be3, 0x03c24973,
0x3ff003d9, 0x00000be9, 0x01b30d5f,
0x3ffff7df, 0x001003f1, 0x0003c542,
0x000fdfec, 0x001003f7, 0x3ec4711d,
0x000fc400, 0x002ffffd, 0x3df504f1,
0x001fa81a, 0x002ffc00, 0x3d957cc2,
0x002f8c3c, 0x00100000, 0x3db5c891 },
},
{ 0x1800, {
0x3ff003dc, 0x3ff003dc, 0x0791e558,
0x000ff7dd, 0x3ff007de, 0x05328554,
Annotation
- Immediate include surface: `linux/delay.h`, `linux/interrupt.h`, `linux/pm_runtime.h`, `media/v4l2-event.h`, `media/videobuf2-dma-contig.h`, `rcar-vin.h`.
- Detected declarations: `struct rvin_buffer`, `struct vin_coeff`, `function rvin_write`, `function rvin_read`, `function rvin_scaler_needed`, `function rvin_set_coeff`, `function rvin_scaler_gen2`, `function rvin_uds_scale_ratio`, `function rvin_uds_filter_width`, `function rvin_scaler_gen3`.
- 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.