drivers/gpu/drm/xe/xe_execlist.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_execlist.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_execlist.c- Extension
.c- Size
- 12209 bytes
- Lines
- 492
- 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.
- 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_execlist.hdrm/drm_managed.hinstructions/xe_mi_commands.hregs/xe_engine_regs.hregs/xe_gt_regs.hregs/xe_lrc_layout.hxe_assert.hxe_bo.hxe_device.hxe_exec_queue.hxe_gt_types.hxe_irq.hxe_lrc.hxe_macros.hxe_mmio.hxe_mocs.hxe_ring_ops_types.hxe_sched_job.h
Detected Declarations
function __start_lrcfunction __xe_execlist_port_startfunction __xe_execlist_port_idlefunction xe_execlist_is_idlefunction __xe_execlist_port_start_next_activefunction read_execlist_statusfunction xe_execlist_port_irq_handler_lockedfunction xe_execlist_port_irq_handlerfunction xe_execlist_port_wake_lockedfunction xe_execlist_make_activefunction xe_execlist_port_irq_fail_timerfunction xe_execlist_port_destroyfunction execlist_run_jobfunction execlist_job_freefunction execlist_exec_queue_initfunction execlist_exec_queue_finifunction execlist_exec_queue_destroy_asyncfunction execlist_exec_queue_killfunction execlist_exec_queue_set_priorityfunction execlist_exec_queue_set_timeslicefunction execlist_exec_queue_set_preempt_timeoutfunction execlist_exec_queue_suspendfunction execlist_exec_queue_suspend_waitfunction execlist_exec_queue_resumefunction execlist_exec_queue_activefunction xe_execlist_init
Annotated Snippet
while (!list_empty(&port->active[i])) {
exl = list_first_entry(&port->active[i],
struct xe_execlist_exec_queue,
active_link);
list_del(&exl->active_link);
if (xe_execlist_is_idle(exl)) {
exl->active_priority = XE_EXEC_QUEUE_PRIORITY_UNSET;
continue;
}
list_add_tail(&exl->active_link, &port->active[i]);
__xe_execlist_port_start(port, exl);
return;
}
}
__xe_execlist_port_idle(port);
}
static u64 read_execlist_status(struct xe_hw_engine *hwe)
{
struct xe_gt *gt = hwe->gt;
u32 hi, lo;
lo = xe_mmio_read32(>->mmio, RING_EXECLIST_STATUS_LO(hwe->mmio_base));
hi = xe_mmio_read32(>->mmio, RING_EXECLIST_STATUS_HI(hwe->mmio_base));
return lo | (u64)hi << 32;
}
static void xe_execlist_port_irq_handler_locked(struct xe_execlist_port *port)
{
u64 status;
xe_execlist_port_assert_held(port);
status = read_execlist_status(port->hwe);
if (status & BIT(7))
return;
__xe_execlist_port_start_next_active(port);
}
static void xe_execlist_port_irq_handler(struct xe_hw_engine *hwe,
u16 intr_vec)
{
struct xe_execlist_port *port = hwe->exl_port;
spin_lock(&port->lock);
xe_execlist_port_irq_handler_locked(port);
spin_unlock(&port->lock);
}
static void xe_execlist_port_wake_locked(struct xe_execlist_port *port,
enum xe_exec_queue_priority priority)
{
xe_execlist_port_assert_held(port);
if (port->running_exl && port->running_exl->active_priority >= priority)
return;
__xe_execlist_port_start_next_active(port);
}
static void xe_execlist_make_active(struct xe_execlist_exec_queue *exl)
{
struct xe_execlist_port *port = exl->port;
enum xe_exec_queue_priority priority = exl->q->sched_props.priority;
XE_WARN_ON(priority == XE_EXEC_QUEUE_PRIORITY_UNSET);
XE_WARN_ON(priority < 0);
XE_WARN_ON(priority >= ARRAY_SIZE(exl->port->active));
spin_lock_irq(&port->lock);
if (exl->active_priority != priority &&
exl->active_priority != XE_EXEC_QUEUE_PRIORITY_UNSET) {
/* Priority changed, move it to the right list */
list_del(&exl->active_link);
exl->active_priority = XE_EXEC_QUEUE_PRIORITY_UNSET;
}
if (exl->active_priority == XE_EXEC_QUEUE_PRIORITY_UNSET) {
exl->active_priority = priority;
list_add_tail(&exl->active_link, &port->active[priority]);
}
xe_execlist_port_wake_locked(exl->port, priority);
Annotation
- Immediate include surface: `xe_execlist.h`, `drm/drm_managed.h`, `instructions/xe_mi_commands.h`, `regs/xe_engine_regs.h`, `regs/xe_gt_regs.h`, `regs/xe_lrc_layout.h`, `xe_assert.h`, `xe_bo.h`.
- Detected declarations: `function __start_lrc`, `function __xe_execlist_port_start`, `function __xe_execlist_port_idle`, `function xe_execlist_is_idle`, `function __xe_execlist_port_start_next_active`, `function read_execlist_status`, `function xe_execlist_port_irq_handler_locked`, `function xe_execlist_port_irq_handler`, `function xe_execlist_port_wake_locked`, `function xe_execlist_make_active`.
- 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.