drivers/gpu/drm/xe/xe_hw_engine_group.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_hw_engine_group.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_hw_engine_group.c- Extension
.c- Size
- 9471 bytes
- Lines
- 403
- 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
drm/drm_managed.hxe_assert.hxe_device_types.hxe_exec_queue.hxe_gt.hxe_gt_stats.hxe_hw_engine_group.hxe_sync.hxe_vm.h
Detected Declarations
function hw_engine_group_resume_lr_jobs_funcfunction list_for_each_entryfunction hw_engine_group_allocfunction xe_hw_engine_setup_groupsfunction for_each_hw_enginefunction xe_hw_engine_group_add_exec_queuefunction xe_hw_engine_group_del_exec_queuefunction xe_hw_engine_group_resume_faulting_lr_jobsfunction xe_hw_engine_group_suspend_faulting_lr_jobsfunction list_for_each_entryfunction list_for_each_entryfunction xe_hw_engine_group_wait_for_dma_fence_jobsfunction list_for_each_entryfunction switch_modefunction wait_syncsfunction xe_hw_engine_group_get_modefunction xe_hw_engine_group_putfunction xe_hw_engine_group_find_exec_mode
Annotated Snippet
switch (hwe->class) {
case XE_ENGINE_CLASS_COPY:
hwe->hw_engine_group = group_bcs;
break;
case XE_ENGINE_CLASS_RENDER:
case XE_ENGINE_CLASS_COMPUTE:
hwe->hw_engine_group = group_rcs_ccs;
break;
case XE_ENGINE_CLASS_VIDEO_DECODE:
case XE_ENGINE_CLASS_VIDEO_ENHANCE:
hwe->hw_engine_group = group_vcs_vecs;
break;
case XE_ENGINE_CLASS_OTHER:
break;
case XE_ENGINE_CLASS_MAX:
xe_gt_assert(gt, false);
}
}
return 0;
}
/**
* xe_hw_engine_group_add_exec_queue() - Add an exec queue to a hw engine group
* @group: The hw engine group
* @q: The exec_queue
*
* Return: 0 on success,
* -EINTR if the lock could not be acquired
*/
int xe_hw_engine_group_add_exec_queue(struct xe_hw_engine_group *group, struct xe_exec_queue *q)
{
int err;
struct xe_device *xe = gt_to_xe(q->gt);
xe_assert(xe, group);
xe_assert(xe, !(q->flags & EXEC_QUEUE_FLAG_VM));
xe_assert(xe, q->vm);
if (xe_vm_in_preempt_fence_mode(q->vm))
return 0;
err = down_write_killable(&group->mode_sem);
if (err)
return err;
if (xe_vm_in_fault_mode(q->vm) && group->cur_mode == EXEC_MODE_DMA_FENCE) {
q->ops->suspend(q);
err = q->ops->suspend_wait(q);
if (err)
goto err_suspend;
xe_hw_engine_group_resume_faulting_lr_jobs(group);
}
list_add(&q->hw_engine_group_link, &group->exec_queue_list);
up_write(&group->mode_sem);
return 0;
err_suspend:
up_write(&group->mode_sem);
return err;
}
ALLOW_ERROR_INJECTION(xe_hw_engine_group_add_exec_queue, ERRNO);
/**
* xe_hw_engine_group_del_exec_queue() - Delete an exec queue from a hw engine group
* @group: The hw engine group
* @q: The exec_queue
*/
void xe_hw_engine_group_del_exec_queue(struct xe_hw_engine_group *group, struct xe_exec_queue *q)
{
struct xe_device *xe = gt_to_xe(q->gt);
xe_assert(xe, group);
xe_assert(xe, q->vm);
down_write(&group->mode_sem);
if (!list_empty(&q->hw_engine_group_link))
list_del(&q->hw_engine_group_link);
up_write(&group->mode_sem);
}
/**
* xe_hw_engine_group_resume_faulting_lr_jobs() - Asynchronously resume the hw engine group's
* faulting LR jobs
* @group: The hw engine group
Annotation
- Immediate include surface: `drm/drm_managed.h`, `xe_assert.h`, `xe_device_types.h`, `xe_exec_queue.h`, `xe_gt.h`, `xe_gt_stats.h`, `xe_hw_engine_group.h`, `xe_sync.h`.
- Detected declarations: `function hw_engine_group_resume_lr_jobs_func`, `function list_for_each_entry`, `function hw_engine_group_alloc`, `function xe_hw_engine_setup_groups`, `function for_each_hw_engine`, `function xe_hw_engine_group_add_exec_queue`, `function xe_hw_engine_group_del_exec_queue`, `function xe_hw_engine_group_resume_faulting_lr_jobs`, `function xe_hw_engine_group_suspend_faulting_lr_jobs`, `function list_for_each_entry`.
- 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.