drivers/media/platform/rockchip/rga/rga.h
Source file repositories/reference/linux-study-clean/drivers/media/platform/rockchip/rga/rga.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/rockchip/rga/rga.h- Extension
.h- Size
- 3678 bytes
- Lines
- 175
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bits.hlinux/clk.hlinux/platform_device.hmedia/videobuf2-v4l2.hmedia/v4l2-ctrls.hmedia/v4l2-device.h
Detected Declarations
struct rga_framestruct rga_dma_descstruct rockchip_rga_versionstruct rga_ctxstruct rga_hwstruct rockchip_rgastruct rga_addrsstruct rga_vb_bufferstruct rga_hwfunction rga_writefunction rga_readfunction rga_modfunction rga_has_internal_iommu
Annotated Snippet
struct rga_frame {
/* Crop */
struct v4l2_rect crop;
/* Image format */
void *fmt;
struct v4l2_pix_format_mplane pix;
};
struct rga_dma_desc {
u32 addr;
};
struct rockchip_rga_version {
u32 major;
u32 minor;
};
struct rga_ctx {
struct v4l2_fh fh;
struct rockchip_rga *rga;
struct rga_frame in;
struct rga_frame out;
struct v4l2_ctrl_handler ctrl_handler;
void *cmdbuf_virt;
dma_addr_t cmdbuf_phy;
bool cmdbuf_dirty;
int osequence;
int csequence;
/* Control values */
u32 op;
u32 hflip;
u32 vflip;
u32 rotate;
u32 fill_color;
};
static inline struct rga_ctx *file_to_rga_ctx(struct file *filp)
{
return container_of(file_to_v4l2_fh(filp), struct rga_ctx, fh);
}
struct rga_hw;
struct rockchip_rga {
struct v4l2_device v4l2_dev;
struct v4l2_m2m_dev *m2m_dev;
struct video_device *vfd;
struct device *dev;
struct regmap *grf;
void __iomem *regs;
struct clk_bulk_data *clks;
int num_clks;
struct rockchip_rga_version version;
/* vfd lock */
struct mutex mutex;
/* ctrl parm lock */
spinlock_t ctrl_lock;
struct rga_ctx *curr;
const struct rga_hw *hw;
};
struct rga_addrs {
dma_addr_t y_addr;
dma_addr_t u_addr;
dma_addr_t v_addr;
};
struct rga_vb_buffer {
struct vb2_v4l2_buffer vb_buf;
struct list_head queue;
/* RGA MMU mapping for this buffer */
struct rga_dma_desc *dma_desc;
dma_addr_t dma_desc_pa;
size_t n_desc;
/* Plane DMA addresses after the MMU mapping of the buffer */
struct rga_addrs dma_addrs;
};
static inline struct rga_vb_buffer *vb_to_rga(struct vb2_v4l2_buffer *vb)
{
Annotation
- Immediate include surface: `linux/bits.h`, `linux/clk.h`, `linux/platform_device.h`, `media/videobuf2-v4l2.h`, `media/v4l2-ctrls.h`, `media/v4l2-device.h`.
- Detected declarations: `struct rga_frame`, `struct rga_dma_desc`, `struct rockchip_rga_version`, `struct rga_ctx`, `struct rga_hw`, `struct rockchip_rga`, `struct rga_addrs`, `struct rga_vb_buffer`, `struct rga_hw`, `function rga_write`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.