drivers/gpu/drm/xe/xe_pci.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_pci.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_pci.c- Extension
.c- Size
- 36687 bytes
- Lines
- 1386
- 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
xe_pci.hkunit/static_stub.hlinux/device/driver.hlinux/module.hlinux/pci.hlinux/pm_runtime.hdrm/drm_color_mgmt.hdrm/drm_drv.hdrm/intel/pciids.hdisplay/xe_display.hregs/xe_gt_regs.hregs/xe_regs.hxe_configfs.hxe_device.hxe_drv.hxe_gt.hxe_gt_sriov_vf.hxe_guc.hxe_mmio.hxe_module.hxe_pci_rebar.hxe_pci_sriov.hxe_pci_types.hxe_pm.hxe_printk.hxe_sriov.hxe_step.hxe_survivability_mode.hxe_tile.htests/xe_pci.c
Detected Declarations
enum toggle_d3coldenum xe_gmdid_typefunction device_id_in_listfunction id_forcedfunction id_blockedfunction find_subplatformfunction read_gmdidfunction handle_gmdidfunction init_devidfunction xe_info_init_earlyfunction xe_info_probe_tile_countfunction xe_info_initfunction for_each_remote_tilefunction platformsfunction xe_pci_removefunction xe_pci_probefunction xe_pci_shutdownfunction d3cold_togglefunction xe_pci_suspendfunction xe_pci_resumefunction xe_pci_runtime_suspendfunction xe_pci_runtime_resumefunction xe_pci_runtime_idlefunction xe_pci_to_pf_devicefunction xe_register_pci_driverfunction xe_unregister_pci_driver
Annotated Snippet
static struct pci_driver xe_pci_driver = {
.name = DRIVER_NAME,
.id_table = pciidlist,
.probe = xe_pci_probe,
.remove = xe_pci_remove,
.shutdown = xe_pci_shutdown,
.sriov_configure = xe_pci_sriov_configure,
#ifdef CONFIG_PM_SLEEP
.driver.pm = &xe_pm_ops,
#endif
};
/**
* xe_pci_to_pf_device() - Get PF &xe_device.
* @pdev: the VF &pci_dev device
*
* Return: pointer to PF &xe_device, NULL otherwise.
*/
struct xe_device *xe_pci_to_pf_device(struct pci_dev *pdev)
{
struct drm_device *drm;
drm = pci_iov_get_pf_drvdata(pdev, &xe_pci_driver);
if (IS_ERR(drm))
return NULL;
return to_xe_device(drm);
}
int xe_register_pci_driver(void)
{
return pci_register_driver(&xe_pci_driver);
}
void xe_unregister_pci_driver(void)
{
pci_unregister_driver(&xe_pci_driver);
}
#if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
#include "tests/xe_pci.c"
#endif
Annotation
- Immediate include surface: `xe_pci.h`, `kunit/static_stub.h`, `linux/device/driver.h`, `linux/module.h`, `linux/pci.h`, `linux/pm_runtime.h`, `drm/drm_color_mgmt.h`, `drm/drm_drv.h`.
- Detected declarations: `enum toggle_d3cold`, `enum xe_gmdid_type`, `function device_id_in_list`, `function id_forced`, `function id_blocked`, `function find_subplatform`, `function read_gmdid`, `function handle_gmdid`, `function init_devid`, `function xe_info_init_early`.
- 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.