drivers/gpu/drm/xe/xe_vram.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_vram.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_vram.c- Extension
.c- Size
- 10390 bytes
- Lines
- 390
- 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.
- 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
kunit/visibility.hlinux/pci.hdrm/drm_managed.hdrm/drm_print.hregs/xe_bars.hregs/xe_gt_regs.hregs/xe_regs.hxe_assert.hxe_bo.hxe_device.hxe_force_wake.hxe_gt_mcr.hxe_mmio.hxe_sriov.hxe_tile_sriov_vf.hxe_ttm_vram_mgr.hxe_vram.hxe_vram_types.h
Detected Declarations
function resource_is_validfunction determine_lmem_bar_sizefunction get_flat_ccs_offsetfunction tile_vram_sizefunction vram_finifunction for_each_tilefunction print_vram_region_infofunction vram_region_initfunction xe_vram_probefunction for_each_tilefunction xe_vram_region_io_startfunction xe_vram_region_io_sizefunction xe_vram_region_dpa_basefunction xe_vram_region_usable_sizefunction xe_vram_region_actual_physical_size
Annotated Snippet
if (total_size > lmem_bar.io_size) {
drm_info(&xe->drm, "VRAM: %pa is larger than resource %pa\n",
&total_size, &lmem_bar.io_size);
}
remain_io_size -= min_t(u64, tile->mem.vram->actual_physical_size, remain_io_size);
}
err = vram_region_init(xe, xe->mem.vram, &lmem_bar, 0, available_size, total_size,
lmem_bar.io_size);
if (err)
return err;
return devm_add_action_or_reset(xe->drm.dev, vram_fini, xe);
}
/**
* xe_vram_region_io_start - Get the IO start of a VRAM region
* @vram: the VRAM region
*
* Return: the IO start of the VRAM region, or 0 if not valid
*/
resource_size_t xe_vram_region_io_start(const struct xe_vram_region *vram)
{
return vram ? vram->io_start : 0;
}
/**
* xe_vram_region_io_size - Get the IO size of a VRAM region
* @vram: the VRAM region
*
* Return: the IO size of the VRAM region, or 0 if not valid
*/
resource_size_t xe_vram_region_io_size(const struct xe_vram_region *vram)
{
return vram ? vram->io_size : 0;
}
/**
* xe_vram_region_dpa_base - Get the DPA base of a VRAM region
* @vram: the VRAM region
*
* Return: the DPA base of the VRAM region, or 0 if not valid
*/
resource_size_t xe_vram_region_dpa_base(const struct xe_vram_region *vram)
{
return vram ? vram->dpa_base : 0;
}
/**
* xe_vram_region_usable_size - Get the usable size of a VRAM region
* @vram: the VRAM region
*
* Return: the usable size of the VRAM region, or 0 if not valid
*/
resource_size_t xe_vram_region_usable_size(const struct xe_vram_region *vram)
{
return vram ? vram->usable_size : 0;
}
/**
* xe_vram_region_actual_physical_size - Get the actual physical size of a VRAM region
* @vram: the VRAM region
*
* Return: the actual physical size of the VRAM region, or 0 if not valid
*/
resource_size_t xe_vram_region_actual_physical_size(const struct xe_vram_region *vram)
{
return vram ? vram->actual_physical_size : 0;
}
EXPORT_SYMBOL_IF_KUNIT(xe_vram_region_actual_physical_size);
Annotation
- Immediate include surface: `kunit/visibility.h`, `linux/pci.h`, `drm/drm_managed.h`, `drm/drm_print.h`, `regs/xe_bars.h`, `regs/xe_gt_regs.h`, `regs/xe_regs.h`, `xe_assert.h`.
- Detected declarations: `function resource_is_valid`, `function determine_lmem_bar_size`, `function get_flat_ccs_offset`, `function tile_vram_size`, `function vram_fini`, `function for_each_tile`, `function print_vram_region_info`, `function vram_region_init`, `function xe_vram_probe`, `function for_each_tile`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration 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.