drivers/gpu/drm/i915/gt/intel_gsc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/intel_gsc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/intel_gsc.c- Extension
.c- Size
- 7097 bytes
- Lines
- 322
- 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.
- 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
linux/irq.hlinux/mei_aux.hi915_drv.hi915_reg.hgem/i915_gem_lmem.hgem/i915_gem_region.hgt/intel_gsc.hgt/intel_gt.hgt/intel_gt_print.h
Detected Declarations
struct gsc_deffunction Copyrightfunction gsc_irq_initfunction gsc_ext_om_allocfunction gsc_ext_om_destroyfunction gsc_release_devfunction gsc_destroy_onefunction gsc_init_onefunction gsc_irq_handlerfunction intel_gsc_irq_handlerfunction intel_gsc_initfunction intel_gsc_fini
Annotated Snippet
struct gsc_def {
const char *name;
unsigned long bar;
size_t bar_size;
bool use_polling;
bool slow_firmware;
size_t lmem_size;
};
/* gsc resources and definitions (HECI1 and HECI2) */
static const struct gsc_def gsc_def_dg1[] = {
{
/* HECI1 not yet implemented. */
},
{
.name = "mei-gscfi",
.bar = DG1_GSC_HECI2_BASE,
.bar_size = GSC_BAR_LENGTH,
}
};
static const struct gsc_def gsc_def_dg2[] = {
{
.name = "mei-gsc",
.bar = DG2_GSC_HECI1_BASE,
.bar_size = GSC_BAR_LENGTH,
.lmem_size = SZ_4M,
},
{
.name = "mei-gscfi",
.bar = DG2_GSC_HECI2_BASE,
.bar_size = GSC_BAR_LENGTH,
}
};
static void gsc_release_dev(struct device *dev)
{
struct auxiliary_device *aux_dev = to_auxiliary_dev(dev);
struct mei_aux_device *adev = auxiliary_dev_to_mei_aux_dev(aux_dev);
kfree(adev);
}
static void gsc_destroy_one(struct drm_i915_private *i915,
struct intel_gsc *gsc, unsigned int intf_id)
{
struct intel_gsc_intf *intf = &gsc->intf[intf_id];
if (intf->adev) {
struct auxiliary_device *aux_dev = &intf->adev->aux_dev;
if (intf_id == 0)
intel_huc_unregister_gsc_notifier(&gsc_to_gt(gsc)->uc.huc,
aux_dev->dev.bus);
auxiliary_device_delete(aux_dev);
auxiliary_device_uninit(aux_dev);
intf->adev = NULL;
}
if (intf->irq >= 0)
irq_free_desc(intf->irq);
intf->irq = -1;
gsc_ext_om_destroy(intf);
}
static void gsc_init_one(struct drm_i915_private *i915, struct intel_gsc *gsc,
unsigned int intf_id)
{
struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
struct mei_aux_device *adev;
struct auxiliary_device *aux_dev;
const struct gsc_def *def;
struct intel_gsc_intf *intf = &gsc->intf[intf_id];
int ret;
intf->irq = -1;
intf->id = intf_id;
/*
* On the multi-tile setups the GSC is functional on the first tile only
*/
if (gsc_to_gt(gsc)->info.id != 0) {
drm_dbg(&i915->drm, "Not initializing gsc for remote tiles\n");
return;
}
if (intf_id == 0 && !HAS_HECI_PXP(i915))
return;
Annotation
- Immediate include surface: `linux/irq.h`, `linux/mei_aux.h`, `i915_drv.h`, `i915_reg.h`, `gem/i915_gem_lmem.h`, `gem/i915_gem_region.h`, `gt/intel_gsc.h`, `gt/intel_gt.h`.
- Detected declarations: `struct gsc_def`, `function Copyright`, `function gsc_irq_init`, `function gsc_ext_om_alloc`, `function gsc_ext_om_destroy`, `function gsc_release_dev`, `function gsc_destroy_one`, `function gsc_init_one`, `function gsc_irq_handler`, `function intel_gsc_irq_handler`.
- 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.