drivers/gpu/drm/vboxvideo/vbox_ttm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/vboxvideo/vbox_ttm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/vboxvideo/vbox_ttm.c- Extension
.c- Size
- 871 bytes
- Lines
- 35
- 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
linux/pci.hdrm/drm_file.hdrm/drm_print.hvbox_drv.h
Detected Declarations
function Copyright
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2013-2017 Oracle Corporation
* This file is based on ast_ttm.c
* Copyright 2012 Red Hat Inc.
* Authors: Dave Airlie <airlied@redhat.com>
* Michael Thayer <michael.thayer@oracle.com>
*/
#include <linux/pci.h>
#include <drm/drm_file.h>
#include <drm/drm_print.h>
#include "vbox_drv.h"
int vbox_mm_init(struct vbox_private *vbox)
{
int ret;
resource_size_t base, size;
struct drm_device *dev = &vbox->ddev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
base = pci_resource_start(pdev, 0);
size = pci_resource_len(pdev, 0);
/* Don't fail on errors, but performance might be reduced. */
devm_arch_phys_wc_add(&pdev->dev, base, size);
ret = drmm_vram_helper_init(dev, base, vbox->available_vram_size);
if (ret) {
DRM_ERROR("Error initializing VRAM MM; %d\n", ret);
return ret;
}
return 0;
}
Annotation
- Immediate include surface: `linux/pci.h`, `drm/drm_file.h`, `drm/drm_print.h`, `vbox_drv.h`.
- Detected declarations: `function Copyright`.
- 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.