drivers/media/platform/samsung/s5p-g2d/g2d.h
Source file repositories/reference/linux-study-clean/drivers/media/platform/samsung/s5p-g2d/g2d.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/samsung/s5p-g2d/g2d.h- Extension
.h- Size
- 1892 bytes
- Lines
- 85
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/platform_device.hmedia/v4l2-device.hmedia/v4l2-ctrls.h
Detected Declarations
struct g2d_devstruct g2d_framestruct g2d_ctxstruct g2d_fmtstruct g2d_variant
Annotated Snippet
struct g2d_dev {
struct v4l2_device v4l2_dev;
struct v4l2_m2m_dev *m2m_dev;
struct video_device *vfd;
struct mutex mutex;
spinlock_t ctrl_lock;
atomic_t num_inst;
void __iomem *regs;
struct clk *clk;
struct clk *gate;
struct g2d_ctx *curr;
struct g2d_variant *variant;
int irq;
};
struct g2d_frame {
/* Original dimensions */
u32 width;
u32 height;
/* Crop size */
u32 c_width;
u32 c_height;
/* Offset */
u32 o_width;
u32 o_height;
/* Image format */
struct g2d_fmt *fmt;
/* Variables that can calculated once and reused */
u32 stride;
u32 bottom;
u32 right;
u32 size;
};
struct g2d_ctx {
struct v4l2_fh fh;
struct g2d_dev *dev;
struct g2d_frame in;
struct g2d_frame out;
struct v4l2_ctrl *ctrl_hflip;
struct v4l2_ctrl *ctrl_vflip;
struct v4l2_ctrl_handler ctrl_handler;
u32 rop;
u32 flip;
};
struct g2d_fmt {
u32 fourcc;
int depth;
u32 hw;
};
struct g2d_variant {
unsigned short hw_rev;
};
void g2d_reset(struct g2d_dev *d);
void g2d_set_src_size(struct g2d_dev *d, struct g2d_frame *f);
void g2d_set_src_addr(struct g2d_dev *d, dma_addr_t a);
void g2d_set_dst_size(struct g2d_dev *d, struct g2d_frame *f);
void g2d_set_dst_addr(struct g2d_dev *d, dma_addr_t a);
void g2d_start(struct g2d_dev *d);
void g2d_clear_int(struct g2d_dev *d);
void g2d_set_rop4(struct g2d_dev *d, u32 r);
void g2d_set_flip(struct g2d_dev *d, u32 r);
void g2d_set_v41_stretch(struct g2d_dev *d,
struct g2d_frame *src, struct g2d_frame *dst);
void g2d_set_cmd(struct g2d_dev *d, u32 c);
Annotation
- Immediate include surface: `linux/platform_device.h`, `media/v4l2-device.h`, `media/v4l2-ctrls.h`.
- Detected declarations: `struct g2d_dev`, `struct g2d_frame`, `struct g2d_ctx`, `struct g2d_fmt`, `struct g2d_variant`.
- 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.
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.