drivers/gpu/drm/bridge/of-display-mode-bridge.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/of-display-mode-bridge.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/of-display-mode-bridge.c- Extension
.c- Size
- 2354 bytes
- Lines
- 94
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hdrm/drm_bridge.hdrm/drm_modes.hdrm/drm_probe_helper.hdrm/bridge/of-display-mode-bridge.hvideo/of_display_timing.hvideo/of_videomode.h
Detected Declarations
struct of_display_mode_bridgefunction of_display_mode_bridge_attachfunction of_display_mode_bridge_get_modesexport devm_drm_of_display_mode_bridge
Annotated Snippet
struct of_display_mode_bridge {
struct drm_bridge base;
struct drm_display_mode mode;
u32 bus_flags;
};
#define to_of_display_mode_bridge(bridge) container_of(bridge, struct of_display_mode_bridge, base)
static int of_display_mode_bridge_attach(struct drm_bridge *bridge,
struct drm_encoder *encoder,
enum drm_bridge_attach_flags flags)
{
if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
return -EINVAL;
return 0;
}
static int of_display_mode_bridge_get_modes(struct drm_bridge *bridge,
struct drm_connector *connector)
{
struct of_display_mode_bridge *of_bridge = to_of_display_mode_bridge(bridge);
int ret;
ret = drm_connector_helper_get_modes_fixed(connector, &of_bridge->mode);
if (ret)
return ret;
connector->display_info.bus_flags = of_bridge->bus_flags;
return 0;
}
struct drm_bridge_funcs of_display_mode_bridge_funcs = {
.attach = of_display_mode_bridge_attach,
.get_modes = of_display_mode_bridge_get_modes,
};
struct drm_bridge *devm_drm_of_display_mode_bridge(struct device *dev,
struct device_node *np,
int type)
{
struct of_display_mode_bridge *of_bridge;
int ret;
of_bridge = devm_drm_bridge_alloc(dev, struct of_display_mode_bridge,
base, &of_display_mode_bridge_funcs);
if (IS_ERR(of_bridge))
return ERR_CAST(of_bridge);
ret = of_get_drm_display_mode(np,
&of_bridge->mode,
&of_bridge->bus_flags,
OF_USE_NATIVE_MODE);
if (ret)
return ERR_PTR(ret);
of_bridge->mode.type |= DRM_MODE_TYPE_DRIVER;
of_bridge->base.of_node = np;
of_bridge->base.ops = DRM_BRIDGE_OP_MODES;
of_bridge->base.type = type;
ret = devm_drm_bridge_add(dev, &of_bridge->base);
if (ret)
return ERR_PTR(ret);
return &of_bridge->base;
}
EXPORT_SYMBOL_GPL(devm_drm_of_display_mode_bridge);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("DRM bridge driver for legacy DT bindings");
Annotation
- Immediate include surface: `linux/export.h`, `drm/drm_bridge.h`, `drm/drm_modes.h`, `drm/drm_probe_helper.h`, `drm/bridge/of-display-mode-bridge.h`, `video/of_display_timing.h`, `video/of_videomode.h`.
- Detected declarations: `struct of_display_mode_bridge`, `function of_display_mode_bridge_attach`, `function of_display_mode_bridge_get_modes`, `export devm_drm_of_display_mode_bridge`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration implementation candidate.
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.