drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c- Extension
.c- Size
- 46229 bytes
- Lines
- 1796
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
priv.hchan.hconn.hhead.hdp.hior.houtp.hcore/client.hcore/ramht.hsubdev/bios.hsubdev/bios/disp.hsubdev/bios/init.hsubdev/bios/pll.hsubdev/devinit.hsubdev/i2c.hsubdev/mmu.hsubdev/timer.hnvif/class.hnvif/unpack.h
Detected Declarations
function filesfunction nv50_pior_dp_linksfunction nv50_pior_power_waitfunction nv50_pior_powerfunction nv50_pior_depthfunction nv50_pior_statefunction nv50_pior_newfunction nv50_pior_cntfunction nv50_sor_bl_setfunction nv50_sor_bl_getfunction nv50_sor_clockfunction nv50_sor_power_waitfunction nv50_sor_powerfunction nv50_sor_statefunction nv50_sor_newfunction nv50_sor_cntfunction nv50_dac_clockfunction nv50_dac_sensefunction nv50_dac_power_waitfunction nv50_dac_powerfunction nv50_dac_statefunction nv50_dac_newfunction nv50_dac_cntfunction nv50_head_vblank_putfunction nv50_head_vblank_getfunction nv50_head_rgclkfunction nv50_head_rgposfunction nv50_head_statefunction nv50_head_newfunction nv50_head_cntfunction nv50_disp_mthd_listfunction nv50_disp_chan_mthdfunction nv50_disp_chan_uevent_finifunction nv50_disp_chan_uevent_initfunction nv50_disp_chan_uevent_sendfunction nv50_disp_chan_userfunction nv50_disp_chan_intrfunction nv50_disp_pioc_finifunction nv50_disp_pioc_initfunction nv50_disp_dmac_bindfunction nv50_disp_dmac_finifunction nv50_disp_dmac_initfunction nv50_disp_dmac_pushfunction nv50_disp_core_finifunction nv50_disp_core_initfunction nv50_disp_super_iedtfunction nv50_disp_super_ied_onfunction nv50_disp_super_ied_off
Annotated Snippet
if (!WARN_ON(!head)) {
struct nvkm_head_state *state = &head->asy;
switch ((ctrl & 0x000f0000) >> 16) {
case 6: state->or.depth = 30; break;
case 5: state->or.depth = 24; break;
case 2: state->or.depth = 18; break;
case 0: state->or.depth = 18; break; /*XXX*/
default:
state->or.depth = 18;
WARN_ON(1);
break;
}
}
}
}
static void
nv50_pior_state(struct nvkm_ior *pior, struct nvkm_ior_state *state)
{
struct nvkm_device *device = pior->disp->engine.subdev.device;
const u32 coff = pior->id * 8 + (state == &pior->arm) * 4;
u32 ctrl = nvkm_rd32(device, 0x610b80 + coff);
state->proto_evo = (ctrl & 0x00000f00) >> 8;
state->rgdiv = 1;
switch (state->proto_evo) {
case 0: state->proto = TMDS; break;
default:
state->proto = UNKNOWN;
break;
}
state->head = ctrl & 0x00000003;
nv50_pior_depth(pior, state, ctrl);
}
static const struct nvkm_ior_func
nv50_pior = {
.state = nv50_pior_state,
.power = nv50_pior_power,
.clock = nv50_pior_clock,
.dp = &nv50_pior_dp,
};
int
nv50_pior_new(struct nvkm_disp *disp, int id)
{
return nvkm_ior_new_(&nv50_pior, disp, PIOR, id, false);
}
int
nv50_pior_cnt(struct nvkm_disp *disp, unsigned long *pmask)
{
struct nvkm_device *device = disp->engine.subdev.device;
*pmask = (nvkm_rd32(device, 0x610184) & 0x70000000) >> 28;
return 3;
}
static int
nv50_sor_bl_set(struct nvkm_ior *ior, int lvl)
{
struct nvkm_device *device = ior->disp->engine.subdev.device;
const u32 soff = nv50_ior_base(ior);
u32 div = 1025;
u32 val = (lvl * div) / 100;
nvkm_wr32(device, 0x61c084 + soff, 0x80000000 | val);
return 0;
}
static int
nv50_sor_bl_get(struct nvkm_ior *ior)
{
struct nvkm_device *device = ior->disp->engine.subdev.device;
const u32 soff = nv50_ior_base(ior);
u32 div = 1025;
u32 val;
val = nvkm_rd32(device, 0x61c084 + soff);
val &= 0x000007ff;
return ((val * 100) + (div / 2)) / div;
}
const struct nvkm_ior_func_bl
nv50_sor_bl = {
.get = nv50_sor_bl_get,
.set = nv50_sor_bl_set,
};
Annotation
- Immediate include surface: `priv.h`, `chan.h`, `conn.h`, `head.h`, `dp.h`, `ior.h`, `outp.h`, `core/client.h`.
- Detected declarations: `function files`, `function nv50_pior_dp_links`, `function nv50_pior_power_wait`, `function nv50_pior_power`, `function nv50_pior_depth`, `function nv50_pior_state`, `function nv50_pior_new`, `function nv50_pior_cnt`, `function nv50_sor_bl_set`, `function nv50_sor_bl_get`.
- 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.