drivers/gpu/drm/xe/xe_pxp_submit.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_pxp_submit.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_pxp_submit.c- Extension
.c- Size
- 17109 bytes
- Lines
- 603
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xe_pxp_submit.hlinux/delay.huapi/drm/xe_drm.hxe_device_types.hxe_bb.hxe_bo.hxe_exec_queue.hxe_gsc_submit.hxe_gt.hxe_lrc.hxe_map.hxe_pxp.hxe_pxp_types.hxe_sched_job.hxe_vm.habi/gsc_command_header_abi.habi/gsc_pxp_commands_abi.hinstructions/xe_gsc_commands.hinstructions/xe_mfx_commands.hinstructions/xe_mi_commands.h
Detected Declarations
function Copyrightfunction destroy_vcs_execution_resourcesfunction allocate_gsc_client_resourcesfunction xe_validation_guardfunction destroy_gsc_client_resourcesfunction xe_pxp_allocate_execution_resourcesfunction xe_pxp_destroy_execution_resourcesfunction pxp_emit_waitfunction pxp_emit_session_selectionfunction pxp_emit_inline_terminationfunction pxp_emit_session_terminationfunction xe_pxp_submit_session_terminationfunction is_fw_err_platform_configfunction fw_err_to_stringfunction pxp_pkt_submitfunction emit_pxp_heci_cmdfunction gsccs_send_messagefunction initializefunction xe_pxp_submit_session_invalidation
Annotated Snippet
if (IS_ERR(bo)) {
err = PTR_ERR(bo);
xe_validation_retry_on_oom(&ctx, &err);
break;
}
}
if (err)
goto vm_out;
fence = xe_vm_bind_kernel_bo(vm, bo, NULL, 0, XE_CACHE_WB);
if (IS_ERR(fence)) {
err = PTR_ERR(fence);
goto bo_out;
}
timeout = dma_fence_wait_timeout(fence, false, HZ);
dma_fence_put(fence);
if (timeout <= 0) {
err = timeout ?: -ETIME;
goto bo_out;
}
q = xe_exec_queue_create(xe, vm, BIT(hwe->logical_instance), 1, hwe,
EXEC_QUEUE_FLAG_KERNEL |
EXEC_QUEUE_FLAG_PERMANENT, 0);
if (IS_ERR(q)) {
err = PTR_ERR(q);
goto bo_out;
}
gsc_res->vm = vm;
gsc_res->bo = bo;
gsc_res->inout_size = inout_size;
gsc_res->batch = IOSYS_MAP_INIT_OFFSET(&bo->vmap, 0);
gsc_res->msg_in = IOSYS_MAP_INIT_OFFSET(&bo->vmap, PXP_BB_SIZE);
gsc_res->msg_out = IOSYS_MAP_INIT_OFFSET(&bo->vmap, PXP_BB_SIZE + inout_size);
gsc_res->q = q;
/* initialize host-session-handle (for all Xe-to-gsc-firmware PXP cmds) */
gsc_res->host_session_handle = xe_gsc_create_host_session_id();
return 0;
bo_out:
xe_bo_unpin_map_no_vm(bo);
vm_out:
xe_vm_close_and_put(vm);
return err;
}
static void destroy_gsc_client_resources(struct xe_pxp_gsc_client_resources *gsc_res)
{
if (!gsc_res->q)
return;
xe_exec_queue_put(gsc_res->q);
xe_bo_unpin_map_no_vm(gsc_res->bo);
xe_vm_close_and_put(gsc_res->vm);
}
/**
* xe_pxp_allocate_execution_resources - Allocate PXP submission objects
* @pxp: the xe_pxp structure
*
* Allocates exec_queues objects for VCS and GSCCS submission. The GSCCS
* submissions are done via PPGTT, so this function allocates a VM for it and
* maps the object into it.
*
* Returns 0 if the allocation and mapping is successful, an errno value
* otherwise.
*/
int xe_pxp_allocate_execution_resources(struct xe_pxp *pxp)
{
int err;
err = allocate_vcs_execution_resources(pxp);
if (err)
return err;
/*
* PXP commands can require a lot of BO space (see PXP_MAX_PACKET_SIZE),
* but we currently only support a subset of commands that are small
* (< 20 dwords), so a single page is enough for now.
*/
err = allocate_gsc_client_resources(pxp->gt, &pxp->gsc_res, XE_PAGE_SIZE);
if (err)
goto destroy_vcs_context;
return 0;
Annotation
- Immediate include surface: `xe_pxp_submit.h`, `linux/delay.h`, `uapi/drm/xe_drm.h`, `xe_device_types.h`, `xe_bb.h`, `xe_bo.h`, `xe_exec_queue.h`, `xe_gsc_submit.h`.
- Detected declarations: `function Copyright`, `function destroy_vcs_execution_resources`, `function allocate_gsc_client_resources`, `function xe_validation_guard`, `function destroy_gsc_client_resources`, `function xe_pxp_allocate_execution_resources`, `function xe_pxp_destroy_execution_resources`, `function pxp_emit_wait`, `function pxp_emit_session_selection`, `function pxp_emit_inline_termination`.
- 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.