drivers/gpu/drm/i915/gt/selftest_workarounds.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/selftest_workarounds.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/selftest_workarounds.c- Extension
.c- Size
- 29653 bytes
- Lines
- 1383
- 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
gem/i915_gem_internal.hgem/i915_gem_pm.hgt/intel_engine_user.hgt/intel_gt.hi915_selftest.hintel_reset.hselftests/igt_flush_test.hselftests/igt_reset.hselftests/igt_spinner.hselftests/intel_scheduler_helpers.hselftests/mock_drm.hgem/selftests/igt_gem_utils.hgem/selftests/mock_context.h
Detected Declarations
struct wa_listsstruct regmaskfunction request_add_syncfunction request_add_spinfunction reference_lists_initfunction for_each_enginefunction reference_lists_finifunction read_nonprivsfunction get_whitelist_regfunction print_resultsfunction check_whitelistfunction do_device_resetfunction do_engine_resetfunction do_guc_resetfunction switch_to_scratch_contextfunction check_whitelist_across_resetfunction reg_writefunction wo_registerfunction timestampfunction ro_registerfunction whitelist_writable_countfunction check_dirty_whitelistfunction live_dirty_whitelistfunction for_each_enginefunction live_reset_whitelistfunction for_each_enginefunction read_whitelisted_registersfunction scrub_whitelisted_registersfunction find_regfunction pardon_regfunction result_eqfunction writeonly_regfunction result_neqfunction check_whitelisted_registersfunction live_isolated_whitelistfunction for_each_enginefunction verify_wa_listsfunction for_each_enginefunction live_gpu_reset_workaroundsfunction live_engine_reset_workaroundsfunction for_each_enginefunction intel_workarounds_live_selftests
Annotated Snippet
struct wa_lists {
struct i915_wa_list gt_wa_list;
struct {
struct i915_wa_list wa_list;
struct i915_wa_list ctx_wa_list;
} engine[I915_NUM_ENGINES];
};
static int request_add_sync(struct i915_request *rq, int err)
{
i915_request_get(rq);
i915_request_add(rq);
if (i915_request_wait(rq, 0, HZ / 5) < 0)
err = -EIO;
i915_request_put(rq);
return err;
}
static int request_add_spin(struct i915_request *rq, struct igt_spinner *spin)
{
int err = 0;
i915_request_get(rq);
i915_request_add(rq);
if (spin && !igt_wait_for_spinner(spin, rq))
err = -ETIMEDOUT;
i915_request_put(rq);
return err;
}
static void
reference_lists_init(struct intel_gt *gt, struct wa_lists *lists)
{
struct intel_engine_cs *engine;
enum intel_engine_id id;
memset(lists, 0, sizeof(*lists));
wa_init_start(&lists->gt_wa_list, gt, "GT_REF", "global");
gt_init_workarounds(gt, &lists->gt_wa_list);
wa_init_finish(&lists->gt_wa_list);
for_each_engine(engine, gt, id) {
struct i915_wa_list *wal = &lists->engine[id].wa_list;
wa_init_start(wal, gt, "REF", engine->name);
engine_init_workarounds(engine, wal);
wa_init_finish(wal);
__intel_engine_init_ctx_wa(engine,
&lists->engine[id].ctx_wa_list,
"CTX_REF");
}
}
static void
reference_lists_fini(struct intel_gt *gt, struct wa_lists *lists)
{
struct intel_engine_cs *engine;
enum intel_engine_id id;
for_each_engine(engine, gt, id)
intel_wa_list_free(&lists->engine[id].wa_list);
intel_wa_list_free(&lists->gt_wa_list);
}
static struct drm_i915_gem_object *
read_nonprivs(struct intel_context *ce)
{
struct intel_engine_cs *engine = ce->engine;
const u32 base = engine->mmio_base;
struct drm_i915_gem_object *result;
struct i915_request *rq;
struct i915_vma *vma;
u32 srm, *cs;
int err;
int i;
result = i915_gem_object_create_internal(engine->i915, PAGE_SIZE);
if (IS_ERR(result))
return result;
i915_gem_object_set_cache_coherency(result, I915_CACHE_LLC);
cs = i915_gem_object_pin_map_unlocked(result, I915_MAP_WB);
if (IS_ERR(cs)) {
err = PTR_ERR(cs);
Annotation
- Immediate include surface: `gem/i915_gem_internal.h`, `gem/i915_gem_pm.h`, `gt/intel_engine_user.h`, `gt/intel_gt.h`, `i915_selftest.h`, `intel_reset.h`, `selftests/igt_flush_test.h`, `selftests/igt_reset.h`.
- Detected declarations: `struct wa_lists`, `struct regmask`, `function request_add_sync`, `function request_add_spin`, `function reference_lists_init`, `function for_each_engine`, `function reference_lists_fini`, `function read_nonprivs`, `function get_whitelist_reg`, `function print_results`.
- 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.