Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/tests: Convert xe_mocs live tests

Convert xe_mocs live tests to parameterized style.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240720142528.530-7-michal.wajdeczko@intel.com

+10 -4
+10 -4
drivers/gpu/drm/xe/tests/xe_mocs.c
··· 6 6 #include <kunit/test.h> 7 7 #include <kunit/visibility.h> 8 8 9 + #include "tests/xe_kunit_helpers.h" 9 10 #include "tests/xe_pci_test.h" 10 11 #include "tests/xe_test.h" 11 12 ··· 136 135 137 136 static void xe_live_mocs_kernel_kunit(struct kunit *test) 138 137 { 139 - xe_call_for_each_device(mocs_kernel_test_run_device); 138 + struct xe_device *xe = test->priv; 139 + 140 + mocs_kernel_test_run_device(xe); 140 141 } 141 142 142 143 static int mocs_reset_test_run_device(struct xe_device *xe) ··· 178 175 179 176 static void xe_live_mocs_reset_kunit(struct kunit *test) 180 177 { 181 - xe_call_for_each_device(mocs_reset_test_run_device); 178 + struct xe_device *xe = test->priv; 179 + 180 + mocs_reset_test_run_device(xe); 182 181 } 183 182 184 183 static struct kunit_case xe_mocs_tests[] = { 185 - KUNIT_CASE(xe_live_mocs_kernel_kunit), 186 - KUNIT_CASE(xe_live_mocs_reset_kunit), 184 + KUNIT_CASE_PARAM(xe_live_mocs_kernel_kunit, xe_pci_live_device_gen_param), 185 + KUNIT_CASE_PARAM(xe_live_mocs_reset_kunit, xe_pci_live_device_gen_param), 187 186 {} 188 187 }; 189 188 ··· 193 188 struct kunit_suite xe_mocs_test_suite = { 194 189 .name = "xe_mocs", 195 190 .test_cases = xe_mocs_tests, 191 + .init = xe_kunit_helper_xe_device_live_test_init, 196 192 }; 197 193 EXPORT_SYMBOL_IF_KUNIT(xe_mocs_test_suite);