drivers/gpu/ipu-v3/ipu-ic.c
Source file repositories/reference/linux-study-clean/drivers/gpu/ipu-v3/ipu-ic.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/ipu-v3/ipu-ic.c- Extension
.c- Size
- 17325 bytes
- Lines
- 689
- 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.
- 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/types.hlinux/init.hlinux/errno.hlinux/spinlock.hlinux/bitrev.hlinux/io.hlinux/err.hlinux/sizes.hipu-prv.h
Detected Declarations
struct ic_task_regoffsstruct ic_task_bitfieldsstruct ipu_ic_privstruct ipu_icstruct ipu_ic_privfunction ipu_ic_readfunction ipu_ic_writefunction init_cscfunction calc_resize_coeffsfunction ipu_ic_task_enablefunction ipu_ic_task_disablefunction ipu_ic_task_init_rscfunction ipu_ic_task_initfunction ipu_ic_task_idma_initfunction ipu_irt_enablefunction ipu_irt_disablefunction ipu_ic_enablefunction ipu_ic_disablefunction ipu_ic_putfunction ipu_ic_initfunction ipu_ic_exitexport ipu_ic_task_enableexport ipu_ic_task_disableexport ipu_ic_task_initexport ipu_ic_task_idma_initexport ipu_ic_enableexport ipu_ic_disableexport ipu_ic_getexport ipu_ic_putexport ipu_ic_dump
Annotated Snippet
struct ic_task_regoffs {
u32 rsc;
u32 tpmem_csc[2];
};
struct ic_task_bitfields {
u32 ic_conf_en;
u32 ic_conf_rot_en;
u32 ic_conf_cmb_en;
u32 ic_conf_csc1_en;
u32 ic_conf_csc2_en;
u32 ic_cmb_galpha_bit;
};
static const struct ic_task_regoffs ic_task_reg[IC_NUM_TASKS] = {
[IC_TASK_ENCODER] = {
.rsc = IC_PRP_ENC_RSC,
.tpmem_csc = {0x2008, 0},
},
[IC_TASK_VIEWFINDER] = {
.rsc = IC_PRP_VF_RSC,
.tpmem_csc = {0x4028, 0x4040},
},
[IC_TASK_POST_PROCESSOR] = {
.rsc = IC_PP_RSC,
.tpmem_csc = {0x6060, 0x6078},
},
};
static const struct ic_task_bitfields ic_task_bit[IC_NUM_TASKS] = {
[IC_TASK_ENCODER] = {
.ic_conf_en = IC_CONF_PRPENC_EN,
.ic_conf_rot_en = IC_CONF_PRPENC_ROT_EN,
.ic_conf_cmb_en = 0, /* NA */
.ic_conf_csc1_en = IC_CONF_PRPENC_CSC1,
.ic_conf_csc2_en = 0, /* NA */
.ic_cmb_galpha_bit = 0, /* NA */
},
[IC_TASK_VIEWFINDER] = {
.ic_conf_en = IC_CONF_PRPVF_EN,
.ic_conf_rot_en = IC_CONF_PRPVF_ROT_EN,
.ic_conf_cmb_en = IC_CONF_PRPVF_CMB,
.ic_conf_csc1_en = IC_CONF_PRPVF_CSC1,
.ic_conf_csc2_en = IC_CONF_PRPVF_CSC2,
.ic_cmb_galpha_bit = 0,
},
[IC_TASK_POST_PROCESSOR] = {
.ic_conf_en = IC_CONF_PP_EN,
.ic_conf_rot_en = IC_CONF_PP_ROT_EN,
.ic_conf_cmb_en = IC_CONF_PP_CMB,
.ic_conf_csc1_en = IC_CONF_PP_CSC1,
.ic_conf_csc2_en = IC_CONF_PP_CSC2,
.ic_cmb_galpha_bit = 8,
},
};
struct ipu_ic_priv;
struct ipu_ic {
enum ipu_ic_task task;
const struct ic_task_regoffs *reg;
const struct ic_task_bitfields *bit;
struct ipu_ic_colorspace in_cs;
struct ipu_ic_colorspace g_in_cs;
struct ipu_ic_colorspace out_cs;
bool graphics;
bool rotation;
bool in_use;
struct ipu_ic_priv *priv;
};
struct ipu_ic_priv {
void __iomem *base;
void __iomem *tpmem_base;
spinlock_t lock;
struct ipu_soc *ipu;
int use_count;
int irt_use_count;
struct ipu_ic task[IC_NUM_TASKS];
};
static inline u32 ipu_ic_read(struct ipu_ic *ic, unsigned offset)
{
return readl(ic->priv->base + offset);
}
static inline void ipu_ic_write(struct ipu_ic *ic, u32 value, unsigned offset)
Annotation
- Immediate include surface: `linux/types.h`, `linux/init.h`, `linux/errno.h`, `linux/spinlock.h`, `linux/bitrev.h`, `linux/io.h`, `linux/err.h`, `linux/sizes.h`.
- Detected declarations: `struct ic_task_regoffs`, `struct ic_task_bitfields`, `struct ipu_ic_priv`, `struct ipu_ic`, `struct ipu_ic_priv`, `function ipu_ic_read`, `function ipu_ic_write`, `function init_csc`, `function calc_resize_coeffs`, `function ipu_ic_task_enable`.
- 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.
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.