Lines Matching full:engine

131 hang_create_request(struct hang *h, struct intel_engine_cs *engine)  in hang_create_request()  argument
134 struct i915_address_space *vm = h->ctx->vm ?: &engine->gt->ggtt->vm; in hang_create_request()
175 rq = igt_request_alloc(h->ctx, engine); in hang_create_request()
244 intel_gt_chipset_flush(engine->gt); in hang_create_request()
246 if (rq->engine->emit_init_breadcrumb) { in hang_create_request()
247 err = rq->engine->emit_init_breadcrumb(rq); in hang_create_request()
256 err = rq->engine->emit_bb_start(rq, vma->node.start, PAGE_SIZE, flags); in hang_create_request()
305 struct intel_engine_cs *engine; in igt_hang_sanitycheck() local
317 for_each_engine(engine, gt->i915, id) { in igt_hang_sanitycheck()
321 if (!intel_engine_can_store_dword(engine)) in igt_hang_sanitycheck()
324 rq = hang_create_request(&h, engine); in igt_hang_sanitycheck()
328 engine->name, err); in igt_hang_sanitycheck()
335 intel_gt_chipset_flush(engine->gt); in igt_hang_sanitycheck()
351 engine->name, err); in igt_hang_sanitycheck()
363 static bool wait_for_idle(struct intel_engine_cs *engine) in wait_for_idle() argument
365 return wait_for(intel_engine_is_idle(engine), IGT_IDLE_TIMEOUT) == 0; in wait_for_idle()
372 struct intel_engine_cs *engine; in igt_reset_nop() local
400 for_each_engine(engine, gt->i915, id) { in igt_reset_nop()
406 rq = igt_request_alloc(ctx, engine); in igt_reset_nop()
453 struct intel_engine_cs *engine; in igt_reset_nop_engine() local
459 /* Check that we can engine-reset during non-user portions */ in igt_reset_nop_engine()
477 for_each_engine(engine, gt->i915, id) { in igt_reset_nop_engine()
483 reset_engine_count = i915_reset_engine_count(global, engine); in igt_reset_nop_engine()
490 if (!wait_for_idle(engine)) { in igt_reset_nop_engine()
492 engine->name); in igt_reset_nop_engine()
501 rq = igt_request_alloc(ctx, engine); in igt_reset_nop_engine()
509 err = intel_engine_reset(engine, NULL); in igt_reset_nop_engine()
517 pr_err("Full GPU reset recorded! (engine reset expected)\n"); in igt_reset_nop_engine()
522 if (i915_reset_engine_count(global, engine) != in igt_reset_nop_engine()
524 pr_err("%s engine reset not recorded!\n", in igt_reset_nop_engine()
525 engine->name); in igt_reset_nop_engine()
531 pr_info("%s(%s): %d resets\n", __func__, engine->name, count); in igt_reset_nop_engine()
555 struct intel_engine_cs *engine; in __igt_reset_engine() local
560 /* Check that we can issue an engine reset on an idle engine (no-op) */ in __igt_reset_engine()
573 for_each_engine(engine, gt->i915, id) { in __igt_reset_engine()
577 if (active && !intel_engine_can_store_dword(engine)) in __igt_reset_engine()
580 if (!wait_for_idle(engine)) { in __igt_reset_engine()
582 engine->name); in __igt_reset_engine()
588 reset_engine_count = i915_reset_engine_count(global, engine); in __igt_reset_engine()
590 intel_engine_pm_get(engine); in __igt_reset_engine()
597 rq = hang_create_request(&h, engine); in __igt_reset_engine()
613 intel_engine_dump(engine, &p, in __igt_reset_engine()
614 "%s\n", engine->name); in __igt_reset_engine()
624 err = intel_engine_reset(engine, NULL); in __igt_reset_engine()
631 pr_err("Full GPU reset recorded! (engine reset expected)\n"); in __igt_reset_engine()
636 if (i915_reset_engine_count(global, engine) != in __igt_reset_engine()
638 pr_err("%s engine reset not recorded!\n", in __igt_reset_engine()
639 engine->name); in __igt_reset_engine()
645 intel_engine_pm_put(engine); in __igt_reset_engine()
679 struct intel_engine_cs *engine; member
698 rq->engine->name, in active_request_put()
703 intel_gt_set_wedged(rq->engine->gt); in active_request_put()
716 struct intel_engine_cs *engine = arg->engine; in active_engine() local
723 file = mock_file(engine->i915); in active_engine()
728 mutex_lock(&engine->i915->drm.struct_mutex); in active_engine()
729 ctx[count] = live_context(engine->i915, file); in active_engine()
730 mutex_unlock(&engine->i915->drm.struct_mutex); in active_engine()
744 mutex_lock(&engine->i915->drm.struct_mutex); in active_engine()
745 new = igt_request_alloc(ctx[idx], engine); in active_engine()
747 mutex_unlock(&engine->i915->drm.struct_mutex); in active_engine()
758 mutex_unlock(&engine->i915->drm.struct_mutex); in active_engine()
776 mock_file_free(engine->i915, file); in active_engine()
785 struct intel_engine_cs *engine, *other; in __igt_reset_engines() local
790 /* Check that issuing a reset on one engine does not interfere in __igt_reset_engines()
791 * with any other engine. in __igt_reset_engines()
808 for_each_engine(engine, gt->i915, id) { in __igt_reset_engines()
815 !intel_engine_can_store_dword(engine)) in __igt_reset_engines()
818 if (!wait_for_idle(engine)) { in __igt_reset_engines()
820 engine->name, test_name); in __igt_reset_engines()
835 if (other == engine && !(flags & TEST_SELF)) in __igt_reset_engines()
838 threads[tmp].engine = other; in __igt_reset_engines()
852 intel_engine_pm_get(engine); in __igt_reset_engines()
859 rq = hang_create_request(&h, engine); in __igt_reset_engines()
875 intel_engine_dump(engine, &p, in __igt_reset_engines()
876 "%s\n", engine->name); in __igt_reset_engines()
884 err = intel_engine_reset(engine, NULL); in __igt_reset_engines()
887 engine->name, test_name, err); in __igt_reset_engines()
900 engine->name, test_name); in __igt_reset_engines()
901 intel_engine_dump(engine, &p, in __igt_reset_engines()
902 "%s\n", engine->name); in __igt_reset_engines()
914 if (!(flags & TEST_SELF) && !wait_for_idle(engine)) { in __igt_reset_engines()
920 engine->name, test_name); in __igt_reset_engines()
921 intel_engine_dump(engine, &p, in __igt_reset_engines()
922 "%s\n", engine->name); in __igt_reset_engines()
929 intel_engine_pm_put(engine); in __igt_reset_engines()
931 engine->name, test_name, count); in __igt_reset_engines()
933 reported = i915_reset_engine_count(global, engine); in __igt_reset_engines()
934 reported -= threads[engine->id].resets; in __igt_reset_engines()
937 engine->name, test_name, count, reported); in __igt_reset_engines()
951 pr_err("kthread for other engine %s failed, err=%d\n", in __igt_reset_engines()
958 if (other->uabi_class != engine->uabi_class && in __igt_reset_engines()
961 pr_err("Innocent engine %s was reset (count=%ld)\n", in __igt_reset_engines()
1050 struct intel_engine_cs *engine = gt->i915->engine[RCS0]; in igt_reset_wait() local
1057 if (!engine || !intel_engine_can_store_dword(engine)) in igt_reset_wait()
1069 rq = hang_create_request(&h, engine); in igt_reset_wait()
1083 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in igt_reset_wait()
1186 struct intel_engine_cs *engine = gt->i915->engine[RCS0]; in __igt_reset_evict_vma() local
1194 if (!engine || !intel_engine_can_store_dword(engine)) in __igt_reset_evict_vma()
1224 rq = hang_create_request(&h, engine); in __igt_reset_evict_vma()
1272 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in __igt_reset_evict_vma()
1294 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in __igt_reset_evict_vma()
1302 fake_hangcheck(gt, rq->engine->mask); in __igt_reset_evict_vma()
1379 struct intel_engine_cs *engine; in wait_for_others() local
1382 for_each_engine(engine, gt->i915, id) { in wait_for_others()
1383 if (engine == exclude) in wait_for_others()
1386 if (!wait_for_idle(engine)) in wait_for_others()
1397 struct intel_engine_cs *engine; in igt_reset_queue() local
1411 for_each_engine(engine, gt->i915, id) { in igt_reset_queue()
1416 if (!intel_engine_can_store_dword(engine)) in igt_reset_queue()
1419 prev = hang_create_request(&h, engine); in igt_reset_queue()
1433 rq = hang_create_request(&h, engine); in igt_reset_queue()
1450 * engine and so avoid repeatedly resetting innocents. in igt_reset_queue()
1452 err = wait_for_others(gt, engine); in igt_reset_queue()
1455 __func__, engine->name); in igt_reset_queue()
1468 __func__, engine->name, in igt_reset_queue()
1470 intel_engine_dump(engine, &p, in igt_reset_queue()
1471 "%s\n", engine->name); in igt_reset_queue()
1514 pr_info("%s: Completed %d resets\n", engine->name, count); in igt_reset_queue()
1517 intel_gt_chipset_flush(engine->gt); in igt_reset_queue()
1542 struct intel_engine_cs *engine = gt->i915->engine[RCS0]; in igt_handle_error() local
1548 /* Check that we can issue a global GPU and engine reset */ in igt_handle_error()
1553 if (!engine || !intel_engine_can_store_dword(engine)) in igt_handle_error()
1562 rq = hang_create_request(&h, engine); in igt_handle_error()
1576 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in igt_handle_error()
1589 intel_gt_handle_error(gt, engine->mask, 0, NULL); in igt_handle_error()
1610 static int __igt_atomic_reset_engine(struct intel_engine_cs *engine, in __igt_atomic_reset_engine() argument
1614 struct tasklet_struct * const t = &engine->execlists.tasklet; in __igt_atomic_reset_engine()
1618 engine->name, mode, p->name); in __igt_atomic_reset_engine()
1623 err = intel_engine_reset(engine, NULL); in __igt_atomic_reset_engine()
1630 engine->name, mode, p->name); in __igt_atomic_reset_engine()
1635 static int igt_atomic_reset_engine(struct intel_engine_cs *engine, in igt_atomic_reset_engine() argument
1642 err = __igt_atomic_reset_engine(engine, p, "idle"); in igt_atomic_reset_engine()
1646 err = hang_init(&h, engine->gt); in igt_atomic_reset_engine()
1650 rq = hang_create_request(&h, engine); in igt_atomic_reset_engine()
1660 err = __igt_atomic_reset_engine(engine, p, "active"); in igt_atomic_reset_engine()
1663 __func__, engine->name, in igt_atomic_reset_engine()
1665 intel_gt_set_wedged(engine->gt); in igt_atomic_reset_engine()
1672 intel_wedge_on_timeout(&w, engine->gt, HZ / 20 /* 50ms */) in igt_atomic_reset_engine()
1674 if (intel_gt_is_wedged(engine->gt)) in igt_atomic_reset_engine()
1706 struct intel_engine_cs *engine; in igt_reset_engines_atomic() local
1709 for_each_engine(engine, gt->i915, id) { in igt_reset_engines_atomic()
1710 err = igt_atomic_reset_engine(engine, p); in igt_reset_engines_atomic()