[Intel-xe] [PATCH 0/7] Unit tests for rtp and GT wa/tuning

Lucas De Marchi lucas.demarchi at intel.com
Tue Mar 21 22:05:20 UTC 2023


Add tests for the RTP infra and for the GT workaround/tuning
programming, while building the unit test infra to be able to test with
fake devices. This supersedes previous patch with only the rtp
tests (https://lore.kernel.org/intel-xe/20230316210341.3547058-1-lucas.demarchi@intel.com/T/#m1fd17b976409805f74aaeb565a441d7d63e0553d)

Notes:

- I debated a little bit whether we should use "mock" or "fake" to name
  these helpers for running without real hardware.  Here it's using
  "fake" since it's not a proper mock framework, and it seems to be what
  kunit itself uses in the documentation and examples.
- The tests themselves are "unit tests", for the
  software part, testing the implementation for the rtp,
  reg-save-restore and WA infrastructure.
- Last patch is the big improvement functonality-wise, which will help
  us detect wrong updates in the workaround tables, without running in
  real hardware.  That patches should be followed up with similar ones
  for the other WAs: engine and LRC.

Lucas De Marchi (7):
  drm/xe: Add basic unit tests for rtp
  drm/xe: Extract function to initialize xe->info
  drm/xe: Move test infra out of xe_pci.[ch]
  drm/xe: Use XE_KUNIT for symbol namespace
  drm/xe: Generalize fake device creation
  drm/xe/reg_sr: Save errors for kunit integration
  drm/xe: Add test for GT workarounds and tunings

 drivers/gpu/drm/xe/Kconfig.debug           |   1 +
 drivers/gpu/drm/xe/tests/Makefile          |   8 +-
 drivers/gpu/drm/xe/tests/xe_bo.c           |   6 +-
 drivers/gpu/drm/xe/tests/xe_bo_test.c      |   1 +
 drivers/gpu/drm/xe/tests/xe_dma_buf.c      |   3 +-
 drivers/gpu/drm/xe/tests/xe_dma_buf_test.c |   1 +
 drivers/gpu/drm/xe/tests/xe_migrate.c      |   3 +-
 drivers/gpu/drm/xe/tests/xe_migrate_test.c |   1 +
 drivers/gpu/drm/xe/tests/xe_pci.c          | 108 +++++++++++
 drivers/gpu/drm/xe/tests/xe_pci_test.h     |  31 ++++
 drivers/gpu/drm/xe/tests/xe_rtp.c          | 201 +++++++++++++++++++++
 drivers/gpu/drm/xe/tests/xe_rtp_test.c     |  64 +++++++
 drivers/gpu/drm/xe/tests/xe_rtp_test.h     |  15 ++
 drivers/gpu/drm/xe/tests/xe_wa_test.c      | 136 ++++++++++++++
 drivers/gpu/drm/xe/xe_pci.c                | 150 ++++++---------
 drivers/gpu/drm/xe/xe_pci.h                |   9 -
 drivers/gpu/drm/xe/xe_reg_sr.c             |   9 +
 drivers/gpu/drm/xe/xe_reg_sr_types.h       |   4 +
 drivers/gpu/drm/xe/xe_rtp.c                |   4 +
 drivers/gpu/drm/xe/xe_tuning.c             |   1 +
 drivers/gpu/drm/xe/xe_wa.c                 |   1 +
 21 files changed, 647 insertions(+), 110 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/tests/xe_pci.c
 create mode 100644 drivers/gpu/drm/xe/tests/xe_pci_test.h
 create mode 100644 drivers/gpu/drm/xe/tests/xe_rtp.c
 create mode 100644 drivers/gpu/drm/xe/tests/xe_rtp_test.c
 create mode 100644 drivers/gpu/drm/xe/tests/xe_rtp_test.h
 create mode 100644 drivers/gpu/drm/xe/tests/xe_wa_test.c

-- 
2.39.0



More information about the Intel-xe mailing list