drivers/gpu/drm/i915/gt/selftest_ring_submission.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/selftest_ring_submission.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/selftest_ring_submission.c- Extension
.c- Size
- 6152 bytes
- Lines
- 300
- 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
i915_selftest.hintel_engine_pm.hselftests/igt_flush_test.h
Detected Declarations
function context_syncfunction new_context_syncfunction mixed_contexts_syncfunction double_context_sync_00function kernel_context_sync_00function __live_ctx_switch_wafunction live_ctx_switch_wafunction for_each_enginefunction intel_ring_submission_live_selftests
Annotated Snippet
if (err || READ_ONCE(*result)) {
if (!err) {
pr_err("pass[%d] wa_bb emitted for the kernel context\n",
pass);
err = -EINVAL;
}
return err;
}
WRITE_ONCE(*result, 0);
err = new_context_sync(engine);
if (READ_ONCE(*result) != STACK_MAGIC) {
if (!err) {
pr_err("pass[%d] wa_bb *NOT* emitted after the kernel context\n",
pass);
err = -EINVAL;
}
return err;
}
WRITE_ONCE(*result, 0);
err = new_context_sync(engine);
if (READ_ONCE(*result) != STACK_MAGIC) {
if (!err) {
pr_err("pass[%d] wa_bb *NOT* emitted for the user context switch\n",
pass);
err = -EINVAL;
}
return err;
}
}
return 0;
}
static int double_context_sync_00(struct intel_engine_cs *engine, u32 *result)
{
struct intel_context *ce;
int err, i;
ce = intel_context_create(engine);
if (IS_ERR(ce))
return PTR_ERR(ce);
for (i = 0; i < 2; i++) {
WRITE_ONCE(*result, 0);
err = context_sync(ce);
if (err)
break;
}
intel_context_put(ce);
if (err)
return err;
if (READ_ONCE(*result)) {
pr_err("wa_bb emitted between the same user context\n");
return -EINVAL;
}
return 0;
}
static int kernel_context_sync_00(struct intel_engine_cs *engine, u32 *result)
{
struct intel_context *ce;
int err, i;
ce = intel_context_create(engine);
if (IS_ERR(ce))
return PTR_ERR(ce);
for (i = 0; i < 2; i++) {
WRITE_ONCE(*result, 0);
err = context_sync(ce);
if (err)
break;
err = context_sync(engine->kernel_context);
if (err)
break;
}
intel_context_put(ce);
if (err)
return err;
if (READ_ONCE(*result)) {
pr_err("wa_bb emitted between the same user context [with intervening kernel]\n");
return -EINVAL;
}
Annotation
- Immediate include surface: `i915_selftest.h`, `intel_engine_pm.h`, `selftests/igt_flush_test.h`.
- Detected declarations: `function context_sync`, `function new_context_sync`, `function mixed_contexts_sync`, `function double_context_sync_00`, `function kernel_context_sync_00`, `function __live_ctx_switch_wa`, `function live_ctx_switch_wa`, `function for_each_engine`, `function intel_ring_submission_live_selftests`.
- 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.