drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c- Extension
.c- Size
- 46360 bytes
- Lines
- 1795
- 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.
- 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
engine/disp/priv.hengine/disp/chan.hengine/disp/conn.hengine/disp/dp.hengine/disp/head.hengine/disp/ior.hengine/disp/outp.hcore/ramht.hsubdev/bios.hsubdev/bios/conn.hsubdev/gsp.hsubdev/mmu.hsubdev/vfn.hrm/gpu.hnvhw/drf.hnvrm/disp.hlinux/acpi.h
Detected Declarations
function filesfunction r535_chan_intrfunction r535_disp_chan_set_pushbuffunction r535_curs_initfunction r535_dmac_bindfunction r535_dmac_finifunction r535_dmac_allocfunction r535_dmac_initfunction r535_dmac_pushfunction r535_core_finifunction r535_bl_ctrlfunction r535_sor_bl_setfunction r535_sor_bl_getfunction r535_sor_hda_eldfunction r535_sor_hda_hpdfunction r535_sor_dp_audio_mutefunction r535_sor_dp_audiofunction r535_sor_dp_vcpifunction r535_sor_dp_sstfunction r535_sor_hdmi_scdcfunction r535_sor_hdmi_ctrl_audio_mutefunction r535_sor_hdmi_ctrl_audiofunction r535_sor_hdmi_audiofunction r535_sor_hdmi_ctrlfunction r535_sor_newfunction r535_sor_cntfunction r535_head_vblank_putfunction r535_head_vblank_getfunction r535_head_statefunction r535_conn_newfunction list_for_each_entryfunction r535_outp_releasefunction r535_outp_acquirefunction r535_disp_get_activefunction r535_outp_inheritfunction list_for_each_entryfunction r535_outp_dfp_get_infofunction r535_disp_get_connect_statefunction r535_outp_detectfunction r535_dp_mst_id_putfunction r535_dp_mst_id_getfunction r535_dp_drivefunction r535_dp_train_targetfunction r535_dp_trainfunction r535_dp_set_indexed_link_ratesfunction r535_dp_ratesfunction r535_dp_aux_xferfunction r535_dp_aux_pwr
Annotated Snippet
switch (nvkm_memory_target(memory)) {
case NVKM_MEM_TARGET_NCOH:
ctrl->addressSpace = ADDR_SYSMEM;
ctrl->cacheSnoop = 0;
break;
case NVKM_MEM_TARGET_HOST:
ctrl->addressSpace = ADDR_SYSMEM;
ctrl->cacheSnoop = 1;
break;
case NVKM_MEM_TARGET_VRAM:
ctrl->addressSpace = ADDR_FBMEM;
break;
default:
WARN_ON(1);
return -EINVAL;
}
ctrl->physicalAddr = nvkm_memory_addr(memory);
ctrl->limit = nvkm_memory_size(memory) - 1;
}
ctrl->hclass = oclass;
ctrl->channelInstance = inst;
ctrl->valid = ((oclass & 0xff) != 0x7a) ? 1 : 0;
return nvkm_gsp_rm_ctrl_wr(&gsp->internal.device.subdevice, ctrl);
}
static int
r535_curs_init(struct nvkm_disp_chan *chan)
{
const struct nvkm_rm_api *rmapi = chan->disp->rm.objcom.client->gsp->rm->api;
NV50VAIO_CHANNELPIO_ALLOCATION_PARAMETERS *args;
int ret;
ret = rmapi->disp->chan.set_pushbuf(chan->disp, chan->object.oclass, chan->head, NULL);
if (ret)
return ret;
args = nvkm_gsp_rm_alloc_get(&chan->disp->rm.object,
(chan->object.oclass << 16) | chan->head,
chan->object.oclass, sizeof(*args), &chan->rm.object);
if (IS_ERR(args))
return PTR_ERR(args);
args->channelInstance = chan->head;
return nvkm_gsp_rm_alloc_wr(&chan->rm.object, args);
}
static const struct nvkm_disp_chan_func
r535_curs_func = {
.init = r535_curs_init,
.fini = r535_chan_fini,
.intr = r535_chan_intr,
.user = r535_chan_user,
};
static const struct nvkm_disp_chan_user
r535_curs = {
.func = &r535_curs_func,
.user = 73,
};
static int
r535_dmac_bind(struct nvkm_disp_chan *chan, struct nvkm_object *object, u32 handle)
{
return nvkm_ramht_insert(chan->disp->ramht, object, chan->chid.user, -9, handle,
chan->chid.user << 25 |
(chan->disp->rm.client.object.handle & 0x3fff));
}
static void
r535_dmac_fini(struct nvkm_disp_chan *chan)
{
struct nvkm_device *device = chan->disp->engine.subdev.device;
const u32 uoff = (chan->chid.user - 1) * 0x1000;
chan->suspend_put = nvkm_rd32(device, 0x690000 + uoff);
r535_chan_fini(chan);
}
static int
r535_dmac_alloc(struct nvkm_disp *disp, u32 oclass, int inst, u32 put_offset,
struct nvkm_gsp_object *dmac)
{
NV50VAIO_CHANNELDMA_ALLOCATION_PARAMETERS *args;
args = nvkm_gsp_rm_alloc_get(&disp->rm.object, (oclass << 16) | inst, oclass,
sizeof(*args), dmac);
Annotation
- Immediate include surface: `engine/disp/priv.h`, `engine/disp/chan.h`, `engine/disp/conn.h`, `engine/disp/dp.h`, `engine/disp/head.h`, `engine/disp/ior.h`, `engine/disp/outp.h`, `core/ramht.h`.
- Detected declarations: `function files`, `function r535_chan_intr`, `function r535_disp_chan_set_pushbuf`, `function r535_curs_init`, `function r535_dmac_bind`, `function r535_dmac_fini`, `function r535_dmac_alloc`, `function r535_dmac_init`, `function r535_dmac_push`, `function r535_core_fini`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- 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.