drivers/gpu/drm/i915/gt/intel_execlists_submission.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/intel_execlists_submission.c- Extension
.c- Size
- 127071 bytes
- Lines
- 4177
- 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.
- 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/interrupt.hlinux/string_helpers.hdrm/drm_print.hgen8_engine_cs.hi915_drv.hi915_list_util.hi915_reg.hi915_timer_util.hi915_trace.hi915_vgpu.hi915_wait_util.hintel_breadcrumbs.hintel_context.hintel_engine_heartbeat.hintel_engine_pm.hintel_engine_regs.hintel_engine_stats.hintel_execlists_submission.hintel_gt.hintel_gt_irq.hintel_gt_pm.hintel_gt_regs.hintel_gt_requests.hintel_lrc.hintel_lrc_reg.hintel_mocs.hintel_reset.hintel_ring.hintel_workarounds.hshmem_utils.hselftest_execlists.c
Detected Declarations
struct virtual_enginestruct ve_nodestruct execlists_capturefunction __active_requestfunction list_for_each_entry_from_reversefunction active_requestfunction ring_set_pausedfunction rq_priofunction effective_priofunction queue_priofunction virtual_priofunction need_preemptfunction assert_priority_queuefunction __unwind_incomplete_requestsfunction list_for_each_entry_safe_reversefunction execlists_context_status_changefunction reset_activefunction bad_requestfunction __execlists_schedule_infunction execlists_schedule_infunction resubmit_virtual_requestfunction kick_siblingsfunction __execlists_schedule_outfunction execlists_schedule_outfunction map_i915_prio_to_lrc_desc_priofunction execlists_update_contextfunction write_descfunction dump_portfunction trace_portsfunction reset_in_progressfunction assert_pending_validfunction execlists_submit_portsfunction ctx_single_port_submissionfunction can_merge_ctxfunction i915_request_flagsfunction can_merge_rqfunction virtual_matchesfunction first_virtual_enginefunction virtual_xfer_contextfunction defer_requestfunction for_each_waiterfunction defer_activefunction timeslice_yieldfunction needs_timeslicefunction timeslice_expiredfunction timeslicefunction start_timeslicefunction record_preemption
Annotated Snippet
struct virtual_engine {
struct intel_engine_cs base;
struct intel_context context;
struct rcu_work rcu;
/*
* We allow only a single request through the virtual engine at a time
* (each request in the timeline waits for the completion fence of
* the previous before being submitted). By restricting ourselves to
* only submitting a single request, each request is placed on to a
* physical to maximise load spreading (by virtue of the late greedy
* scheduling -- each real engine takes the next available request
* upon idling).
*/
struct i915_request *request;
/*
* We keep a rbtree of available virtual engines inside each physical
* engine, sorted by priority. Here we preallocate the nodes we need
* for the virtual engine, indexed by physical_engine->id.
*/
struct ve_node {
struct rb_node rb;
int prio;
} nodes[I915_NUM_ENGINES];
/* And finally, which physical engines this virtual engine maps onto. */
unsigned int num_siblings;
struct intel_engine_cs *siblings[];
};
static struct virtual_engine *to_virtual_engine(struct intel_engine_cs *engine)
{
GEM_BUG_ON(!intel_engine_is_virtual(engine));
return container_of(engine, struct virtual_engine, base);
}
static struct intel_context *
execlists_create_virtual(struct intel_engine_cs **siblings, unsigned int count,
unsigned long flags);
static struct i915_request *
__active_request(const struct intel_timeline * const tl,
struct i915_request *rq,
int error)
{
struct i915_request *active = rq;
list_for_each_entry_from_reverse(rq, &tl->requests, link) {
if (__i915_request_is_complete(rq))
break;
if (error) {
i915_request_set_error_once(rq, error);
__i915_request_skip(rq);
}
active = rq;
}
return active;
}
static struct i915_request *
active_request(const struct intel_timeline * const tl, struct i915_request *rq)
{
return __active_request(tl, rq, 0);
}
static void ring_set_paused(const struct intel_engine_cs *engine, int state)
{
/*
* We inspect HWS_PREEMPT with a semaphore inside
* engine->emit_fini_breadcrumb. If the dword is true,
* the ring is paused as the semaphore will busywait
* until the dword is false.
*/
engine->status_page.addr[I915_GEM_HWS_PREEMPT] = state;
if (state)
wmb();
}
static struct i915_priolist *to_priolist(struct rb_node *rb)
{
return rb_entry(rb, struct i915_priolist, node);
}
static int rq_prio(const struct i915_request *rq)
{
return READ_ONCE(rq->sched.attr.priority);
}
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/string_helpers.h`, `drm/drm_print.h`, `gen8_engine_cs.h`, `i915_drv.h`, `i915_list_util.h`, `i915_reg.h`, `i915_timer_util.h`.
- Detected declarations: `struct virtual_engine`, `struct ve_node`, `struct execlists_capture`, `function __active_request`, `function list_for_each_entry_from_reverse`, `function active_request`, `function ring_set_paused`, `function rq_prio`, `function effective_prio`, `function queue_prio`.
- 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.
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.