drivers/gpu/drm/vc4/vc4_dsi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/vc4/vc4_dsi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/vc4/vc4_dsi.c- Extension
.c- Size
- 55089 bytes
- Lines
- 1827
- 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.
- 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/clk-provider.hlinux/clk.hlinux/completion.hlinux/component.hlinux/dma-mapping.hlinux/dmaengine.hlinux/io.hlinux/of.hlinux/of_address.hlinux/platform_device.hlinux/pm_runtime.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_edid.hdrm/drm_mipi_dsi.hdrm/drm_of.hdrm/drm_panel.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/drm_simple_kms_helper.hvc4_drv.hvc4_regs.h
Detected Declarations
struct vc4_dsi_variantstruct vc4_dsifunction dsi_dma_workaround_writefunction vc4_dsi_latch_ulpsfunction vc4_dsi_ulpsfunction dsi_hs_timingfunction dsi_esc_timingfunction vc4_dsi_bridge_disablefunction vc4_dsi_bridge_post_disablefunction vc4_dsi_bridge_mode_fixupfunction vc4_dsi_bridge_pre_enablefunction vc4_dsi_bridge_enablefunction vc4_dsi_bridge_attachfunction vc4_dsi_host_transferfunction vc4_dsi_host_attachfunction vc4_dsi_host_detachfunction vc4_dsi_late_registerfunction dsi_handle_errorfunction vc4_dsi_irq_defer_to_thread_handlerfunction vc4_dsi_irq_handlerfunction CPRMANfunction vc4_dsi_dma_mem_releasefunction vc4_dsi_dma_chan_releasefunction vc4_dsi_release_actionfunction vc4_dsi_bindfunction vc4_dsi_dev_probefunction vc4_dsi_dev_remove
Annotated Snippet
struct vc4_dsi_variant {
/* Whether we're on bcm2835's DSI0 or DSI1. */
unsigned int port;
bool broken_axi_workaround;
const char *debugfs_name;
const struct debugfs_reg32 *regs;
size_t nregs;
};
/* General DSI hardware state. */
struct vc4_dsi {
struct vc4_encoder encoder;
struct mipi_dsi_host dsi_host;
struct platform_device *pdev;
struct drm_bridge *out_bridge;
struct drm_bridge bridge;
void __iomem *regs;
struct dma_chan *reg_dma_chan;
dma_addr_t reg_dma_paddr;
u32 *reg_dma_mem;
dma_addr_t reg_paddr;
const struct vc4_dsi_variant *variant;
/* DSI channel for the panel we're connected to. */
u32 channel;
u32 lanes;
u32 format;
u32 divider;
u32 mode_flags;
/* Input clock from CPRMAN to the digital PHY, for the DSI
* escape clock.
*/
struct clk *escape_clock;
/* Input clock to the analog PHY, used to generate the DSI bit
* clock.
*/
struct clk *pll_phy_clock;
/* HS Clocks generated within the DSI analog PHY. */
struct clk_fixed_factor phy_clocks[3];
struct clk_hw_onecell_data *clk_onecell;
/* Pixel clock output to the pixelvalve, generated from the HS
* clock.
*/
struct clk *pixel_clock;
struct completion xfer_completion;
int xfer_result;
struct debugfs_regset32 regset;
};
#define host_to_dsi(host) \
container_of_const(host, struct vc4_dsi, dsi_host)
#define to_vc4_dsi(_encoder) \
container_of_const(_encoder, struct vc4_dsi, encoder.base)
#define bridge_to_vc4_dsi(_bridge) \
container_of_const(_bridge, struct vc4_dsi, bridge)
static inline void
dsi_dma_workaround_write(struct vc4_dsi *dsi, u32 offset, u32 val)
{
struct drm_device *drm = dsi->bridge.dev;
struct dma_chan *chan = dsi->reg_dma_chan;
struct dma_async_tx_descriptor *tx;
dma_cookie_t cookie;
int ret;
kunit_fail_current_test("Accessing a register in a unit test!\n");
/* DSI0 should be able to write normally. */
if (!chan) {
writel(val, dsi->regs + offset);
return;
}
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/clk.h`, `linux/completion.h`, `linux/component.h`, `linux/dma-mapping.h`, `linux/dmaengine.h`, `linux/io.h`, `linux/of.h`.
- Detected declarations: `struct vc4_dsi_variant`, `struct vc4_dsi`, `function dsi_dma_workaround_write`, `function vc4_dsi_latch_ulps`, `function vc4_dsi_ulps`, `function dsi_hs_timing`, `function dsi_esc_timing`, `function vc4_dsi_bridge_disable`, `function vc4_dsi_bridge_post_disable`, `function vc4_dsi_bridge_mode_fixup`.
- 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.
- 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.