[Intel-gfx] [PATCH 2/4] drm/i915/selftests: Change priority overflow detection
Chris Wilson
chris at chris-wilson.co.uk
Mon May 18 23:14:05 UTC 2020
Check for integer overflow in the priority chain, rather than against a
type-constricted max-priority check.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
drivers/gpu/drm/i915/gt/selftest_lrc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
index 97447de92843..f128744ab09b 100644
--- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
@@ -2735,12 +2735,12 @@ static int live_preempt_gang(void *arg)
/* Submit each spinner at increasing priority */
engine->schedule(rq, &attr);
+ if (prio < attr.priority)
+ break;
+
if (prio <= I915_PRIORITY_MAX)
continue;
- if (prio > (INT_MAX >> I915_USER_PRIORITY_SHIFT))
- break;
-
if (__igt_timeout(end_time, NULL))
break;
} while (1);
--
2.20.1
More information about the Intel-gfx
mailing list