Skip to content

Commit 8df23e4

Browse files
johnharr-inteljnikula
authored andcommitted
drm/i915/guc: Fix missing ecodes
Error captures are tagged with an 'ecode'. This is a pseduo-unique magic number that is meant to distinguish similar seeming bugs with different underlying signatures. It is a combination of two ring state registers. Unfortunately, the register state being used is only valid in execlist mode. In GuC mode, the register state exists in a separate list of arbitrary register address/value pairs rather than the named entry structure. So, search through that list to find the two exciting registers and copy them over to the structure's named members. v2: if else if instead of if if (Alan) Signed-off-by: John Harrison <[email protected]> Reviewed-by: Alan Previn <[email protected]> Fixes: a6f0f9c ("drm/i915/guc: Plumb GuC-capture into gpu_coredump") Cc: Alan Previn <[email protected]> Cc: Umesh Nerlige Ramappa <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: Matt Roper <[email protected]> Cc: Aravind Iddamsetty <[email protected]> Cc: Michael Cheng <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Bruce Chang <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Cc: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 9724ecd) Signed-off-by: Jani Nikula <[email protected]>
1 parent 088a422 commit 8df23e4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,27 @@ int intel_guc_capture_print_engine_node(struct drm_i915_error_state_buf *ebuf,
15711571

15721572
#endif //CONFIG_DRM_I915_CAPTURE_ERROR
15731573

1574+
static void guc_capture_find_ecode(struct intel_engine_coredump *ee)
1575+
{
1576+
struct gcap_reg_list_info *reginfo;
1577+
struct guc_mmio_reg *regs;
1578+
i915_reg_t reg_ipehr = RING_IPEHR(0);
1579+
i915_reg_t reg_instdone = RING_INSTDONE(0);
1580+
int i;
1581+
1582+
if (!ee->guc_capture_node)
1583+
return;
1584+
1585+
reginfo = ee->guc_capture_node->reginfo + GUC_CAPTURE_LIST_TYPE_ENGINE_INSTANCE;
1586+
regs = reginfo->regs;
1587+
for (i = 0; i < reginfo->num_regs; i++) {
1588+
if (regs[i].offset == reg_ipehr.reg)
1589+
ee->ipehr = regs[i].value;
1590+
else if (regs[i].offset == reg_instdone.reg)
1591+
ee->instdone.instdone = regs[i].value;
1592+
}
1593+
}
1594+
15741595
void intel_guc_capture_free_node(struct intel_engine_coredump *ee)
15751596
{
15761597
if (!ee || !ee->guc_capture_node)
@@ -1612,6 +1633,7 @@ void intel_guc_capture_get_matching_node(struct intel_gt *gt,
16121633
list_del(&n->link);
16131634
ee->guc_capture_node = n;
16141635
ee->guc_capture = guc->capture;
1636+
guc_capture_find_ecode(ee);
16151637
return;
16161638
}
16171639
}

0 commit comments

Comments
 (0)