drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/mxm/base.c- Extension
.c- Size
- 7588 bytes
- Lines
- 280
- 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
mxms.hcore/option.hsubdev/bios.hsubdev/bios/mxm.hsubdev/i2c.h
Detected Declarations
function filesfunction mxm_shadow_romfunction mxm_shadow_dsmfunction wmi_wmmx_mxmifunction mxm_shadow_wmifunction mxm_shadowfunction nvkm_mxm_new_
Annotated Snippet
if (shadow->exec(mxm, version)) {
if (mxms_valid(mxm))
return 0;
kfree(mxm->mxms);
mxm->mxms = NULL;
}
} while ((++shadow)->name);
return -ENOENT;
}
static const struct nvkm_subdev_func
nvkm_mxm = {
};
int
nvkm_mxm_new_(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_mxm **pmxm)
{
struct nvkm_bios *bios = device->bios;
struct nvkm_mxm *mxm;
u8 ver, len;
u16 data;
if (!(mxm = *pmxm = kzalloc_obj(*mxm)))
return -ENOMEM;
nvkm_subdev_ctor(&nvkm_mxm, device, type, inst, &mxm->subdev);
data = mxm_table(bios, &ver, &len);
if (!data || !(ver = nvbios_rd08(bios, data))) {
nvkm_debug(&mxm->subdev, "no VBIOS data, nothing to do\n");
return 0;
}
nvkm_info(&mxm->subdev, "BIOS version %d.%d\n", ver >> 4, ver & 0x0f);
nvkm_debug(&mxm->subdev, "module flags: %02x\n",
nvbios_rd08(bios, data + 0x01));
nvkm_debug(&mxm->subdev, "config flags: %02x\n",
nvbios_rd08(bios, data + 0x02));
if (mxm_shadow(mxm, ver)) {
nvkm_warn(&mxm->subdev, "failed to locate valid SIS\n");
#if 0
/* we should, perhaps, fall back to some kind of limited
* mode here if the x86 vbios hasn't already done the
* work for us (so we prevent loading with completely
* whacked vbios tables).
*/
return -EINVAL;
#else
return 0;
#endif
}
nvkm_debug(&mxm->subdev, "MXMS Version %d.%d\n",
mxms_version(mxm) >> 8, mxms_version(mxm) & 0xff);
mxms_foreach(mxm, 0, NULL, NULL);
if (nvkm_boolopt(device->cfgopt, "NvMXMDCB", true))
mxm->action |= MXM_SANITISE_DCB;
return 0;
}
Annotation
- Immediate include surface: `mxms.h`, `core/option.h`, `subdev/bios.h`, `subdev/bios/mxm.h`, `subdev/i2c.h`.
- Detected declarations: `function files`, `function mxm_shadow_rom`, `function mxm_shadow_dsm`, `function wmi_wmmx_mxmi`, `function mxm_shadow_wmi`, `function mxm_shadow`, `function nvkm_mxm_new_`.
- 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.