drivers/gpu/drm/xe/xe_sysctrl.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_sysctrl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_sysctrl.c- Extension
.c- Size
- 3362 bytes
- Lines
- 133
- 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/device.hlinux/mutex.hdrm/drm_managed.hregs/xe_irq_regs.hregs/xe_sysctrl_regs.hxe_device.hxe_mmio.hxe_pm.hxe_soc_remapper.hxe_sysctrl.hxe_sysctrl_mailbox.hxe_sysctrl_types.h
Detected Declarations
function Controllerfunction xe_sysctrl_workfunction xe_sysctrl_initfunction xe_sysctrl_irq_handlerfunction xe_sysctrl_pm_resume
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2026 Intel Corporation
*/
#include <linux/device.h>
#include <linux/mutex.h>
#include <drm/drm_managed.h>
#include "regs/xe_irq_regs.h"
#include "regs/xe_sysctrl_regs.h"
#include "xe_device.h"
#include "xe_mmio.h"
#include "xe_pm.h"
#include "xe_soc_remapper.h"
#include "xe_sysctrl.h"
#include "xe_sysctrl_mailbox.h"
#include "xe_sysctrl_types.h"
/**
* DOC: System Controller (sysctrl)
*
* System Controller (sysctrl) is a firmware-managed entity on Intel dGPUs
* responsible for selected low-level platform management functions.
* Communication between driver and System Controller is performed
* via a mailbox interface, enabling command and response exchange.
*
* This module provides initialization and support code for interacting
* with System Controller through the mailbox interface.
*/
static void sysctrl_fini(void *arg)
{
struct xe_device *xe = arg;
struct xe_sysctrl *sc = &xe->sc;
disable_work_sync(&sc->work);
xe->soc_remapper.set_sysctrl_region(xe, 0);
}
static void xe_sysctrl_work(struct work_struct *work)
{
struct xe_sysctrl *sc = container_of(work, struct xe_sysctrl, work);
struct xe_device *xe = sc_to_xe(sc);
guard(xe_pm_runtime)(xe);
xe_sysctrl_event(sc);
}
/**
* xe_sysctrl_init() - Initialize System Controller subsystem
* @xe: xe device instance
*
* Entry point for System Controller initialization, called from xe_device_probe.
* This function checks platform support and initializes the system controller.
*
* Return: 0 on success, error code on failure
*/
int xe_sysctrl_init(struct xe_device *xe)
{
struct xe_tile *tile = xe_device_get_root_tile(xe);
struct xe_sysctrl *sc = &xe->sc;
int ret;
if (!xe->info.has_soc_remapper_sysctrl)
return 0;
if (!xe->info.has_sysctrl)
return 0;
sc->mmio = devm_kzalloc(xe->drm.dev, sizeof(*sc->mmio), GFP_KERNEL);
if (!sc->mmio)
return -ENOMEM;
xe_mmio_init(sc->mmio, tile, tile->mmio.regs, tile->mmio.regs_size);
sc->mmio->adj_offset = SYSCTRL_BASE;
sc->mmio->adj_limit = U32_MAX;
ret = devm_mutex_init(xe->drm.dev, &sc->cmd_lock);
if (ret)
return ret;
ret = devm_mutex_init(xe->drm.dev, &sc->event_lock);
if (ret)
return ret;
xe->soc_remapper.set_sysctrl_region(xe, SYSCTRL_MAILBOX_INDEX);
xe_sysctrl_mailbox_init(sc);
INIT_WORK(&sc->work, xe_sysctrl_work);
Annotation
- Immediate include surface: `linux/device.h`, `linux/mutex.h`, `drm/drm_managed.h`, `regs/xe_irq_regs.h`, `regs/xe_sysctrl_regs.h`, `xe_device.h`, `xe_mmio.h`, `xe_pm.h`.
- Detected declarations: `function Controller`, `function xe_sysctrl_work`, `function xe_sysctrl_init`, `function xe_sysctrl_irq_handler`, `function xe_sysctrl_pm_resume`.
- 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.