Lines Matching full:gt

33 	struct intel_gt *gt;  member
41 static int hang_init(struct hang *h, struct intel_gt *gt) in hang_init() argument
47 h->gt = gt; in hang_init()
49 h->ctx = kernel_context(gt->i915, NULL); in hang_init()
55 h->hws = i915_gem_object_create_internal(gt->i915, PAGE_SIZE); in hang_init()
61 h->obj = i915_gem_object_create_internal(gt->i915, PAGE_SIZE); in hang_init()
76 intel_gt_coherent_map_type(gt, h->obj, false)); in hang_init()
106 struct intel_gt *gt = h->gt; in hang_create_request() local
116 obj = i915_gem_object_create_internal(gt->i915, PAGE_SIZE); in hang_create_request()
122 vaddr = i915_gem_object_pin_map_unlocked(obj, intel_gt_coherent_map_type(gt, obj, false)); in hang_create_request()
172 if (GRAPHICS_VER(gt->i915) >= 8) { in hang_create_request()
186 } else if (GRAPHICS_VER(gt->i915) >= 6) { in hang_create_request()
199 } else if (GRAPHICS_VER(gt->i915) >= 4) { in hang_create_request()
226 intel_gt_chipset_flush(engine->gt); in hang_create_request()
235 if (GRAPHICS_VER(gt->i915) <= 5) in hang_create_request()
261 intel_gt_chipset_flush(h->gt); in hang_fini()
271 igt_flush_test(h->gt->i915); in hang_fini()
286 struct intel_gt *gt = arg; in igt_hang_sanitycheck() local
295 err = hang_init(&h, gt); in igt_hang_sanitycheck()
299 for_each_engine(engine, gt, id) { in igt_hang_sanitycheck()
317 intel_gt_chipset_flush(engine->gt); in igt_hang_sanitycheck()
322 intel_wedge_on_timeout(&w, gt, HZ / 10 /* 100ms */) in igt_hang_sanitycheck()
325 if (intel_gt_is_wedged(gt)) in igt_hang_sanitycheck()
350 struct intel_gt *gt = arg; in igt_reset_nop() local
351 struct i915_gpu_error *global = &gt->i915->gpu_error; in igt_reset_nop()
363 for_each_engine(engine, gt, id) { in igt_reset_nop()
391 igt_global_reset_lock(gt); in igt_reset_nop()
392 intel_gt_reset(gt, ALL_ENGINES, NULL); in igt_reset_nop()
393 igt_global_reset_unlock(gt); in igt_reset_nop()
395 if (intel_gt_is_wedged(gt)) { in igt_reset_nop()
396 pr_err("[%s] GT is wedged!\n", engine->name); in igt_reset_nop()
408 err = igt_flush_test(gt->i915); in igt_reset_nop()
416 if (igt_flush_test(gt->i915)) { in igt_reset_nop()
426 struct intel_gt *gt = arg; in igt_reset_nop_engine() local
427 struct i915_gpu_error *global = &gt->i915->gpu_error; in igt_reset_nop_engine()
433 if (!intel_has_reset_engine(gt)) in igt_reset_nop_engine()
436 for_each_engine(engine, gt, id) { in igt_reset_nop_engine()
462 &gt->reset.flags)); in igt_reset_nop_engine()
479 drm_info_printer(gt->i915->drm.dev); in igt_reset_nop_engine()
490 intel_gt_set_wedged(gt); in igt_reset_nop_engine()
519 clear_and_wake_up_bit(I915_RESET_ENGINE + id, &gt->reset.flags); in igt_reset_nop_engine()
525 if (igt_flush_test(gt->i915)) in igt_reset_nop_engine()
547 struct intel_gt *gt = arg; in igt_reset_fail_engine() local
553 if (!intel_has_reset_engine(gt)) in igt_reset_fail_engine()
556 for_each_engine(engine, gt, id) { in igt_reset_fail_engine()
574 &gt->reset.flags)); in igt_reset_fail_engine()
600 drm_info_printer(gt->i915->drm.dev); in igt_reset_fail_engine()
611 intel_gt_set_wedged(gt); in igt_reset_fail_engine()
650 drm_info_printer(gt->i915->drm.dev); in igt_reset_fail_engine()
671 clear_and_wake_up_bit(I915_RESET_ENGINE + id, &gt->reset.flags); in igt_reset_fail_engine()
675 if (igt_flush_test(gt->i915)) in igt_reset_fail_engine()
684 static int __igt_reset_engine(struct intel_gt *gt, bool active) in __igt_reset_engine() argument
686 struct i915_gpu_error *global = &gt->i915->gpu_error; in __igt_reset_engine()
694 if (!intel_has_reset_engine(gt)) in __igt_reset_engine()
698 err = hang_init(&h, gt); in __igt_reset_engine()
703 for_each_engine(engine, gt, id) { in __igt_reset_engine()
727 &gt->reset.flags)); in __igt_reset_engine()
754 struct drm_printer p = drm_info_printer(gt->i915->drm.dev); in __igt_reset_engine()
817 clear_and_wake_up_bit(I915_RESET_ENGINE + id, &gt->reset.flags); in __igt_reset_engine()
825 err = igt_flush_test(gt->i915); in __igt_reset_engine()
832 if (intel_gt_is_wedged(gt)) { in __igt_reset_engine()
833 pr_err("GT is wedged!\n"); in __igt_reset_engine()
882 intel_gt_set_wedged(rq->engine->gt); in active_request_put()
962 static int __igt_reset_engines(struct intel_gt *gt, in __igt_reset_engines() argument
966 struct i915_gpu_error *global = &gt->i915->gpu_error; in __igt_reset_engines()
977 if (!intel_has_reset_engine(gt)) in __igt_reset_engines()
981 err = hang_init(&h, gt); in __igt_reset_engines()
993 for_each_engine(engine, gt, id) { in __igt_reset_engines()
1013 for_each_engine(other, gt, tmp) { in __igt_reset_engines()
1046 &gt->reset.flags)); in __igt_reset_engines()
1072 struct drm_printer p = drm_info_printer(gt->i915->drm.dev); in __igt_reset_engines()
1116 intel_gt_set_wedged(gt); in __igt_reset_engines()
1123 drm_info_printer(gt->i915->drm.dev); in __igt_reset_engines()
1135 intel_gt_set_wedged(gt); in __igt_reset_engines()
1148 drm_info_printer(gt->i915->drm.dev); in __igt_reset_engines()
1169 clear_and_wake_up_bit(I915_RESET_ENGINE + id, &gt->reset.flags); in __igt_reset_engines()
1188 for_each_engine(other, gt, tmp) { in __igt_reset_engines()
1231 err = igt_flush_test(gt->i915); in __igt_reset_engines()
1239 if (intel_gt_is_wedged(gt)) in __igt_reset_engines()
1268 struct intel_gt *gt = arg; in igt_reset_engines() local
1274 if (!(gt->i915->caps.scheduler & I915_SCHEDULER_CAP_PRIORITY)) in igt_reset_engines()
1286 static u32 fake_hangcheck(struct intel_gt *gt, intel_engine_mask_t mask) in fake_hangcheck() argument
1288 u32 count = i915_reset_count(&gt->i915->gpu_error); in fake_hangcheck()
1290 intel_gt_reset(gt, mask, NULL); in fake_hangcheck()
1297 struct intel_gt *gt = arg; in igt_reset_wait() local
1298 struct i915_gpu_error *global = &gt->i915->gpu_error; in igt_reset_wait()
1306 engine = intel_selftest_find_any_engine(gt); in igt_reset_wait()
1313 igt_global_reset_lock(gt); in igt_reset_wait()
1315 err = hang_init(&h, gt); in igt_reset_wait()
1332 struct drm_printer p = drm_info_printer(gt->i915->drm.dev); in igt_reset_wait()
1338 intel_gt_set_wedged(gt); in igt_reset_wait()
1344 reset_count = fake_hangcheck(gt, ALL_ENGINES); in igt_reset_wait()
1365 igt_global_reset_unlock(gt); in igt_reset_wait()
1367 if (intel_gt_is_wedged(gt)) in igt_reset_wait()
1426 static int __igt_reset_evict_vma(struct intel_gt *gt, in __igt_reset_evict_vma() argument
1440 if (!gt->ggtt->num_fences && flags & EXEC_OBJECT_NEEDS_FENCE) in __igt_reset_evict_vma()
1443 engine = intel_selftest_find_any_engine(gt); in __igt_reset_evict_vma()
1450 err = hang_init(&h, gt); in __igt_reset_evict_vma()
1456 obj = i915_gem_object_create_internal(gt->i915, SZ_1M); in __igt_reset_evict_vma()
1521 struct drm_printer p = drm_info_printer(gt->i915->drm.dev); in __igt_reset_evict_vma()
1527 intel_gt_set_wedged(gt); in __igt_reset_evict_vma()
1545 struct drm_printer p = drm_info_printer(gt->i915->drm.dev); in __igt_reset_evict_vma()
1550 intel_gt_set_wedged(gt); in __igt_reset_evict_vma()
1555 igt_global_reset_lock(gt); in __igt_reset_evict_vma()
1556 fake_hangcheck(gt, rq->engine->mask); in __igt_reset_evict_vma()
1557 igt_global_reset_unlock(gt); in __igt_reset_evict_vma()
1563 intel_wedge_on_timeout(&w, gt, HZ / 10 /* 100ms */) in __igt_reset_evict_vma()
1575 if (intel_gt_is_wedged(gt)) in __igt_reset_evict_vma()
1583 struct intel_gt *gt = arg; in igt_reset_evict_ggtt() local
1585 return __igt_reset_evict_vma(gt, &gt->ggtt->vm, in igt_reset_evict_ggtt()
1591 struct intel_gt *gt = arg; in igt_reset_evict_ppgtt() local
1596 if (INTEL_PPGTT(gt->i915) < INTEL_PPGTT_FULL) in igt_reset_evict_ppgtt()
1599 ppgtt = i915_ppgtt_create(gt, 0); in igt_reset_evict_ppgtt()
1603 err = __igt_reset_evict_vma(gt, &ppgtt->vm, in igt_reset_evict_ppgtt()
1612 struct intel_gt *gt = arg; in igt_reset_evict_fence() local
1614 return __igt_reset_evict_vma(gt, &gt->ggtt->vm, in igt_reset_evict_fence()
1618 static int wait_for_others(struct intel_gt *gt, in wait_for_others() argument
1624 for_each_engine(engine, gt, id) { in wait_for_others()
1637 struct intel_gt *gt = arg; in igt_reset_queue() local
1638 struct i915_gpu_error *global = &gt->i915->gpu_error; in igt_reset_queue()
1646 igt_global_reset_lock(gt); in igt_reset_queue()
1648 err = hang_init(&h, gt); in igt_reset_queue()
1652 for_each_engine(engine, gt, id) { in igt_reset_queue()
1706 err = wait_for_others(gt, engine); in igt_reset_queue()
1714 intel_gt_set_wedged(gt); in igt_reset_queue()
1719 struct drm_printer p = drm_info_printer(gt->i915->drm.dev); in igt_reset_queue()
1730 intel_gt_set_wedged(gt); in igt_reset_queue()
1736 reset_count = fake_hangcheck(gt, BIT(id)); in igt_reset_queue()
1772 intel_gt_chipset_flush(engine->gt); in igt_reset_queue()
1789 err = igt_flush_test(gt->i915); in igt_reset_queue()
1799 igt_global_reset_unlock(gt); in igt_reset_queue()
1801 if (intel_gt_is_wedged(gt)) in igt_reset_queue()
1809 struct intel_gt *gt = arg; in igt_handle_error() local
1810 struct i915_gpu_error *global = &gt->i915->gpu_error; in igt_handle_error()
1817 engine = intel_selftest_find_any_engine(gt); in igt_handle_error()
1821 if (!intel_has_reset_engine(gt)) in igt_handle_error()
1827 err = hang_init(&h, gt); in igt_handle_error()
1844 struct drm_printer p = drm_info_printer(gt->i915->drm.dev); in igt_handle_error()
1850 intel_gt_set_wedged(gt); in igt_handle_error()
1859 intel_gt_handle_error(gt, engine->mask, 0, NULL); in igt_handle_error()
1920 err = hang_init(&h, engine->gt); in igt_atomic_reset_engine()
1942 intel_gt_set_wedged(engine->gt); in igt_atomic_reset_engine()
1949 intel_wedge_on_timeout(&w, engine->gt, HZ / 20 /* 50ms */) in igt_atomic_reset_engine()
1951 if (intel_gt_is_wedged(engine->gt)) in igt_atomic_reset_engine()
1963 struct intel_gt *gt = arg; in igt_reset_engines_atomic() local
1969 if (!intel_has_reset_engine(gt)) in igt_reset_engines_atomic()
1972 if (intel_uc_uses_guc_submission(&gt->uc)) in igt_reset_engines_atomic()
1975 igt_global_reset_lock(gt); in igt_reset_engines_atomic()
1978 if (!igt_force_reset(gt)) in igt_reset_engines_atomic()
1985 for_each_engine(engine, gt, id) { in igt_reset_engines_atomic()
1994 igt_force_reset(gt); in igt_reset_engines_atomic()
1996 igt_global_reset_unlock(gt); in igt_reset_engines_atomic()
2019 struct intel_gt *gt = to_gt(i915); in intel_hangcheck_live_selftests() local
2023 if (!intel_has_gpu_reset(gt)) in intel_hangcheck_live_selftests()
2026 if (intel_gt_is_wedged(gt)) in intel_hangcheck_live_selftests()
2029 wakeref = intel_runtime_pm_get(gt->uncore->rpm); in intel_hangcheck_live_selftests()
2031 err = intel_gt_live_subtests(tests, gt); in intel_hangcheck_live_selftests()
2033 intel_runtime_pm_put(gt->uncore->rpm, wakeref); in intel_hangcheck_live_selftests()