drivers/gpu/drm/i915/gt/intel_reset.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/intel_reset.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/intel_reset.c- Extension
.c- Size
- 46491 bytes
- Lines
- 1735
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sched/mm.hlinux/stop_machine.hlinux/string_helpers.hdrm/intel/mchbar_regs.hdrm/intel/pci_config.hdisplay/intel_display_reset.hdisplay/intel_overlay.hgem/i915_gem_context.hgt/intel_gt_regs.hgt/uc/intel_gsc_fw.huc/intel_guc.hi915_drv.hi915_file_private.hi915_gpu_error.hi915_irq.hi915_reg.hi915_wait_util.hintel_breadcrumbs.hintel_engine_pm.hintel_engine_regs.hintel_gt.hintel_gt_pm.hintel_gt_print.hintel_gt_requests.hintel_reset.hselftest_reset.cselftest_hangcheck.c
Detected Declarations
struct sfc_lock_datafunction client_mark_guiltyfunction mark_guiltyfunction mark_innocentfunction __i915_request_resetfunction i915_in_resetfunction i915_do_resetfunction g4x_reset_completefunction g33_do_resetfunction g4x_do_resetfunction ilk_do_resetfunction gen6_hw_domain_resetfunction __gen6_reset_enginesfunction for_each_engine_maskedfunction gen6_reset_enginesfunction get_sfc_forced_lock_datafunction gen11_lock_sfcfunction gen11_unlock_sfcfunction __gen11_reset_enginesfunction for_each_engine_maskedfunction gen8_engine_reset_preparefunction gen8_engine_reset_cancelfunction gen8_reset_enginesfunction for_each_engine_maskedfunction mock_resetfunction intel_get_gpu_resetfunction __reset_gucfunction needs_wa_14015076503function wa_14015076503_startfunction wa_14015076503_endfunction __intel_gt_resetfunction intel_has_gpu_resetfunction intel_has_reset_enginefunction intel_reset_gucfunction reset_prepare_enginefunction revoke_mmapsfunction reset_preparefunction for_each_enginefunction gt_revokefunction gt_resetfunction reset_finish_enginefunction reset_finishfunction for_each_enginefunction nop_submit_requestfunction __intel_gt_set_wedgedfunction set_wedged_workfunction intel_gt_set_wedgedfunction for_each_engine
Annotated Snippet
struct sfc_lock_data {
i915_reg_t lock_reg;
i915_reg_t ack_reg;
i915_reg_t usage_reg;
u32 lock_bit;
u32 ack_bit;
u32 usage_bit;
u32 reset_bit;
};
static void get_sfc_forced_lock_data(struct intel_engine_cs *engine,
struct sfc_lock_data *sfc_lock)
{
switch (engine->class) {
default:
MISSING_CASE(engine->class);
fallthrough;
case VIDEO_DECODE_CLASS:
sfc_lock->lock_reg = GEN11_VCS_SFC_FORCED_LOCK(engine->mmio_base);
sfc_lock->lock_bit = GEN11_VCS_SFC_FORCED_LOCK_BIT;
sfc_lock->ack_reg = GEN11_VCS_SFC_LOCK_STATUS(engine->mmio_base);
sfc_lock->ack_bit = GEN11_VCS_SFC_LOCK_ACK_BIT;
sfc_lock->usage_reg = GEN11_VCS_SFC_LOCK_STATUS(engine->mmio_base);
sfc_lock->usage_bit = GEN11_VCS_SFC_USAGE_BIT;
sfc_lock->reset_bit = GEN11_VCS_SFC_RESET_BIT(engine->instance);
break;
case VIDEO_ENHANCEMENT_CLASS:
sfc_lock->lock_reg = GEN11_VECS_SFC_FORCED_LOCK(engine->mmio_base);
sfc_lock->lock_bit = GEN11_VECS_SFC_FORCED_LOCK_BIT;
sfc_lock->ack_reg = GEN11_VECS_SFC_LOCK_ACK(engine->mmio_base);
sfc_lock->ack_bit = GEN11_VECS_SFC_LOCK_ACK_BIT;
sfc_lock->usage_reg = GEN11_VECS_SFC_USAGE(engine->mmio_base);
sfc_lock->usage_bit = GEN11_VECS_SFC_USAGE_BIT;
sfc_lock->reset_bit = GEN11_VECS_SFC_RESET_BIT(engine->instance);
break;
}
}
static int gen11_lock_sfc(struct intel_engine_cs *engine,
u32 *reset_mask,
u32 *unlock_mask)
{
struct intel_uncore *uncore = engine->uncore;
u8 vdbox_sfc_access = engine->gt->info.vdbox_sfc_access;
struct sfc_lock_data sfc_lock;
bool lock_obtained, lock_to_other = false;
int ret;
switch (engine->class) {
case VIDEO_DECODE_CLASS:
if ((BIT(engine->instance) & vdbox_sfc_access) == 0)
return 0;
fallthrough;
case VIDEO_ENHANCEMENT_CLASS:
get_sfc_forced_lock_data(engine, &sfc_lock);
break;
default:
return 0;
}
if (!(intel_uncore_read_fw(uncore, sfc_lock.usage_reg) & sfc_lock.usage_bit)) {
struct intel_engine_cs *paired_vecs;
if (engine->class != VIDEO_DECODE_CLASS ||
GRAPHICS_VER(engine->i915) != 12)
return 0;
/*
* Wa_14010733141
*
* If the VCS-MFX isn't using the SFC, we also need to check
* whether VCS-HCP is using it. If so, we need to issue a *VE*
* forced lock on the VE engine that shares the same SFC.
*/
if (!(intel_uncore_read_fw(uncore,
GEN12_HCP_SFC_LOCK_STATUS(engine->mmio_base)) &
GEN12_HCP_SFC_USAGE_BIT))
return 0;
paired_vecs = find_sfc_paired_vecs_engine(engine);
get_sfc_forced_lock_data(paired_vecs, &sfc_lock);
lock_to_other = true;
Annotation
- Immediate include surface: `linux/sched/mm.h`, `linux/stop_machine.h`, `linux/string_helpers.h`, `drm/intel/mchbar_regs.h`, `drm/intel/pci_config.h`, `display/intel_display_reset.h`, `display/intel_overlay.h`, `gem/i915_gem_context.h`.
- Detected declarations: `struct sfc_lock_data`, `function client_mark_guilty`, `function mark_guilty`, `function mark_innocent`, `function __i915_request_reset`, `function i915_in_reset`, `function i915_do_reset`, `function g4x_reset_complete`, `function g33_do_reset`, `function g4x_do_reset`.
- 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.