diff options
author | Lucas De Marchi <[email protected]> | 2024-06-17 22:00:40 -0700 |
---|---|---|
committer | Matt Roper <[email protected]> | 2024-06-18 12:03:27 -0700 |
commit | 6045473650c40848122f5042b112606ce5d14406 (patch) | |
tree | 8c230d2ed54acfcb2bb2d9d5d2af5b0e5aad89f5 | |
parent | f0ccd2d805e55e12b430d5d6b9acd9f891af455e (diff) |
drm/xe/rtp: Allow to match 0 sr entries
If none of the rules match, there should be 0 entries in the sr xarray,
so none of them should have a register matching.
Reviewed-by: Matt Roper <[email protected]>
Signed-off-by: Lucas De Marchi <[email protected]>
Signed-off-by: Matt Roper <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/xe/tests/xe_rtp_test.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/tests/xe_rtp_test.c b/drivers/gpu/drm/xe/tests/xe_rtp_test.c index 06759d754783..474a0b222ce1 100644 --- a/drivers/gpu/drm/xe/tests/xe_rtp_test.c +++ b/drivers/gpu/drm/xe/tests/xe_rtp_test.c @@ -255,9 +255,14 @@ static void xe_rtp_process_tests(struct kunit *test) } KUNIT_EXPECT_EQ(test, count, param->expected_count); - KUNIT_EXPECT_EQ(test, sr_entry->clr_bits, param->expected_clr_bits); - KUNIT_EXPECT_EQ(test, sr_entry->set_bits, param->expected_set_bits); - KUNIT_EXPECT_EQ(test, sr_entry->reg.raw, param->expected_reg.raw); + if (count) { + KUNIT_EXPECT_EQ(test, sr_entry->clr_bits, param->expected_clr_bits); + KUNIT_EXPECT_EQ(test, sr_entry->set_bits, param->expected_set_bits); + KUNIT_EXPECT_EQ(test, sr_entry->reg.raw, param->expected_reg.raw); + } else { + KUNIT_EXPECT_NULL(test, sr_entry); + } + KUNIT_EXPECT_EQ(test, reg_sr->errors, param->expected_sr_errors); } |