drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c- Extension
.c- Size
- 11361 bytes
- Lines
- 440
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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.
- 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/bitfield.hlinux/clk.hlinux/delay.hlinux/io.hlinux/media-bus-format.hlinux/module.hlinux/of.hlinux/of_graph.hlinux/platform_device.hlinux/pm_runtime.hdrm/drm_atomic_state_helper.hdrm/drm_bridge.hdrm/drm_print.h
Detected Declarations
struct imx8qxp_pc_channelstruct imx8qxp_pcenum imx8qxp_pc_pix_data_formatfunction imx8qxp_pc_readfunction imx8qxp_pc_writefunction imx8qxp_pc_write_setfunction imx8qxp_pc_write_clrfunction imx8qxp_pc_bridge_mode_validfunction imx8qxp_pc_bridge_attachfunction imx8qxp_pc_bridge_mode_setfunction imx8qxp_pc_bridge_atomic_disablefunction imx8qxp_pc_bus_output_fmt_supportedfunction imx8qxp_pc_bridge_atomic_get_input_bus_fmtsfunction imx8qxp_pc_bridge_atomic_get_output_bus_fmtsfunction imx8qxp_pc_bridge_probefunction for_each_available_child_of_nodefunction imx8qxp_pc_bridge_removefunction imx8qxp_pc_runtime_suspendfunction imx8qxp_pc_runtime_resume
Annotated Snippet
struct imx8qxp_pc_channel {
struct drm_bridge bridge;
struct imx8qxp_pc *pc;
unsigned int stream_id;
};
struct imx8qxp_pc {
struct device *dev;
struct imx8qxp_pc_channel *ch[2];
struct clk *clk_apb;
void __iomem *base;
};
static inline u32 imx8qxp_pc_read(struct imx8qxp_pc *pc, unsigned int offset)
{
return readl(pc->base + offset);
}
static inline void
imx8qxp_pc_write(struct imx8qxp_pc *pc, unsigned int offset, u32 value)
{
writel(value, pc->base + offset);
}
static inline void
imx8qxp_pc_write_set(struct imx8qxp_pc *pc, unsigned int offset, u32 value)
{
imx8qxp_pc_write(pc, offset + PC_REG_SET, value);
}
static inline void
imx8qxp_pc_write_clr(struct imx8qxp_pc *pc, unsigned int offset, u32 value)
{
imx8qxp_pc_write(pc, offset + PC_REG_CLR, value);
}
static enum drm_mode_status
imx8qxp_pc_bridge_mode_valid(struct drm_bridge *bridge,
const struct drm_display_info *info,
const struct drm_display_mode *mode)
{
if (mode->hdisplay > 2560)
return MODE_BAD_HVALUE;
return MODE_OK;
}
static int imx8qxp_pc_bridge_attach(struct drm_bridge *bridge,
struct drm_encoder *encoder,
enum drm_bridge_attach_flags flags)
{
struct imx8qxp_pc_channel *ch = bridge->driver_private;
struct imx8qxp_pc *pc = ch->pc;
if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) {
DRM_DEV_ERROR(pc->dev,
"do not support creating a drm_connector\n");
return -EINVAL;
}
return drm_bridge_attach(encoder,
ch->bridge.next_bridge, bridge,
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
}
static void
imx8qxp_pc_bridge_mode_set(struct drm_bridge *bridge,
const struct drm_display_mode *mode,
const struct drm_display_mode *adjusted_mode)
{
struct imx8qxp_pc_channel *ch = bridge->driver_private;
struct imx8qxp_pc *pc = ch->pc;
u32 val;
int ret;
ret = pm_runtime_get_sync(pc->dev);
if (ret < 0)
DRM_DEV_ERROR(pc->dev,
"failed to get runtime PM sync: %d\n", ret);
ret = clk_prepare_enable(pc->clk_apb);
if (ret)
DRM_DEV_ERROR(pc->dev, "%s: failed to enable apb clock: %d\n",
__func__, ret);
/* HSYNC to pixel link is active low. */
imx8qxp_pc_write_clr(pc, PC_CTRL_REG,
PC_DISP_HSYNC_POLARITY(ch->stream_id));
/* VSYNC to pixel link is active low. */
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk.h`, `linux/delay.h`, `linux/io.h`, `linux/media-bus-format.h`, `linux/module.h`, `linux/of.h`, `linux/of_graph.h`.
- Detected declarations: `struct imx8qxp_pc_channel`, `struct imx8qxp_pc`, `enum imx8qxp_pc_pix_data_format`, `function imx8qxp_pc_read`, `function imx8qxp_pc_write`, `function imx8qxp_pc_write_set`, `function imx8qxp_pc_write_clr`, `function imx8qxp_pc_bridge_mode_valid`, `function imx8qxp_pc_bridge_attach`, `function imx8qxp_pc_bridge_mode_set`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.