From 50b0eff2ddbbd6a2c869515451eb6024f8f896bb Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 18 Aug 2021 10:02:49 +0000 Subject: [PATCH] drm/i915: Only access SFC_DONE when media domain is not fused off From Matt Roper 65395b053d03cb662e63cbf2c7e0faef8c15cb8c in linux 5.10.y/5.10.60 24d032e2359e3abc926b3d423f49a7c33e0b7836 in mainline linux --- sys/dev/pci/drm/i915/i915_gpu_error.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/i915/i915_gpu_error.c b/sys/dev/pci/drm/i915/i915_gpu_error.c index 148afc6fc46..f6ed1bcc859 100644 --- a/sys/dev/pci/drm/i915/i915_gpu_error.c +++ b/sys/dev/pci/drm/i915/i915_gpu_error.c @@ -750,9 +750,18 @@ static void err_print_gt(struct drm_i915_error_state_buf *m, if (INTEL_GEN(m->i915) >= 12) { int i; - for (i = 0; i < GEN12_SFC_DONE_MAX; i++) + for (i = 0; i < GEN12_SFC_DONE_MAX; i++) { + /* + * SFC_DONE resides in the VD forcewake domain, so it + * only exists if the corresponding VCS engine is + * present. + */ + if (!HAS_ENGINE(gt->_gt, _VCS(i * 2))) + continue; + err_printf(m, " SFC_DONE[%d]: 0x%08x\n", i, gt->sfc_done[i]); + } err_printf(m, " GAM_DONE: 0x%08x\n", gt->gam_done); } @@ -1638,6 +1647,14 @@ static void gt_record_regs(struct intel_gt_coredump *gt) if (INTEL_GEN(i915) >= 12) { for (i = 0; i < GEN12_SFC_DONE_MAX; i++) { + /* + * SFC_DONE resides in the VD forcewake domain, so it + * only exists if the corresponding VCS engine is + * present. + */ + if (!HAS_ENGINE(gt->_gt, _VCS(i * 2))) + continue; + gt->sfc_done[i] = intel_uncore_read(uncore, GEN12_SFC_DONE(i)); } -- 2.20.1