drivers/gpu/drm/xe/xe_device.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_device.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_device.h- Extension
.h- Size
- 6471 bytes
- Lines
- 238
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/drm_util.hxe_device_types.hxe_gt_types.hxe_sriov.h
Detected Declarations
struct xe_vmfunction xe_device_uc_enabledfunction for_each_iffunction xe_device_has_flat_ccsfunction xe_device_has_sriovfunction xe_device_has_msixfunction xe_device_has_memirqfunction xe_device_uses_memirqfunction xe_device_has_lmttfunction xe_device_has_mertfunction xe_device_wedgedfunction xe_device_is_admin_only
Annotated Snippet
#ifndef _XE_DEVICE_H_
#define _XE_DEVICE_H_
#include <drm/drm_util.h>
#include "xe_device_types.h"
#include "xe_gt_types.h"
#include "xe_sriov.h"
struct xe_vm;
static inline struct xe_device *to_xe_device(const struct drm_device *dev)
{
return container_of(dev, struct xe_device, drm);
}
static inline struct xe_device *kdev_to_xe_device(struct device *kdev)
{
struct drm_device *drm = dev_get_drvdata(kdev);
return drm ? to_xe_device(drm) : NULL;
}
static inline struct xe_device *pdev_to_xe_device(struct pci_dev *pdev)
{
struct drm_device *drm = pci_get_drvdata(pdev);
return drm ? to_xe_device(drm) : NULL;
}
static inline struct xe_device *xe_device_const_cast(const struct xe_device *xe)
{
return (struct xe_device *)xe;
}
static inline struct xe_device *ttm_to_xe_device(struct ttm_device *ttm)
{
return container_of(ttm, struct xe_device, ttm);
}
struct xe_device *xe_device_create(struct pci_dev *pdev);
int xe_device_init_early(struct xe_device *xe);
int xe_device_probe_early(struct xe_device *xe);
int xe_device_probe(struct xe_device *xe);
void xe_device_remove(struct xe_device *xe);
void xe_device_shutdown(struct xe_device *xe);
void xe_device_wmb(struct xe_device *xe);
static inline struct xe_file *to_xe_file(const struct drm_file *file)
{
return file->driver_priv;
}
static inline struct xe_tile *xe_device_get_root_tile(struct xe_device *xe)
{
return &xe->tiles[0];
}
static inline struct xe_gt *xe_device_get_gt(struct xe_device *xe, u8 gt_id)
{
struct xe_tile *tile;
struct xe_gt *gt;
if (gt_id >= xe->info.tile_count * xe->info.max_gt_per_tile)
return NULL;
tile = &xe->tiles[gt_id / xe->info.max_gt_per_tile];
switch (gt_id % xe->info.max_gt_per_tile) {
default:
xe_assert(xe, false);
fallthrough;
case 0:
gt = tile->primary_gt;
break;
case 1:
gt = tile->media_gt;
break;
}
if (!gt)
return NULL;
drm_WARN_ON(&xe->drm, gt->info.id != gt_id);
drm_WARN_ON(&xe->drm, gt->info.type == XE_GT_TYPE_UNINITIALIZED);
return gt;
}
/*
Annotation
- Immediate include surface: `drm/drm_util.h`, `xe_device_types.h`, `xe_gt_types.h`, `xe_sriov.h`.
- Detected declarations: `struct xe_vm`, `function xe_device_uc_enabled`, `function for_each_if`, `function xe_device_has_flat_ccs`, `function xe_device_has_sriov`, `function xe_device_has_msix`, `function xe_device_has_memirq`, `function xe_device_uses_memirq`, `function xe_device_has_lmtt`, `function xe_device_has_mert`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.