drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c- Extension
.c- Size
- 6855 bytes
- Lines
- 264
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
rm/rm.hengine/disp.hengine/disp/outp.hnvhw/drf.hnvrm/disp.h
Detected Declarations
function Copyrightfunction r570_disp_chan_set_pushbuffunction r570_dp_set_indexed_link_ratesfunction r570_dp_get_capsfunction r570_bl_ctrlfunction r570_disp_get_activefunction r570_disp_get_connect_statefunction r570_disp_get_supportedfunction r570_disp_get_static_info
Annotated Snippet
switch (nvkm_memory_target(memory)) {
case NVKM_MEM_TARGET_NCOH:
ctrl->addressSpace = ADDR_SYSMEM;
ctrl->cacheSnoop = 0;
ctrl->pbTargetAperture = PHYS_PCI;
break;
case NVKM_MEM_TARGET_HOST:
ctrl->addressSpace = ADDR_SYSMEM;
ctrl->cacheSnoop = 1;
ctrl->pbTargetAperture = PHYS_PCI_COHERENT;
break;
case NVKM_MEM_TARGET_VRAM:
ctrl->addressSpace = ADDR_FBMEM;
ctrl->pbTargetAperture = PHYS_NVM;
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;
ctrl->subDeviceId = BIT(0);
return nvkm_gsp_rm_ctrl_wr(&gsp->internal.device.subdevice, ctrl);
}
static int
r570_dp_set_indexed_link_rates(struct nvkm_outp *outp)
{
NV0073_CTRL_CMD_DP_CONFIG_INDEXED_LINK_RATES_PARAMS *ctrl;
struct nvkm_disp *disp = outp->disp;
if (WARN_ON(outp->dp.rates > ARRAY_SIZE(ctrl->linkRateTbl)))
return -EINVAL;
ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom,
NV0073_CTRL_CMD_DP_CONFIG_INDEXED_LINK_RATES, sizeof(*ctrl));
if (IS_ERR(ctrl))
return PTR_ERR(ctrl);
ctrl->displayId = BIT(outp->index);
for (int i = 0; i < outp->dp.rates; i++)
ctrl->linkRateTbl[outp->dp.rate[i].dpcd] = outp->dp.rate[i].rate * 10 / 200;
return nvkm_gsp_rm_ctrl_wr(&disp->rm.objcom, ctrl);
}
static int
r570_dp_get_caps(struct nvkm_disp *disp, int *plink_bw, bool *pmst, bool *pwm)
{
NV0073_CTRL_CMD_DP_GET_CAPS_PARAMS *ctrl;
int ret;
ctrl = nvkm_gsp_rm_ctrl_get(&disp->rm.objcom,
NV0073_CTRL_CMD_DP_GET_CAPS, sizeof(*ctrl));
if (IS_ERR(ctrl))
return PTR_ERR(ctrl);
ctrl->sorIndex = ~0;
ret = nvkm_gsp_rm_ctrl_push(&disp->rm.objcom, &ctrl, sizeof(*ctrl));
if (ret) {
nvkm_gsp_rm_ctrl_done(&disp->rm.objcom, ctrl);
return ret;
}
switch (NVVAL_GET(ctrl->maxLinkRate, NV0073_CTRL_CMD, DP_GET_CAPS, MAX_LINK_RATE)) {
case NV0073_CTRL_CMD_DP_GET_CAPS_MAX_LINK_RATE_1_62:
*plink_bw = 0x06;
break;
case NV0073_CTRL_CMD_DP_GET_CAPS_MAX_LINK_RATE_2_70:
*plink_bw = 0x0a;
break;
case NV0073_CTRL_CMD_DP_GET_CAPS_MAX_LINK_RATE_5_40:
*plink_bw = 0x14;
break;
case NV0073_CTRL_CMD_DP_GET_CAPS_MAX_LINK_RATE_8_10:
*plink_bw = 0x1e;
break;
default:
*plink_bw = 0x00;
break;
}
Annotation
- Immediate include surface: `rm/rm.h`, `engine/disp.h`, `engine/disp/outp.h`, `nvhw/drf.h`, `nvrm/disp.h`.
- Detected declarations: `function Copyright`, `function r570_disp_chan_set_pushbuf`, `function r570_dp_set_indexed_link_rates`, `function r570_dp_get_caps`, `function r570_bl_ctrl`, `function r570_disp_get_active`, `function r570_disp_get_connect_state`, `function r570_disp_get_supported`, `function r570_disp_get_static_info`.
- 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.