Commit 989536a4 authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Break out of the lrc layout test after register mismatch

AFter detecting a register mismatch between the protocontext and the
image generated by HW, immediately break out of the double loop.
Otherwise we end up with a second confusing error message.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210106123939.18435-1-chris@chris-wilson.co.uk
parent 8d03344b
......@@ -164,7 +164,7 @@ static int live_lrc_layout(void *arg)
dw = 0;
do {
u32 lri = hw[dw];
u32 lri = READ_ONCE(hw[dw]);
if (lri == 0) {
dw++;
......@@ -197,9 +197,11 @@ static int live_lrc_layout(void *arg)
dw++;
while (lri) {
if (hw[dw] != lrc[dw]) {
u32 offset = READ_ONCE(hw[dw]);
if (offset != lrc[dw]) {
pr_err("%s: Different registers found at dword %d, expected %x, found %x\n",
engine->name, dw, hw[dw], lrc[dw]);
engine->name, dw, offset, lrc[dw]);
err = -EINVAL;
break;
}
......@@ -211,7 +213,7 @@ static int live_lrc_layout(void *arg)
dw += 2;
lri -= 2;
}
} while ((lrc[dw] & ~BIT(0)) != MI_BATCH_BUFFER_END);
} while (!err && (lrc[dw] & ~BIT(0)) != MI_BATCH_BUFFER_END);
if (err) {
pr_info("%s: HW register image:\n", engine->name);
......
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