drivers/gpu/drm/pl111/pl111_drv.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/pl111/pl111_drv.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/pl111/pl111_drv.c- Extension
.c- Size
- 10906 bytes
- Lines
- 453
- 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/amba/bus.hlinux/dma-buf.hlinux/module.hlinux/of.hlinux/of_graph.hlinux/of_reserved_mem.hlinux/shmem_fs.hlinux/slab.hdrm/clients/drm_client_setup.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_drv.hdrm/drm_fbdev_dma.hdrm/drm_fourcc.hdrm/drm_gem_dma_helper.hdrm/drm_gem_framebuffer_helper.hdrm/drm_of.hdrm/drm_panel.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/drm_vblank.hpl111_drm.hpl111_versatile.hpl111_nomadik.h
Detected Declarations
function pl111_modeset_initfunction pl111_gem_import_sg_tablefunction pl111_amba_probefunction pl111_amba_removefunction pl111_amba_shutdown
Annotated Snippet
if (ret) {
if (ret == -EPROBE_DEFER) {
/*
* Something deferred, but that is often just
* another way of saying -ENODEV, but let's
* cast a vote for later deferral.
*/
defer = true;
} else if (ret != -ENODEV) {
/* Continue, maybe something else is working */
drm_err(dev,
"endpoint %d returns %d\n", i, ret);
}
}
if (tmp_panel) {
drm_info(dev,
"found panel on endpoint %d\n", i);
panel = tmp_panel;
}
if (tmp_bridge) {
drm_info(dev,
"found bridge on endpoint %d\n", i);
bridge = tmp_bridge;
}
i++;
}
/*
* If we can't find neither panel nor bridge on any of the
* endpoints, and any of them retured -EPROBE_DEFER, then
* let's defer this driver too.
*/
if ((!panel && !bridge) && defer)
return -EPROBE_DEFER;
if (panel) {
bridge = drm_panel_bridge_add_typed(panel,
DRM_MODE_CONNECTOR_Unknown);
if (IS_ERR(bridge)) {
ret = PTR_ERR(bridge);
goto finish;
}
} else if (bridge) {
drm_info(dev, "Using non-panel bridge\n");
} else {
drm_err(dev, "No bridge, exiting\n");
return -ENODEV;
}
priv->bridge = bridge;
if (panel) {
priv->panel = panel;
priv->connector = drm_panel_bridge_connector(bridge);
}
ret = pl111_display_init(dev);
if (ret != 0) {
drm_err(dev, "Failed to init display\n");
goto out_bridge;
}
ret = drm_simple_display_pipe_attach_bridge(&priv->pipe,
bridge);
if (ret)
return ret;
if (!priv->variant->broken_vblank) {
ret = drm_vblank_init(dev, 1);
if (ret != 0) {
drm_err(dev, "Failed to init vblank\n");
goto out_bridge;
}
}
drm_mode_config_reset(dev);
drm_kms_helper_poll_init(dev);
goto finish;
out_bridge:
if (panel)
drm_panel_bridge_remove(bridge);
finish:
return ret;
}
static struct drm_gem_object *
Annotation
- Immediate include surface: `linux/amba/bus.h`, `linux/dma-buf.h`, `linux/module.h`, `linux/of.h`, `linux/of_graph.h`, `linux/of_reserved_mem.h`, `linux/shmem_fs.h`, `linux/slab.h`.
- Detected declarations: `function pl111_modeset_init`, `function pl111_gem_import_sg_table`, `function pl111_amba_probe`, `function pl111_amba_remove`, `function pl111_amba_shutdown`.
- 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.