drm/i915: add extra slice common debug registers
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 29 Jan 2020 18:16:38 +0000 (20:16 +0200)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 30 Jan 2020 00:51:31 +0000 (00:51 +0000)
Could be helpful for debugging purposes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200129181638.1528150-1-lionel.g.landwerlin@intel.com
drivers/gpu/drm/i915/gt/intel_engine_cs.c
drivers/gpu/drm/i915/gt/intel_engine_types.h
drivers/gpu/drm/i915/i915_gpu_error.c
drivers/gpu/drm/i915/i915_reg.h

index 39fe9a5b4820a4e44c5d201beb2a8d1e0b610953..8707d7264490bbf793abe1080a5844c325621d55 100644 (file)
@@ -999,6 +999,12 @@ void intel_engine_get_instdone(const struct intel_engine_cs *engine,
 
                instdone->slice_common =
                        intel_uncore_read(uncore, GEN7_SC_INSTDONE);
+               if (INTEL_GEN(i915) >= 12) {
+                       instdone->slice_common_extra[0] =
+                               intel_uncore_read(uncore, GEN12_SC_INSTDONE_EXTRA);
+                       instdone->slice_common_extra[1] =
+                               intel_uncore_read(uncore, GEN12_SC_INSTDONE_EXTRA2);
+               }
                for_each_instdone_slice_subslice(i915, sseu, slice, subslice) {
                        instdone->sampler[slice][subslice] =
                                read_subslice_reg(engine, slice, subslice,
index abd1de3b83a896ebb92556047acfc1f5c6eacfc3..45e36d963ea7b508e2fcfab4650261167cf2aa37 100644 (file)
@@ -75,6 +75,7 @@ struct intel_instdone {
        u32 instdone;
        /* The following exist only in the RCS engine */
        u32 slice_common;
+       u32 slice_common_extra[2];
        u32 sampler[I915_MAX_SLICES][I915_MAX_SUBSLICES];
        u32 row[I915_MAX_SLICES][I915_MAX_SUBSLICES];
 };
index dcab4723b17d8ca46d2ca13b33e9e033dfd69448..5a1517d0bf3bd77c6adf4d44d51b2b5537491a75 100644 (file)
@@ -450,6 +450,14 @@ static void error_print_instdone(struct drm_i915_error_state_buf *m,
                err_printf(m, "  ROW_INSTDONE[%d][%d]: 0x%08x\n",
                           slice, subslice,
                           ee->instdone.row[slice][subslice]);
+
+       if (INTEL_GEN(m->i915) < 12)
+               return;
+
+       err_printf(m, "  SC_INSTDONE_EXTRA: 0x%08x\n",
+                  ee->instdone.slice_common_extra[0]);
+       err_printf(m, "  SC_INSTDONE_EXTRA2: 0x%08x\n",
+                  ee->instdone.slice_common_extra[1]);
 }
 
 static void error_print_request(struct drm_i915_error_state_buf *m,
index 4c72b8ac0f2e6ad304c6754e5d0b87eadf117830..639c3a10cfa34bfbae1c7ffe6a3f1649e272e711 100644 (file)
@@ -2626,6 +2626,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define IPEIR_I965     _MMIO(0x2064)
 #define IPEHR_I965     _MMIO(0x2068)
 #define GEN7_SC_INSTDONE       _MMIO(0x7100)
+#define GEN12_SC_INSTDONE_EXTRA                _MMIO(0x7104)
+#define GEN12_SC_INSTDONE_EXTRA2       _MMIO(0x7108)
 #define GEN7_SAMPLER_INSTDONE  _MMIO(0xe160)
 #define GEN7_ROW_INSTDONE      _MMIO(0xe164)
 #define GEN8_MCR_SELECTOR              _MMIO(0xfdc)