mirror-linux/drivers/gpu/drm/xe/tests
Lucas De Marchi cedf23842d drm/xe/rtp: Drop sentinels from arg to xe_rtp_process_to_sr()
There's a mismatch on API: while xe_rtp_process_to_sr() processes
entries until an entry without name, the active tracking with
xe_rtp_process_ctx_enable_active_tracking() needs to use the number of
elements. The number of elements is taken everywhere using ARRAY_SIZE(),
but that will have one entry too many. This leads to the following
warning, as reported by lkp:

   drivers/gpu/drm/xe/xe_tuning.c: In function 'xe_tuning_dump':
>> include/drm/drm_print.h:228:31: warning: '%s' directive argument is null [-Wformat-overflow=]
     228 |         drm_printf((printer), "%.*s" fmt, (indent), "\t\t\t\t\tX", ##__VA_ARGS__)
         |                               ^~~~~~
   drivers/gpu/drm/xe/xe_tuning.c:226:17: note: in expansion of macro 'drm_printf_indent'
     226 |                 drm_printf_indent(p, 1, "%s\n", engine_tunings[idx].name);
         |                 ^~~~~~~~~~~~~~~~~

That's because it will still process the last entry when tracking the
active tunings. The same issue exists in the WAs. Change
xe_rtp_process_to_sr() to also take the number of elements so the empty
entry can be removed and the warning should go away. Fixing on the
active-tracking side would more fragile as the it would need a `- 1`
everywhere and continue to use a different approach for number of
elements.

Aside from the warning, it's a non-issue as there would always be enough
bits allocated and the last entry would never be active since
xe_rtp_process_to_sr() stops on the sentinel.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202503021906.P2MwAvyK-lkp@intel.com/
Cc: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250306-fix-print-warning-v1-1-979c3dc03c0d@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
(cherry picked from commit 8aa8c2d421)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2025-03-12 20:54:17 -07:00
..
Makefile
xe_args_test.c
xe_bo.c drm/xe: Add a shrinker for xe bos 2025-03-05 17:08:59 +01:00
xe_dma_buf.c
xe_gt_sriov_pf_service_test.c
xe_guc_buf_kunit.c drm/xe/kunit: Add KUnit tests for GuC Buffer Cache 2025-01-19 00:12:07 +01:00
xe_guc_db_mgr_test.c
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/tests: Move shrink test out of xe_bo 2024-12-19 13:51:46 +01:00
xe_lmtt_test.c
xe_migrate.c drm/xe: fix the ERR_PTR() returned on failure to allocate tiny pt 2024-12-12 16:57:28 +01:00
xe_mocs.c drm next for 6.14-rc1 2025-01-21 16:09:47 -08:00
xe_pci.c drm/xe: Convert pre-GMDID IPs to struct xe_ip 2025-03-05 12:17:00 -08:00
xe_pci_test.c
xe_pci_test.h
xe_rtp_test.c drm/xe/rtp: Drop sentinels from arg to xe_rtp_process_to_sr() 2025-03-12 20:54:17 -07:00
xe_test.h
xe_test_mod.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
xe_wa_test.c