linux/drivers/gpu/drm/xe/tests
Gustavo Sousa e23fafb859 drm/xe/rtp: Add struct types for RTP tables
We currently have a mixture of styles for our RTP tables with respect of
how we define the number of entries:

  * xe_rtp_process_to_sr() expects to receive the number of entries as
    arguments;
  * xe_rtp_process() expects the array to have a sentinel at the end of
    the array;
  * in xe_rtp_test.c, even though xe_rtp_process_to_sr() does not
    require a sentinel value, we need to rely on that technique to be
    able to count xe_rtp_entry_sr entries because simply using
    ARRAY_SIZE() is not possible.

The style used by xe_rtp_process_to_sr() makes it hard to share the
tables with other compilation units (e.g. kunit tests), since the number
of entries is calculated with ARRAY_SIZE(), which is done at compile
time.

Since we use the size of the tables to create some bitmasks, using a
sentinel style doesn't seem great either.

A way to reconcile things into a single style is to have a struct type
that would hold the entries array and the number of entries.  Since we
have xe_rtp_entry and xe_rtp_entry_sr, we would have one type for each.

The advantage of the proposed approach is that now we have a nice way to
share the tables directly to kunit tests with information about their
size.

v6:
    - Removed sentinels that are not needed

v5:
    - Removed added code from conflict resolution issues

v4:
    - Removed conflicts with main branch

v3:
    - No changes

v2:
    - Add compatibility with new xe_rtp_table_sr format for
      "bad-mcr-reg-forced-to-regular" and
      "bad-regular-reg-forced-to-mcr"

Fixes: 828a8eaf37 ("drm/xe/oa: Add MMIO trigger support")
Cc: stable@vger.kernel.org # v6.12+
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Signed-off-by: Violet Monti <violet.monti@intel.com>
Link: https://patch.msgid.link/20260601200947.2032784-7-violet.monti@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit 5ff004fdc7)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
2026-07-01 21:48:36 +02:00
..
Makefile
xe_args_test.c drm/xe: Introduce IF_ARGS macro utility 2025-12-17 23:42:40 +01:00
xe_bo.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xe_dma_buf.c Merge drm/drm-next into drm-misc-next 2026-02-05 10:33:06 +01:00
xe_gt_sriov_pf_config_kunit.c drm/xe/pf: Derive admin-only PF mode from xe_device state 2026-04-14 12:38:16 +02:00
xe_guc_buf_kunit.c drm/xe: Make xe_ggtt_node_insert return a node 2026-02-16 14:20:24 +01:00
xe_guc_db_mgr_test.c
xe_guc_g2g_test.c drm/xe/tests: Fix g2g_test_array indexing 2026-02-05 14:10:22 -08:00
xe_guc_id_mgr_test.c
xe_guc_relay_test.c
xe_kunit_helpers.c
xe_kunit_helpers.h
xe_live_test_mod.c drm/xe/guc: Add test for G2G communications 2025-09-15 09:53:26 -07:00
xe_lmtt_test.c
xe_migrate.c drm/xe: Refactor emit_xy_fast_copy and emit_mem_copy functions 2026-05-13 12:21:12 +05:30
xe_mocs.c drm/xe/tests: Use scope-based runtime PM 2025-11-19 11:58:58 -08:00
xe_pci_test.c drm/xe: Move number of XeCore fuse registers to graphics descriptor 2026-02-06 09:49:20 -08:00
xe_pci_test.h drm next for 6.18-rc1 2025-10-02 12:47:25 -07:00
xe_pci.c drm/xe: Move xe->info.devid|revid initialization 2026-05-27 12:51:25 +02:00
xe_rtp_test.c drm/xe/rtp: Add struct types for RTP tables 2026-07-01 21:48:36 +02:00
xe_rtp_test.h drm/xe/rtp: Write kunit test cases specific for rule matching 2026-05-22 10:52:29 -03:00
xe_rtp.c drm/xe/rtp: Write kunit test cases specific for rule matching 2026-05-22 10:52:29 -03:00
xe_sriov_pf_service_kunit.c drm/xe/pf: Stop requiring VF/PF version negotiation on every GT 2025-07-14 18:19:31 +02:00
xe_test_mod.c
xe_test.h
xe_wa_test.c drm/xe/reg_sr: Do sanity check for MCR vs non-MCR 2026-05-15 18:05:14 -03:00