drivers/gpu/drm/virtio/virtgpu_drv.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/virtio/virtgpu_drv.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/virtio/virtgpu_drv.c- Extension
.c- Size
- 6761 bytes
- Lines
- 263
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
linux/aperture.hlinux/module.hlinux/pci.hlinux/poll.hlinux/vgaarb.hlinux/wait.hdrm/clients/drm_client_setup.hdrm/drm.hdrm/drm_atomic_helper.hdrm/drm_drv.hdrm/drm_fbdev_shmem.hdrm/drm_file.hdrm/drm_print.hvirtgpu_drv.h
Detected Declarations
function virtio_gpu_pci_quirkfunction virtio_gpu_probefunction virtio_gpu_removefunction virtio_gpu_shutdownfunction virtio_gpu_config_changedfunction virtio_gpu_driver_initfunction virtio_gpu_driver_exitmodule init virtio_gpu_driver_init
Annotated Snippet
module_init(virtio_gpu_driver_init);
module_exit(virtio_gpu_driver_exit);
MODULE_DEVICE_TABLE(virtio, id_table);
MODULE_DESCRIPTION("Virtio GPU driver");
MODULE_LICENSE("GPL and additional rights");
MODULE_AUTHOR("Dave Airlie <airlied@redhat.com>");
MODULE_AUTHOR("Gerd Hoffmann <kraxel@redhat.com>");
MODULE_AUTHOR("Alon Levy");
DEFINE_DRM_GEM_FOPS(virtio_gpu_driver_fops);
static const struct drm_driver driver = {
/*
* If KMS is disabled DRIVER_MODESET and DRIVER_ATOMIC are masked
* out via drm_device::driver_features:
*/
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_RENDER | DRIVER_ATOMIC |
DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE | DRIVER_CURSOR_HOTSPOT,
.open = virtio_gpu_driver_open,
.postclose = virtio_gpu_driver_postclose,
.dumb_create = virtio_gpu_mode_dumb_create,
DRM_FBDEV_SHMEM_DRIVER_OPS,
#if defined(CONFIG_DEBUG_FS)
.debugfs_init = virtio_gpu_debugfs_init,
#endif
.gem_prime_import = virtgpu_gem_prime_import,
.gem_prime_import_sg_table = virtgpu_gem_prime_import_sg_table,
.gem_create_object = virtio_gpu_create_object,
.fops = &virtio_gpu_driver_fops,
.ioctls = virtio_gpu_ioctls,
.num_ioctls = DRM_VIRTIO_NUM_IOCTLS,
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
.major = DRIVER_MAJOR,
.minor = DRIVER_MINOR,
.patchlevel = DRIVER_PATCHLEVEL,
.release = virtio_gpu_release,
};
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/module.h`, `linux/pci.h`, `linux/poll.h`, `linux/vgaarb.h`, `linux/wait.h`, `drm/clients/drm_client_setup.h`, `drm/drm.h`.
- Detected declarations: `function virtio_gpu_pci_quirk`, `function virtio_gpu_probe`, `function virtio_gpu_remove`, `function virtio_gpu_shutdown`, `function virtio_gpu_config_changed`, `function virtio_gpu_driver_init`, `function virtio_gpu_driver_exit`, `module init virtio_gpu_driver_init`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration 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.