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

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe/tests: Use scope-based runtime PM

Use scope-based handling of runtime PM in the kunit tests for
consistency with other parts of the driver.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patch.msgid.link/20251118164338.3572146-54-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>

+7 -26
+2 -8
drivers/gpu/drm/xe/tests/xe_bo.c
··· 185 185 return 0; 186 186 } 187 187 188 - xe_pm_runtime_get(xe); 189 - 188 + guard(xe_pm_runtime)(xe); 190 189 for_each_tile(tile, xe, id) { 191 190 /* For igfx run only for primary tile */ 192 191 if (!IS_DGFX(xe) && id > 0) 193 192 continue; 194 193 ccs_test_run_tile(xe, tile, test); 195 194 } 196 - 197 - xe_pm_runtime_put(xe); 198 195 199 196 return 0; 200 197 } ··· 353 356 return 0; 354 357 } 355 358 356 - xe_pm_runtime_get(xe); 357 - 359 + guard(xe_pm_runtime)(xe); 358 360 for_each_tile(tile, xe, id) 359 361 evict_test_run_tile(xe, tile, test); 360 - 361 - xe_pm_runtime_put(xe); 362 362 363 363 return 0; 364 364 }
+1 -2
drivers/gpu/drm/xe/tests/xe_dma_buf.c
··· 266 266 const struct dma_buf_test_params *params; 267 267 struct kunit *test = kunit_get_current_test(); 268 268 269 - xe_pm_runtime_get(xe); 269 + guard(xe_pm_runtime)(xe); 270 270 for (params = test_params; params->mem_mask; ++params) { 271 271 struct dma_buf_test_params p = *params; 272 272 ··· 274 274 test->priv = &p; 275 275 xe_test_dmabuf_import_same_driver(xe); 276 276 } 277 - xe_pm_runtime_put(xe); 278 277 279 278 /* A non-zero return would halt iteration over driver devices */ 280 279 return 0;
+2 -8
drivers/gpu/drm/xe/tests/xe_migrate.c
··· 344 344 struct xe_tile *tile; 345 345 int id; 346 346 347 - xe_pm_runtime_get(xe); 348 - 347 + guard(xe_pm_runtime)(xe); 349 348 for_each_tile(tile, xe, id) { 350 349 struct xe_migrate *m = tile->migrate; 351 350 struct drm_exec *exec = XE_VALIDATION_OPT_OUT; ··· 354 355 xe_migrate_sanity_test(m, test, exec); 355 356 xe_vm_unlock(m->q->vm); 356 357 } 357 - 358 - xe_pm_runtime_put(xe); 359 358 360 359 return 0; 361 360 } ··· 756 759 return 0; 757 760 } 758 761 759 - xe_pm_runtime_get(xe); 760 - 762 + guard(xe_pm_runtime)(xe); 761 763 for_each_tile(tile, xe, id) 762 764 validate_ccs_test_run_tile(xe, tile, test); 763 - 764 - xe_pm_runtime_put(xe); 765 765 766 766 return 0; 767 767 }
+2 -8
drivers/gpu/drm/xe/tests/xe_mocs.c
··· 115 115 unsigned int flags; 116 116 int id; 117 117 118 - xe_pm_runtime_get(xe); 119 - 118 + guard(xe_pm_runtime)(xe); 120 119 for_each_gt(gt, xe, id) { 121 120 flags = live_mocs_init(&mocs, gt); 122 121 if (flags & HAS_GLOBAL_MOCS) ··· 123 124 if (flags & HAS_LNCF_MOCS) 124 125 read_l3cc_table(gt, &mocs.table); 125 126 } 126 - 127 - xe_pm_runtime_put(xe); 128 127 129 128 return 0; 130 129 } ··· 147 150 int id; 148 151 struct kunit *test = kunit_get_current_test(); 149 152 150 - xe_pm_runtime_get(xe); 151 - 153 + guard(xe_pm_runtime)(xe); 152 154 for_each_gt(gt, xe, id) { 153 155 flags = live_mocs_init(&mocs, gt); 154 156 kunit_info(test, "mocs_reset_test before reset\n"); ··· 164 168 if (flags & HAS_LNCF_MOCS) 165 169 read_l3cc_table(gt, &mocs.table); 166 170 } 167 - 168 - xe_pm_runtime_put(xe); 169 171 170 172 return 0; 171 173 }