Lines Matching refs:rq
95 const struct i915_request *rq) in hws_address() argument
97 return hws->node.start + offset_in_page(sizeof(u32)*rq->fence.context); in hws_address()
101 struct i915_request *rq, in move_to_active() argument
107 err = i915_request_await_object(rq, vma->obj, in move_to_active()
110 err = i915_vma_move_to_active(vma, rq, flags); in move_to_active()
122 struct i915_request *rq = NULL; in hang_create_request() local
170 rq = igt_request_alloc(h->ctx, engine); in hang_create_request()
171 if (IS_ERR(rq)) { in hang_create_request()
172 err = PTR_ERR(rq); in hang_create_request()
176 err = move_to_active(vma, rq, 0); in hang_create_request()
180 err = move_to_active(hws, rq, 0); in hang_create_request()
187 *batch++ = lower_32_bits(hws_address(hws, rq)); in hang_create_request()
188 *batch++ = upper_32_bits(hws_address(hws, rq)); in hang_create_request()
189 *batch++ = rq->fence.seqno; in hang_create_request()
202 *batch++ = lower_32_bits(hws_address(hws, rq)); in hang_create_request()
203 *batch++ = rq->fence.seqno; in hang_create_request()
215 *batch++ = lower_32_bits(hws_address(hws, rq)); in hang_create_request()
216 *batch++ = rq->fence.seqno; in hang_create_request()
227 *batch++ = lower_32_bits(hws_address(hws, rq)); in hang_create_request()
228 *batch++ = rq->fence.seqno; in hang_create_request()
241 if (rq->engine->emit_init_breadcrumb) { in hang_create_request()
242 err = rq->engine->emit_init_breadcrumb(rq); in hang_create_request()
251 err = rq->engine->emit_bb_start(rq, vma->node.start, PAGE_SIZE, flags); in hang_create_request()
255 i915_request_set_error_once(rq, err); in hang_create_request()
256 i915_request_add(rq); in hang_create_request()
263 return err ? ERR_PTR(err) : rq; in hang_create_request()
266 static u32 hws_seqno(const struct hang *h, const struct i915_request *rq) in hws_seqno() argument
268 return READ_ONCE(h->seqno[rq->fence.context % (PAGE_SIZE/sizeof(u32))]); in hws_seqno()
287 static bool wait_until_running(struct hang *h, struct i915_request *rq) in wait_until_running() argument
289 return !(wait_for_us(i915_seqno_passed(hws_seqno(h, rq), in wait_until_running()
290 rq->fence.seqno), in wait_until_running()
292 wait_for(i915_seqno_passed(hws_seqno(h, rq), in wait_until_running()
293 rq->fence.seqno), in wait_until_running()
300 struct i915_request *rq; in igt_hang_sanitycheck() local
319 rq = hang_create_request(&h, engine); in igt_hang_sanitycheck()
320 if (IS_ERR(rq)) { in igt_hang_sanitycheck()
321 err = PTR_ERR(rq); in igt_hang_sanitycheck()
327 i915_request_get(rq); in igt_hang_sanitycheck()
332 i915_request_add(rq); in igt_hang_sanitycheck()
336 timeout = i915_request_wait(rq, 0, in igt_hang_sanitycheck()
341 i915_request_put(rq); in igt_hang_sanitycheck()
388 struct i915_request *rq; in igt_reset_nop() local
390 rq = intel_context_create_request(ce); in igt_reset_nop()
391 if (IS_ERR(rq)) { in igt_reset_nop()
392 err = PTR_ERR(rq); in igt_reset_nop()
398 i915_request_add(rq); in igt_reset_nop()
486 struct i915_request *rq; in igt_reset_nop_engine() local
488 rq = intel_context_create_request(ce); in igt_reset_nop_engine()
489 if (IS_ERR(rq)) { in igt_reset_nop_engine()
504 err = PTR_ERR(rq); in igt_reset_nop_engine()
508 i915_request_add(rq); in igt_reset_nop_engine()
606 struct i915_request *rq; in igt_reset_fail_engine() local
608 rq = intel_context_create_request(ce); in igt_reset_fail_engine()
609 if (IS_ERR(rq)) { in igt_reset_fail_engine()
626 err = PTR_ERR(rq); in igt_reset_fail_engine()
632 last = i915_request_get(rq); in igt_reset_fail_engine()
633 i915_request_add(rq); in igt_reset_fail_engine()
740 struct i915_request *rq = NULL; in __igt_reset_engine() local
752 rq = hang_create_request(&h, engine); in __igt_reset_engine()
753 if (IS_ERR(rq)) { in __igt_reset_engine()
754 err = PTR_ERR(rq); in __igt_reset_engine()
760 i915_request_get(rq); in __igt_reset_engine()
761 i915_request_add(rq); in __igt_reset_engine()
763 if (!wait_until_running(&h, rq)) { in __igt_reset_engine()
767 __func__, rq->fence.seqno, hws_seqno(&h, rq)); in __igt_reset_engine()
771 i915_request_put(rq); in __igt_reset_engine()
786 if (rq) { in __igt_reset_engine()
788 err = intel_selftest_wait_for_rq(rq); in __igt_reset_engine()
791 engine->name, rq->fence.context, in __igt_reset_engine()
792 rq->fence.seqno, rq->context->guc_id, err); in __igt_reset_engine()
796 if (rq) in __igt_reset_engine()
797 i915_request_put(rq); in __igt_reset_engine()
878 static int active_request_put(struct i915_request *rq) in active_request_put() argument
882 if (!rq) in active_request_put()
885 if (i915_request_wait(rq, 0, 10 * HZ) < 0) { in active_request_put()
887 rq->engine->name, in active_request_put()
888 rq->fence.context, in active_request_put()
889 rq->fence.seqno); in active_request_put()
892 intel_gt_set_wedged(rq->engine->gt); in active_request_put()
896 i915_request_put(rq); in active_request_put()
906 struct i915_request *rq[8] = {}; in active_engine() local
907 struct intel_context *ce[ARRAY_SIZE(rq)]; in active_engine()
925 unsigned int idx = count++ & (ARRAY_SIZE(rq) - 1); in active_engine()
926 struct i915_request *old = rq[idx]; in active_engine()
936 rq[idx] = i915_request_get(new); in active_engine()
944 engine->sched_engine->schedule(rq[idx], &attr); in active_engine()
956 for (count = 0; count < ARRAY_SIZE(rq); count++) { in active_engine()
957 int err__ = active_request_put(rq[count]); in active_engine()
1053 struct i915_request *rq = NULL; in __igt_reset_engines() local
1065 rq = hang_create_request(&h, engine); in __igt_reset_engines()
1066 if (IS_ERR(rq)) { in __igt_reset_engines()
1067 err = PTR_ERR(rq); in __igt_reset_engines()
1073 i915_request_get(rq); in __igt_reset_engines()
1074 i915_request_add(rq); in __igt_reset_engines()
1076 if (!wait_until_running(&h, rq)) { in __igt_reset_engines()
1080 __func__, rq->fence.seqno, hws_seqno(&h, rq)); in __igt_reset_engines()
1084 i915_request_put(rq); in __igt_reset_engines()
1101 if (rq) { in __igt_reset_engines()
1103 err = intel_selftest_wait_for_rq(rq); in __igt_reset_engines()
1106 engine->name, rq->fence.context, in __igt_reset_engines()
1107 rq->fence.seqno, rq->context->guc_id, err); in __igt_reset_engines()
1112 if (rq) { in __igt_reset_engines()
1113 if (rq->fence.error != -EIO) { in __igt_reset_engines()
1116 rq->fence.context, in __igt_reset_engines()
1117 rq->fence.seqno, rq->context->guc_id); in __igt_reset_engines()
1118 i915_request_put(rq); in __igt_reset_engines()
1126 if (i915_request_wait(rq, 0, HZ / 5) < 0) { in __igt_reset_engines()
1133 rq->fence.context, in __igt_reset_engines()
1134 rq->fence.seqno); in __igt_reset_engines()
1137 i915_request_put(rq); in __igt_reset_engines()
1145 i915_request_put(rq); in __igt_reset_engines()
1304 struct i915_request *rq; in igt_reset_wait() local
1323 rq = hang_create_request(&h, engine); in igt_reset_wait()
1324 if (IS_ERR(rq)) { in igt_reset_wait()
1325 err = PTR_ERR(rq); in igt_reset_wait()
1330 i915_request_get(rq); in igt_reset_wait()
1331 i915_request_add(rq); in igt_reset_wait()
1333 if (!wait_until_running(&h, rq)) { in igt_reset_wait()
1337 __func__, rq->fence.seqno, hws_seqno(&h, rq)); in igt_reset_wait()
1338 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in igt_reset_wait()
1348 timeout = i915_request_wait(rq, 0, 10); in igt_reset_wait()
1363 i915_request_put(rq); in igt_reset_wait()
1436 struct i915_request *rq; in __igt_reset_evict_vma() local
1478 rq = hang_create_request(&h, engine); in __igt_reset_evict_vma()
1479 if (IS_ERR(rq)) { in __igt_reset_evict_vma()
1480 err = PTR_ERR(rq); in __igt_reset_evict_vma()
1492 i915_request_add(rq); in __igt_reset_evict_vma()
1502 i915_request_add(rq); in __igt_reset_evict_vma()
1508 err = i915_request_await_object(rq, arg.vma->obj, in __igt_reset_evict_vma()
1511 err = i915_vma_move_to_active(arg.vma, rq, flags); in __igt_reset_evict_vma()
1524 i915_request_get(rq); in __igt_reset_evict_vma()
1525 i915_request_add(rq); in __igt_reset_evict_vma()
1529 if (!wait_until_running(&h, rq)) { in __igt_reset_evict_vma()
1533 __func__, rq->fence.seqno, hws_seqno(&h, rq)); in __igt_reset_evict_vma()
1534 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in __igt_reset_evict_vma()
1553 if (wait_for(!list_empty(&rq->fence.cb_list), 10)) { in __igt_reset_evict_vma()
1557 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in __igt_reset_evict_vma()
1565 fake_hangcheck(gt, rq->engine->mask); in __igt_reset_evict_vma()
1579 i915_request_put(rq); in __igt_reset_evict_vma()
1692 struct i915_request *rq; in igt_reset_queue() local
1695 rq = hang_create_request(&h, engine); in igt_reset_queue()
1696 if (IS_ERR(rq)) { in igt_reset_queue()
1697 err = PTR_ERR(rq); in igt_reset_queue()
1702 i915_request_get(rq); in igt_reset_queue()
1703 i915_request_add(rq); in igt_reset_queue()
1719 i915_request_put(rq); in igt_reset_queue()
1736 i915_request_put(rq); in igt_reset_queue()
1750 i915_request_put(rq); in igt_reset_queue()
1756 if (rq->fence.error) { in igt_reset_queue()
1758 rq->fence.error); in igt_reset_queue()
1759 i915_request_put(rq); in igt_reset_queue()
1767 i915_request_put(rq); in igt_reset_queue()
1774 prev = rq; in igt_reset_queue()
1822 struct i915_request *rq; in igt_handle_error() local
1840 rq = hang_create_request(&h, engine); in igt_handle_error()
1841 if (IS_ERR(rq)) { in igt_handle_error()
1842 err = PTR_ERR(rq); in igt_handle_error()
1847 i915_request_get(rq); in igt_handle_error()
1848 i915_request_add(rq); in igt_handle_error()
1850 if (!wait_until_running(&h, rq)) { in igt_handle_error()
1854 __func__, rq->fence.seqno, hws_seqno(&h, rq)); in igt_handle_error()
1855 intel_engine_dump(rq->engine, &p, "%s\n", rq->engine->name); in igt_handle_error()
1870 if (rq->fence.error != -EIO) { in igt_handle_error()
1877 i915_request_put(rq); in igt_handle_error()
1919 struct i915_request *rq; in igt_atomic_reset_engine() local
1933 rq = hang_create_request(&h, engine); in igt_atomic_reset_engine()
1934 if (IS_ERR(rq)) { in igt_atomic_reset_engine()
1935 err = PTR_ERR(rq); in igt_atomic_reset_engine()
1940 i915_request_get(rq); in igt_atomic_reset_engine()
1941 i915_request_add(rq); in igt_atomic_reset_engine()
1943 if (wait_until_running(&h, rq)) { in igt_atomic_reset_engine()
1948 rq->fence.seqno, hws_seqno(&h, rq)); in igt_atomic_reset_engine()
1957 i915_request_wait(rq, 0, MAX_SCHEDULE_TIMEOUT); in igt_atomic_reset_engine()
1962 i915_request_put(rq); in igt_atomic_reset_engine()