[PATCH 9/9] cancel chain
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Fri Mar 12 11:23:37 UTC 2021
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
drivers/gpu/drm/i915/selftests/i915_request.c | 34 +++++++++++--------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
index c263fd93ee5c..ef426847171a 100644
--- a/drivers/gpu/drm/i915/selftests/i915_request.c
+++ b/drivers/gpu/drm/i915/selftests/i915_request.c
@@ -720,7 +720,7 @@ static int __cancel_active_chain(struct intel_engine_cs *engine)
{
struct intel_context *ce;
struct igt_spinner spin;
- struct i915_request *rq;
+ struct i915_request *rq[2];
int err = 0;
if (igt_spinner_init(&spin, engine->gt))
@@ -732,26 +732,26 @@ static int __cancel_active_chain(struct intel_engine_cs *engine)
goto out_spin;
}
- rq = igt_spinner_create_request(&spin, ce, MI_ARB_CHECK);
- if (IS_ERR(rq)) {
- err = PTR_ERR(rq);
+ rq[0] = igt_spinner_create_request(&spin, ce, MI_ARB_CHECK);
+ if (IS_ERR(rq[0])) {
+ err = PTR_ERR(rq[0]);
goto out_ce;
}
- i915_request_add(rq);
+ i915_request_add(rq[0]);
- rq = intel_context_create_request(ce);
- if (IS_ERR(rq)) {
- err = PTR_ERR(rq);
+ rq[1] = intel_context_create_request(ce);
+ if (IS_ERR(rq[1])) {
+ err = PTR_ERR(rq[1]);
goto out_ce;
}
- i915_request_add(rq);
+ i915_request_add(rq[1]);
pr_debug("%s: Cancelling active chain\n", engine->name);
intel_engine_flush_scheduler(engine);
- i915_request_cancel(rq, -EINTR);
+ i915_request_cancel(rq[0], -EINTR);
igt_spinner_end(&spin);
- if (i915_request_wait(rq, 0, HZ / 5) < 0) {
+ if (i915_request_wait(rq[1], 0, HZ / 5) < 0) {
struct drm_printer p = drm_info_printer(engine->i915->drm.dev);
pr_err("%s: Failed to cancel chained request\n", engine->name);
@@ -760,9 +760,15 @@ static int __cancel_active_chain(struct intel_engine_cs *engine)
goto out_ce;
}
- if (rq->fence.error != -EINTR) {
- pr_err("%s: fence not cancelled (%u)\n",
- engine->name, rq->fence.error);
+ if (rq[0]->fence.error != -EINTR) {
+ pr_err("%s: first fence not cancelled (%u)\n",
+ engine->name, rq[0]->fence.error);
+ err = -EINVAL;
+ }
+
+ if (rq[1]->fence.error != -EINTR) {
+ pr_err("%s: second fence not cancelled (%u)\n",
+ engine->name, rq[1]->fence.error);
err = -EINVAL;
}
--
2.27.0
More information about the Intel-gfx-trybot
mailing list