Commit ad658685 authored by Chris Wilson's avatar Chris Wilson

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200519063123.20673-2-chris@chris-wilson.co.uk
parent b86fc6e5
...@@ -2735,12 +2735,12 @@ static int live_preempt_gang(void *arg) ...@@ -2735,12 +2735,12 @@ static int live_preempt_gang(void *arg)
/* Submit each spinner at increasing priority */ /* Submit each spinner at increasing priority */
engine->schedule(rq, &attr); engine->schedule(rq, &attr);
if (prio < attr.priority)
break;
if (prio <= I915_PRIORITY_MAX) if (prio <= I915_PRIORITY_MAX)
continue; continue;
if (prio > (INT_MAX >> I915_USER_PRIORITY_SHIFT))
break;
if (__igt_timeout(end_time, NULL)) if (__igt_timeout(end_time, NULL))
break; break;
} while (1); } while (1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment