drivers/gpu/ipu-v3/ipu-image-convert.c
Source file repositories/reference/linux-study-clean/drivers/gpu/ipu-v3/ipu-image-convert.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/ipu-v3/ipu-image-convert.c- Extension
.c- Size
- 69517 bytes
- Lines
- 2461
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/interrupt.hlinux/dma-mapping.hlinux/math.hvideo/imx-ipu-image-convert.hipu-prv.h
Detected Declarations
struct ipu_image_convert_dma_bufstruct ipu_image_convert_dma_chanstruct ipu_image_tilestruct ipu_image_convert_imagestruct ipu_image_pixfmtstruct ipu_image_convert_ctxstruct ipu_image_convert_chanstruct ipu_image_convert_privstruct ipu_image_convert_ctxstruct ipu_image_convert_chanstruct ipu_image_convert_privenum ipu_image_convert_typeenum eof_irq_maskfunction dump_formatfunction free_dma_buffunction alloc_dma_buffunction num_stripesfunction calc_image_resize_coefficientsfunction find_best_seamfunction tile_left_alignfunction tile_top_alignfunction tile_width_alignfunction tile_height_alignfunction fill_tile_columnfunction fill_tile_rowfunction find_seamsfunction calc_tile_dimensionsfunction transform_tile_indexfunction calc_out_tile_mapfunction calc_tile_offsets_planarfunction calc_tile_offsets_packedfunction calc_tile_offsetsfunction distortionfunction calc_tile_resize_coefficientsfunction queuefunction list_for_each_entryfunction convert_stopfunction init_idmac_channelfunction convert_startfunction do_runfunction run_nextfunction list_for_each_entry_safefunction empty_done_qfunction do_bhfunction ic_settings_changedfunction do_tile_completefunction eof_irqfunction ipu_image_convert_abort
Annotated Snippet
struct ipu_image_convert_dma_buf {
void *virt;
dma_addr_t phys;
unsigned long len;
};
struct ipu_image_convert_dma_chan {
int in;
int out;
int rot_in;
int rot_out;
int vdi_in_p;
int vdi_in;
int vdi_in_n;
};
/* dimensions of one tile */
struct ipu_image_tile {
u32 width;
u32 height;
u32 left;
u32 top;
/* size and strides are in bytes */
u32 size;
u32 stride;
u32 rot_stride;
/* start Y or packed offset of this tile */
u32 offset;
/* offset from start to tile in U plane, for planar formats */
u32 u_off;
/* offset from start to tile in V plane, for planar formats */
u32 v_off;
};
struct ipu_image_convert_image {
struct ipu_image base;
enum ipu_image_convert_type type;
const struct ipu_image_pixfmt *fmt;
unsigned int stride;
/* # of rows (horizontal stripes) if dest height is > 1024 */
unsigned int num_rows;
/* # of columns (vertical stripes) if dest width is > 1024 */
unsigned int num_cols;
struct ipu_image_tile tile[MAX_TILES];
};
struct ipu_image_pixfmt {
u32 fourcc; /* V4L2 fourcc */
int bpp; /* total bpp */
int uv_width_dec; /* decimation in width for U/V planes */
int uv_height_dec; /* decimation in height for U/V planes */
bool planar; /* planar format */
bool uv_swapped; /* U and V planes are swapped */
bool uv_packed; /* partial planar (U and V in same plane) */
};
struct ipu_image_convert_ctx;
struct ipu_image_convert_chan;
struct ipu_image_convert_priv;
enum eof_irq_mask {
EOF_IRQ_IN = BIT(0),
EOF_IRQ_ROT_IN = BIT(1),
EOF_IRQ_OUT = BIT(2),
EOF_IRQ_ROT_OUT = BIT(3),
};
#define EOF_IRQ_COMPLETE (EOF_IRQ_IN | EOF_IRQ_OUT)
#define EOF_IRQ_ROT_COMPLETE (EOF_IRQ_IN | EOF_IRQ_OUT | \
EOF_IRQ_ROT_IN | EOF_IRQ_ROT_OUT)
struct ipu_image_convert_ctx {
struct ipu_image_convert_chan *chan;
ipu_image_convert_cb_t complete;
void *complete_context;
/* Source/destination image data and rotation mode */
struct ipu_image_convert_image in;
struct ipu_image_convert_image out;
struct ipu_ic_csc csc;
enum ipu_rotate_mode rot_mode;
u32 downsize_coeff_h;
u32 downsize_coeff_v;
u32 image_resize_coeff_h;
u32 image_resize_coeff_v;
u32 resize_coeffs_h[MAX_STRIPES_W];
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/dma-mapping.h`, `linux/math.h`, `video/imx-ipu-image-convert.h`, `ipu-prv.h`.
- Detected declarations: `struct ipu_image_convert_dma_buf`, `struct ipu_image_convert_dma_chan`, `struct ipu_image_tile`, `struct ipu_image_convert_image`, `struct ipu_image_pixfmt`, `struct ipu_image_convert_ctx`, `struct ipu_image_convert_chan`, `struct ipu_image_convert_priv`, `struct ipu_image_convert_ctx`, `struct ipu_image_convert_chan`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration 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.