drivers/gpu/drm/xe/xe_wait_user_fence.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_wait_user_fence.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_wait_user_fence.c- Extension
.c- Size
- 4286 bytes
- Lines
- 183
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xe_wait_user_fence.hdrm/drm_device.hdrm/drm_file.hdrm/drm_utils.huapi/drm/xe_drm.hxe_device.hxe_macros.hxe_exec_queue.h
Detected Declarations
function do_comparefunction to_jiffies_timeoutfunction xe_wait_user_fence_ioctl
Annotated Snippet
if (signal_pending(current)) {
err = -ERESTARTSYS;
break;
}
if (q) {
if (q->ops->reset_status(q)) {
drm_info(&xe->drm, "exec queue reset detected\n");
err = -EIO;
break;
}
}
if (!timeout) {
LNL_FLUSH_WORKQUEUE(xe->ordered_wq);
err = do_compare(addr, args->value, args->mask,
args->op);
if (err <= 0) {
drm_dbg(&xe->drm, "LNL_FLUSH_WORKQUEUE resolved ufence timeout\n");
break;
}
err = -ETIME;
break;
}
timeout = wait_woken(&w_wait, TASK_INTERRUPTIBLE, timeout);
}
remove_wait_queue(&xe->ufence_wq, &w_wait);
if (!(args->flags & DRM_XE_UFENCE_WAIT_FLAG_ABSTIME)) {
args->timeout -= ktime_to_ns(ktime_sub(ktime_get(), start));
if (args->timeout < 0)
args->timeout = 0;
}
if (q)
xe_exec_queue_put(q);
return err;
}
Annotation
- Immediate include surface: `xe_wait_user_fence.h`, `drm/drm_device.h`, `drm/drm_file.h`, `drm/drm_utils.h`, `uapi/drm/xe_drm.h`, `xe_device.h`, `xe_macros.h`, `xe_exec_queue.h`.
- Detected declarations: `function do_compare`, `function to_jiffies_timeout`, `function xe_wait_user_fence_ioctl`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.