drivers/gpu/drm/nouveau/nouveau_drm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nouveau_drm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nouveau_drm.c- Extension
.c- Size
- 39890 bytes
- Lines
- 1550
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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
linux/aperture.hlinux/delay.hlinux/module.hlinux/pci.hlinux/pm_runtime.hlinux/vga_switcheroo.hlinux/mmu_notifier.hlinux/dynamic_debug.hlinux/debugfs.hdrm/clients/drm_client_setup.hdrm/drm_drv.hdrm/drm_fbdev_ttm.hdrm/drm_gem_ttm_helper.hdrm/drm_ioctl.hdrm/drm_vblank.hcore/gpuobj.hcore/option.hcore/pci.hcore/tegra.hnvif/driver.hnvif/fifo.hnvif/push006c.hnvif/user.hnvif/log.hnvif/class.hnvif/cl0002.hnouveau_drv.hnouveau_dma.hnouveau_ttm.hnouveau_gem.hnouveau_vga.hnouveau_led.h
Detected Declarations
function nouveau_pci_namefunction nouveau_platform_namefunction nouveau_namefunction nouveau_cli_work_readyfunction nouveau_cli_workfunction nouveau_cli_work_fencefunction nouveau_cli_work_queuefunction nouveau_cli_finifunction nouveau_cli_initfunction nouveau_accel_ce_finifunction nouveau_accel_ce_initfunction nouveau_accel_gr_finifunction nouveau_accel_gr_initfunction nouveau_accel_finifunction nouveau_accel_initfunction __printffunction __printffunction nouveau_drm_device_finifunction nouveau_drm_device_initfunction nouveau_drm_device_delfunction nouveau_drm_device_newfunction controllerfunction nouveau_drm_probefunction nouveau_drm_device_removefunction nouveau_drm_removefunction nouveau_do_suspendfunction nouveau_do_resumefunction nouveau_pmops_suspendfunction nouveau_pmops_resumefunction nouveau_drm_shutdownfunction nouveau_pmops_freezefunction nouveau_pmops_thawfunction nouveau_pmops_runtimefunction nouveau_pmops_runtime_suspendfunction nouveau_pmops_runtime_resumefunction nouveau_pmops_runtime_idlefunction nouveau_drm_openfunction nouveau_drm_postclosefunction nouveau_drm_ioctlfunction nouveau_display_optionsfunction nouveau_platform_device_createfunction nouveau_drm_initfunction nouveau_drm_exitmodule init nouveau_drm_init
Annotated Snippet
static const struct file_operations
nouveau_driver_fops = {
.owner = THIS_MODULE,
.open = drm_open,
.release = drm_release,
.unlocked_ioctl = nouveau_drm_ioctl,
.mmap = drm_gem_mmap,
.poll = drm_poll,
.read = drm_read,
#if defined(CONFIG_COMPAT)
.compat_ioctl = nouveau_compat_ioctl,
#endif
.llseek = noop_llseek,
.fop_flags = FOP_UNSIGNED_OFFSET,
};
static struct drm_driver
driver_stub = {
.driver_features = DRIVER_GEM |
DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE |
DRIVER_GEM_GPUVA |
DRIVER_MODESET |
DRIVER_RENDER,
.open = nouveau_drm_open,
.postclose = nouveau_drm_postclose,
#if defined(CONFIG_DEBUG_FS)
.debugfs_init = nouveau_drm_debugfs_init,
#endif
.ioctls = nouveau_ioctls,
.num_ioctls = ARRAY_SIZE(nouveau_ioctls),
.fops = &nouveau_driver_fops,
.gem_prime_import_sg_table = nouveau_gem_prime_import_sg_table,
.dumb_create = nouveau_display_dumb_create,
.dumb_map_offset = drm_gem_ttm_dumb_map_offset,
DRM_FBDEV_TTM_DRIVER_OPS,
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
.major = DRIVER_MAJOR,
.minor = DRIVER_MINOR,
.patchlevel = DRIVER_PATCHLEVEL,
};
static struct pci_device_id
nouveau_drm_pci_table[] = {
{
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID),
.class = PCI_BASE_CLASS_DISPLAY << 16,
.class_mask = 0xff << 16,
},
{
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA_SGS, PCI_ANY_ID),
.class = PCI_BASE_CLASS_DISPLAY << 16,
.class_mask = 0xff << 16,
},
{}
};
static void nouveau_display_options(void)
{
DRM_DEBUG_DRIVER("Loading Nouveau with parameters:\n");
DRM_DEBUG_DRIVER("... tv_disable : %d\n", nouveau_tv_disable);
DRM_DEBUG_DRIVER("... ignorelid : %d\n", nouveau_ignorelid);
DRM_DEBUG_DRIVER("... duallink : %d\n", nouveau_duallink);
DRM_DEBUG_DRIVER("... config : %s\n", nouveau_config);
DRM_DEBUG_DRIVER("... debug : %s\n", nouveau_debug);
DRM_DEBUG_DRIVER("... noaccel : %d\n", nouveau_noaccel);
DRM_DEBUG_DRIVER("... modeset : %d\n", nouveau_modeset);
DRM_DEBUG_DRIVER("... runpm : %d\n", nouveau_runtime_pm);
DRM_DEBUG_DRIVER("... vram_pushbuf : %d\n", nouveau_vram_pushbuf);
DRM_DEBUG_DRIVER("... hdmimhz : %d\n", nouveau_hdmimhz);
}
static const struct dev_pm_ops nouveau_pm_ops = {
.suspend = nouveau_pmops_suspend,
.resume = nouveau_pmops_resume,
.freeze = nouveau_pmops_freeze,
.thaw = nouveau_pmops_thaw,
.poweroff = nouveau_pmops_freeze,
.restore = nouveau_pmops_resume,
.runtime_suspend = nouveau_pmops_runtime_suspend,
.runtime_resume = nouveau_pmops_runtime_resume,
.runtime_idle = nouveau_pmops_runtime_idle,
};
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/delay.h`, `linux/module.h`, `linux/pci.h`, `linux/pm_runtime.h`, `linux/vga_switcheroo.h`, `linux/mmu_notifier.h`, `linux/dynamic_debug.h`.
- Detected declarations: `function nouveau_pci_name`, `function nouveau_platform_name`, `function nouveau_name`, `function nouveau_cli_work_ready`, `function nouveau_cli_work`, `function nouveau_cli_work_fence`, `function nouveau_cli_work_queue`, `function nouveau_cli_fini`, `function nouveau_cli_init`, `function nouveau_accel_ce_fini`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: pattern 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.