drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c- Extension
.c- Size
- 14586 bytes
- Lines
- 582
- 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.
- 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/delay.hdrm/drm_bridge.hdrm/drm_bridge_connector.hdrm/drm_vblank.hmsm_drv.hmsm_gem.hmsm_mmu.hmdp4_kms.h
Detected Declarations
function Copyrightfunction mdp4_enable_commitfunction mdp4_disable_commitfunction mdp4_flush_commitfunction mdp4_complete_commitfunction mdp4_destroyfunction mdp4_disablefunction mdp4_enablefunction mdp4_modeset_init_intffunction modeset_initfunction read_mdp_hw_revisionfunction mdp4_kms_initfunction mdp4_probefunction mdp4_removefunction msm_mdp4_registerfunction msm_mdp4_unregister
Annotated Snippet
if (IS_ERR(next_bridge)) {
ret = PTR_ERR(next_bridge);
if (ret == -ENODEV)
return 0;
return ret;
}
encoder = mdp4_lcdc_encoder_init(dev);
if (IS_ERR(encoder)) {
DRM_DEV_ERROR(dev->dev, "failed to construct LCDC encoder\n");
return PTR_ERR(encoder);
}
/* LCDC can be hooked to DMA_P (TODO: Add DMA_S later?) */
encoder->possible_crtcs = 1 << DMA_P;
ret = drm_bridge_attach(encoder, next_bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret) {
DRM_DEV_ERROR(dev->dev, "failed to attach LVDS panel/bridge: %d\n", ret);
return ret;
}
connector = drm_bridge_connector_init(dev, encoder);
if (IS_ERR(connector)) {
DRM_DEV_ERROR(dev->dev, "failed to initialize LVDS connector\n");
return PTR_ERR(connector);
}
break;
case DRM_MODE_ENCODER_TMDS:
encoder = mdp4_dtv_encoder_init(dev);
if (IS_ERR(encoder)) {
DRM_DEV_ERROR(dev->dev, "failed to construct DTV encoder\n");
return PTR_ERR(encoder);
}
/* DTV can be hooked to DMA_E: */
encoder->possible_crtcs = 1 << 1;
if (priv->kms->hdmi) {
/* Construct bridge/connector for HDMI: */
ret = msm_hdmi_modeset_init(priv->kms->hdmi, dev, encoder);
if (ret) {
DRM_DEV_ERROR(dev->dev, "failed to initialize HDMI: %d\n", ret);
return ret;
}
}
break;
case DRM_MODE_ENCODER_DSI:
/* only DSI1 supported for now */
dsi_id = 0;
if (!priv->kms->dsi[dsi_id])
break;
encoder = mdp4_dsi_encoder_init(dev);
if (IS_ERR(encoder)) {
ret = PTR_ERR(encoder);
DRM_DEV_ERROR(dev->dev,
"failed to construct DSI encoder: %d\n", ret);
return ret;
}
/* TODO: Add DMA_S later? */
encoder->possible_crtcs = 1 << DMA_P;
ret = msm_dsi_modeset_init(priv->kms->dsi[dsi_id], dev, encoder);
if (ret) {
DRM_DEV_ERROR(dev->dev, "failed to initialize DSI: %d\n",
ret);
return ret;
}
break;
default:
DRM_DEV_ERROR(dev->dev, "Invalid or unsupported interface\n");
return -EINVAL;
}
return 0;
}
static int modeset_init(struct mdp4_kms *mdp4_kms)
{
struct drm_device *dev = mdp4_kms->dev;
struct drm_plane *plane;
struct drm_crtc *crtc;
int i, ret;
Annotation
- Immediate include surface: `linux/delay.h`, `drm/drm_bridge.h`, `drm/drm_bridge_connector.h`, `drm/drm_vblank.h`, `msm_drv.h`, `msm_gem.h`, `msm_mmu.h`, `mdp4_kms.h`.
- Detected declarations: `function Copyright`, `function mdp4_enable_commit`, `function mdp4_disable_commit`, `function mdp4_flush_commit`, `function mdp4_complete_commit`, `function mdp4_destroy`, `function mdp4_disable`, `function mdp4_enable`, `function mdp4_modeset_init_intf`, `function modeset_init`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source 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.