In the node i915_wa_registers, we could print out
more information with whitelist, GT workaround and
engine workaround.

In addition, fix the warning by checkpatch.pl:
WARNING: Prefer seq_puts to seq_printf

Signed-off-by: Chuansheng Liu <[email protected]>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 60 ++++++++++++++++++++++++++++-
 1 file changed, 58 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 8f2525e4ce0f..d4d9e0396d71 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1836,7 +1836,7 @@ static int i915_wa_registers(struct seq_file *m, void 
*unused)
                if (!count)
                        continue;
 
-               seq_printf(m, "%s: Workarounds applied: %u\n",
+               seq_printf(m, "%s: context workarounds applied: %u\n",
                           engine->name, count);
 
                for (wa = wal->list; count--; wa++)
@@ -1844,9 +1844,65 @@ static int i915_wa_registers(struct seq_file *m, void 
*unused)
                                   i915_mmio_reg_offset(wa->reg),
                                   wa->set, wa->clr);
 
-               seq_printf(m, "\n");
+               seq_puts(m, "\n");
        }
 
+       for_each_uabi_engine(engine, i915) {
+               const struct i915_wa_list *wal = &engine->whitelist;
+               const struct i915_wa *wa;
+               unsigned int count;
+
+               count = wal->count;
+               if (!count)
+                       continue;
+
+               seq_printf(m, "%s: whitelist applied: %u\n",
+                          engine->name, count);
+
+               for (wa = wal->list; count--; wa++)
+                       seq_printf(m, "0x%X: 0x%08X, mask: 0x%08X\n",
+                                  i915_mmio_reg_offset(wa->reg),
+                                  wa->set, wa->clr);
+
+               seq_puts(m, "\n");
+       }
+
+       {
+               const struct i915_wa_list *wal = &i915->gt_wa_list;
+               const struct i915_wa *wa;
+               unsigned int count;
+
+               count = wal->count;
+               if (count) {
+                       seq_printf(m, "gt workarounds applied: %u\n", count);
+
+                       for (wa = wal->list; count--; wa++)
+                               seq_printf(m, "0x%X: 0x%08X, mask: 0x%08X\n",
+                                          i915_mmio_reg_offset(wa->reg),
+                                          wa->set, wa->clr);
+               }
+               seq_puts(m, "\n");
+       }
+
+       for_each_uabi_engine(engine, i915) {
+               const struct i915_wa_list *wal = &engine->wa_list;
+               const struct i915_wa *wa;
+               unsigned int count;
+
+               count = wal->count;
+               if (!count)
+                       continue;
+
+               seq_printf(m, "%s: workaround list applied: %u\n",
+                          engine->name, count);
+
+               for (wa = wal->list; count--; wa++)
+                       seq_printf(m, "0x%X: 0x%08X, mask: 0x%08X\n",
+                                  i915_mmio_reg_offset(wa->reg),
+                                  wa->set, wa->clr);
+
+               seq_puts(m, "\n");
+       }
        return 0;
 }
 
-- 
2.25.0.rc2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to