drivers/gpu/drm/nouveau/dispnv50/disp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/dispnv50/disp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/dispnv50/disp.c- Extension
.c- Size
- 88283 bytes
- Lines
- 3074
- 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
disp.hatom.hcore.hhead.hwndw.hhandles.hlinux/backlight.hlinux/dma-mapping.hlinux/hdmi.hlinux/component.hlinux/iopoll.hdrm/display/drm_dp_helper.hdrm/display/drm_scdc_helper.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_edid.hdrm/drm_eld.hdrm/drm_fb_helper.hdrm/drm_fixed.hdrm/drm_probe_helper.hdrm/drm_vblank.hnvif/push507c.hnvif/class.hnvif/cl0002.hnvif/event.hnvif/if0012.hnvif/if0014.hnvif/timer.hnvhw/class/cl507c.hnvhw/class/cl507d.hnvhw/class/cl837d.hnvhw/class/cl887d.h
Detected Declarations
struct nv50_mstcstruct nv50_mstofunction filesfunction nv50_chan_destroyfunction nv50_dmac_destroyfunction nv50_dmac_kickfunction nv50_dmac_freefunction nv50_dmac_windfunction nv50_dmac_waitfunction nv50_dmac_createfunction nv50_outp_dump_capsfunction nv50_outp_atomic_check_viewfunction nv50_outp_atomic_fix_depthfunction nv50_outp_atomic_checkfunction nv50_outp_get_new_connectorfunction for_each_new_connector_in_statefunction nv50_outp_get_old_connectorfunction for_each_old_connector_in_statefunction nv50_outp_get_new_crtcfunction for_each_new_crtc_in_statefunction nv50_dac_atomic_disablefunction nv50_dac_atomic_enablefunction nv50_dac_detectfunction nv50_dac_destroyfunction nv50_dac_createfunction nv50_audio_component_eld_notifyfunction nv50_audio_component_get_eldfunction drm_for_each_encoderfunction nv50_audio_component_bindfunction nv50_audio_component_unbindfunction nv50_audio_component_initfunction nv50_audio_component_finifunction nv50_audio_supportedfunction nv50_audio_disablefunction nv50_audio_enablefunction nv50_hdmi_enablefunction nv50_msto_cleanupfunction nv50_msto_preparefunction nv50_msto_atomic_checkfunction nv50_dp_bpc_to_depthfunction nv50_msto_atomic_enablefunction nv50_msto_atomic_disablefunction nv50_msto_destroyfunction nv50_msto_newfunction nv50_mstc_atomic_best_encoderfunction nv50_mstc_mode_validfunction nv50_mstc_get_modesfunction nv50_mstc_atomic_check
Annotated Snippet
struct nv50_mstc {
struct nv50_mstm *mstm;
struct drm_dp_mst_port *port;
struct drm_connector connector;
struct drm_display_mode *native;
struct edid *edid;
};
struct nv50_msto {
struct drm_encoder encoder;
/* head is statically assigned on msto creation */
struct nv50_head *head;
struct nv50_mstc *mstc;
bool disabled;
bool enabled;
u32 display_id;
};
struct nouveau_encoder *nv50_real_outp(struct drm_encoder *encoder)
{
struct nv50_msto *msto;
if (encoder->encoder_type != DRM_MODE_ENCODER_DPMST)
return nouveau_encoder(encoder);
msto = nv50_msto(encoder);
if (!msto->mstc)
return NULL;
return msto->mstc->mstm->outp;
}
static void
nv50_msto_cleanup(struct drm_atomic_commit *state,
struct drm_dp_mst_topology_state *new_mst_state,
struct drm_dp_mst_topology_mgr *mgr,
struct nv50_msto *msto)
{
struct nouveau_drm *drm = nouveau_drm(msto->encoder.dev);
struct drm_dp_mst_atomic_payload *new_payload =
drm_atomic_get_mst_payload_state(new_mst_state, msto->mstc->port);
struct drm_dp_mst_topology_state *old_mst_state =
drm_atomic_get_old_mst_topology_state(state, mgr);
const struct drm_dp_mst_atomic_payload *old_payload =
drm_atomic_get_mst_payload_state(old_mst_state, msto->mstc->port);
struct nv50_mstc *mstc = msto->mstc;
struct nv50_mstm *mstm = mstc->mstm;
NV_ATOMIC(drm, "%s: msto cleanup\n", msto->encoder.name);
if (msto->disabled) {
if (msto->head->func->display_id) {
nvif_outp_dp_mst_id_put(&mstm->outp->outp, msto->display_id);
msto->display_id = 0;
}
msto->mstc = NULL;
msto->disabled = false;
drm_dp_remove_payload_part2(mgr, new_mst_state, old_payload, new_payload);
} else if (msto->enabled) {
drm_dp_add_payload_part2(mgr, new_payload);
msto->enabled = false;
}
}
static void
nv50_msto_prepare(struct drm_atomic_commit *state,
struct drm_dp_mst_topology_state *mst_state,
struct drm_dp_mst_topology_mgr *mgr,
struct nv50_msto *msto)
{
struct nouveau_drm *drm = nouveau_drm(msto->encoder.dev);
struct nv50_mstc *mstc = msto->mstc;
struct nv50_mstm *mstm = mstc->mstm;
struct drm_dp_mst_atomic_payload *payload;
int ret = 0;
NV_ATOMIC(drm, "%s: msto prepare\n", msto->encoder.name);
payload = drm_atomic_get_mst_payload_state(mst_state, mstc->port);
if (msto->disabled) {
drm_dp_remove_payload_part1(mgr, mst_state, payload);
nvif_outp_dp_mst_vcpi(&mstm->outp->outp, msto->head->base.index, 0, 0, 0, 0);
ret = 1;
} else {
if (msto->enabled)
ret = drm_dp_add_payload_part1(mgr, mst_state, payload);
Annotation
- Immediate include surface: `disp.h`, `atom.h`, `core.h`, `head.h`, `wndw.h`, `handles.h`, `linux/backlight.h`, `linux/dma-mapping.h`.
- Detected declarations: `struct nv50_mstc`, `struct nv50_msto`, `function files`, `function nv50_chan_destroy`, `function nv50_dmac_destroy`, `function nv50_dmac_kick`, `function nv50_dmac_free`, `function nv50_dmac_wind`, `function nv50_dmac_wait`, `function nv50_dmac_create`.
- 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.