summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-05-19 09:31:13 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2020-05-19 17:28:26 +0300
commitad6586850b6d718b1245bad6702028c1c773cfb9 (patch)
tree4e27bc8212c37eaf3541a431effa753011639e64 /drivers/gpu
parentb86fc6e5e89e5645b43f57171c26740ef38f9f4a (diff)
downloadlinux-ad6586850b6d718b1245bad6702028c1c773cfb9.tar.xz
drm/i915/selftests: Change priority overflow detection
Check for integer overflow in the priority chain, rather than against a type-constricted max-priority check. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200519063123.20673-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/gt/selftest_lrc.c6
1 files 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 94854a467e66..3e042fa4b94b 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);