drivers/gpu/ipu-v3/ipu-prg.c
Source file repositories/reference/linux-study-clean/drivers/gpu/ipu-v3/ipu-prg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/ipu-v3/ipu-prg.c- Extension
.c- Size
- 11225 bytes
- Lines
- 479
- 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
drm/drm_fourcc.hlinux/clk.hlinux/err.hlinux/iopoll.hlinux/mfd/syscon.hlinux/mfd/syscon/imx6q-iomuxc-gpr.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hvideo/imx-ipu-v3.hipu-prv.h
Detected Declarations
struct ipu_prg_channelstruct ipu_prgfunction ipu_prg_lookup_by_phandlefunction ipu_prg_max_active_channelsfunction ipu_prg_presentfunction ipu_prg_format_supportedfunction ipu_prg_enablefunction ipu_prg_disablefunction ipu_prg_ipu_to_prg_chanfunction ipu_prg_get_prefunction ipu_prg_put_prefunction ipu_prg_channel_disablefunction ipu_prg_channel_configurefunction ipu_prg_channel_configure_pendingfunction ipu_prg_probefunction ipu_prg_removefunction prg_suspendfunction prg_resumeexport ipu_prg_max_active_channelsexport ipu_prg_presentexport ipu_prg_format_supportedexport ipu_prg_enableexport ipu_prg_disableexport ipu_prg_channel_disableexport ipu_prg_channel_configureexport ipu_prg_channel_configure_pending
Annotated Snippet
struct ipu_prg_channel {
bool enabled;
int used_pre;
};
struct ipu_prg {
struct list_head list;
struct device *dev;
int id;
void __iomem *regs;
struct clk *clk_ipg, *clk_axi;
struct regmap *iomuxc_gpr;
struct ipu_pre *pres[3];
struct ipu_prg_channel chan[3];
};
static DEFINE_MUTEX(ipu_prg_list_mutex);
static LIST_HEAD(ipu_prg_list);
struct ipu_prg *
ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
{
struct device_node *prg_node = of_parse_phandle(dev->of_node,
name, 0);
struct ipu_prg *prg;
mutex_lock(&ipu_prg_list_mutex);
list_for_each_entry(prg, &ipu_prg_list, list) {
if (prg_node == prg->dev->of_node) {
mutex_unlock(&ipu_prg_list_mutex);
device_link_add(dev, prg->dev,
DL_FLAG_AUTOREMOVE_CONSUMER);
prg->id = ipu_id;
of_node_put(prg_node);
return prg;
}
}
mutex_unlock(&ipu_prg_list_mutex);
of_node_put(prg_node);
return NULL;
}
int ipu_prg_max_active_channels(void)
{
return ipu_pre_get_available_count();
}
EXPORT_SYMBOL_GPL(ipu_prg_max_active_channels);
bool ipu_prg_present(struct ipu_soc *ipu)
{
if (ipu->prg_priv)
return true;
return false;
}
EXPORT_SYMBOL_GPL(ipu_prg_present);
bool ipu_prg_format_supported(struct ipu_soc *ipu, uint32_t format,
uint64_t modifier)
{
const struct drm_format_info *info = drm_format_info(format);
if (info->num_planes != 1)
return false;
switch (modifier) {
case DRM_FORMAT_MOD_LINEAR:
case DRM_FORMAT_MOD_VIVANTE_TILED:
case DRM_FORMAT_MOD_VIVANTE_SUPER_TILED:
return true;
default:
return false;
}
}
EXPORT_SYMBOL_GPL(ipu_prg_format_supported);
int ipu_prg_enable(struct ipu_soc *ipu)
{
struct ipu_prg *prg = ipu->prg_priv;
if (!prg)
return 0;
return pm_runtime_get_sync(prg->dev);
}
EXPORT_SYMBOL_GPL(ipu_prg_enable);
Annotation
- Immediate include surface: `drm/drm_fourcc.h`, `linux/clk.h`, `linux/err.h`, `linux/iopoll.h`, `linux/mfd/syscon.h`, `linux/mfd/syscon/imx6q-iomuxc-gpr.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `struct ipu_prg_channel`, `struct ipu_prg`, `function ipu_prg_lookup_by_phandle`, `function ipu_prg_max_active_channels`, `function ipu_prg_present`, `function ipu_prg_format_supported`, `function ipu_prg_enable`, `function ipu_prg_disable`, `function ipu_prg_ipu_to_prg_chan`, `function ipu_prg_get_pre`.
- 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.