Skip to content

Commit 20c3a02

Browse files
author
Lucas De Marchi
committed
drm/xe/kunit: Rename count to count_sr_entries
The RTP tests check both the result of processing the RTP entries and the outcome saved as SR entries. Rename "count" to be explicit about what's being counted. Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240727015907.899192-3-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent e525473 commit 20c3a02

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

drivers/gpu/drm/xe/tests/xe_rtp_test.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct rtp_test_case {
3636
struct xe_reg expected_reg;
3737
u32 expected_set_bits;
3838
u32 expected_clr_bits;
39-
unsigned long expected_count;
39+
unsigned long expected_count_sr_entries;
4040
unsigned int expected_sr_errors;
4141
const struct xe_rtp_entry_sr *entries;
4242
};
@@ -57,7 +57,7 @@ static const struct rtp_test_case cases[] = {
5757
.expected_reg = REGULAR_REG1,
5858
.expected_set_bits = REG_BIT(0) | REG_BIT(1),
5959
.expected_clr_bits = REG_BIT(0) | REG_BIT(1),
60-
.expected_count = 1,
60+
.expected_count_sr_entries = 1,
6161
/* Different bits on the same register: create a single entry */
6262
.entries = (const struct xe_rtp_entry_sr[]) {
6363
{ XE_RTP_NAME("basic-1"),
@@ -76,7 +76,7 @@ static const struct rtp_test_case cases[] = {
7676
.expected_reg = REGULAR_REG1,
7777
.expected_set_bits = REG_BIT(0),
7878
.expected_clr_bits = REG_BIT(0),
79-
.expected_count = 1,
79+
.expected_count_sr_entries = 1,
8080
/* Don't coalesce second entry since rules don't match */
8181
.entries = (const struct xe_rtp_entry_sr[]) {
8282
{ XE_RTP_NAME("basic-1"),
@@ -95,7 +95,7 @@ static const struct rtp_test_case cases[] = {
9595
.expected_reg = REGULAR_REG1,
9696
.expected_set_bits = REG_BIT(0) | REG_BIT(1) | REG_BIT(2),
9797
.expected_clr_bits = REG_BIT(0) | REG_BIT(1) | REG_BIT(2),
98-
.expected_count = 1,
98+
.expected_count_sr_entries = 1,
9999
.entries = (const struct xe_rtp_entry_sr[]) {
100100
{ XE_RTP_NAME("first"),
101101
XE_RTP_RULES(FUNC(match_yes), OR, FUNC(match_no)),
@@ -121,7 +121,7 @@ static const struct rtp_test_case cases[] = {
121121
{
122122
.name = "match-or-xfail",
123123
.expected_reg = REGULAR_REG1,
124-
.expected_count = 0,
124+
.expected_count_sr_entries = 0,
125125
.entries = (const struct xe_rtp_entry_sr[]) {
126126
{ XE_RTP_NAME("leading-or"),
127127
XE_RTP_RULES(OR, FUNC(match_yes)),
@@ -148,7 +148,7 @@ static const struct rtp_test_case cases[] = {
148148
.expected_reg = REGULAR_REG1,
149149
.expected_set_bits = REG_BIT(0),
150150
.expected_clr_bits = REG_BIT(0),
151-
.expected_count = 1,
151+
.expected_count_sr_entries = 1,
152152
/* Don't coalesce second entry due to one of the rules */
153153
.entries = (const struct xe_rtp_entry_sr[]) {
154154
{ XE_RTP_NAME("basic-1"),
@@ -167,7 +167,7 @@ static const struct rtp_test_case cases[] = {
167167
.expected_reg = REGULAR_REG1,
168168
.expected_set_bits = REG_BIT(0),
169169
.expected_clr_bits = REG_BIT(0),
170-
.expected_count = 2,
170+
.expected_count_sr_entries = 2,
171171
/* Same bits on different registers are not coalesced */
172172
.entries = (const struct xe_rtp_entry_sr[]) {
173173
{ XE_RTP_NAME("basic-1"),
@@ -186,7 +186,7 @@ static const struct rtp_test_case cases[] = {
186186
.expected_reg = REGULAR_REG1,
187187
.expected_set_bits = REG_BIT(0),
188188
.expected_clr_bits = REG_BIT(1) | REG_BIT(0),
189-
.expected_count = 1,
189+
.expected_count_sr_entries = 1,
190190
/* Check clr vs set actions on different bits */
191191
.entries = (const struct xe_rtp_entry_sr[]) {
192192
{ XE_RTP_NAME("basic-1"),
@@ -207,7 +207,7 @@ static const struct rtp_test_case cases[] = {
207207
.expected_reg = REGULAR_REG1,
208208
.expected_set_bits = TEMP_FIELD,
209209
.expected_clr_bits = TEMP_MASK,
210-
.expected_count = 1,
210+
.expected_count_sr_entries = 1,
211211
/* Check FIELD_SET works */
212212
.entries = (const struct xe_rtp_entry_sr[]) {
213213
{ XE_RTP_NAME("basic-1"),
@@ -225,7 +225,7 @@ static const struct rtp_test_case cases[] = {
225225
.expected_reg = REGULAR_REG1,
226226
.expected_set_bits = REG_BIT(0),
227227
.expected_clr_bits = REG_BIT(0),
228-
.expected_count = 1,
228+
.expected_count_sr_entries = 1,
229229
.expected_sr_errors = 1,
230230
.entries = (const struct xe_rtp_entry_sr[]) {
231231
{ XE_RTP_NAME("basic-1"),
@@ -245,7 +245,7 @@ static const struct rtp_test_case cases[] = {
245245
.expected_reg = REGULAR_REG1,
246246
.expected_set_bits = REG_BIT(0),
247247
.expected_clr_bits = REG_BIT(0),
248-
.expected_count = 1,
248+
.expected_count_sr_entries = 1,
249249
.expected_sr_errors = 1,
250250
.entries = (const struct xe_rtp_entry_sr[]) {
251251
{ XE_RTP_NAME("basic-1"),
@@ -265,7 +265,7 @@ static const struct rtp_test_case cases[] = {
265265
.expected_reg = REGULAR_REG1,
266266
.expected_set_bits = REG_BIT(0),
267267
.expected_clr_bits = REG_BIT(0),
268-
.expected_count = 1,
268+
.expected_count_sr_entries = 1,
269269
.expected_sr_errors = 2,
270270
.entries = (const struct xe_rtp_entry_sr[]) {
271271
{ XE_RTP_NAME("basic-1"),
@@ -295,7 +295,7 @@ static void xe_rtp_process_tests(struct kunit *test)
295295
struct xe_reg_sr *reg_sr = &gt->reg_sr;
296296
const struct xe_reg_sr_entry *sre, *sr_entry = NULL;
297297
struct xe_rtp_process_ctx ctx = XE_RTP_PROCESS_CTX_INITIALIZER(gt);
298-
unsigned long idx, count = 0;
298+
unsigned long idx, count_sr_entries = 0;
299299

300300
xe_reg_sr_init(reg_sr, "xe_rtp_tests", xe);
301301
xe_rtp_process_to_sr(&ctx, param->entries, reg_sr);
@@ -304,11 +304,11 @@ static void xe_rtp_process_tests(struct kunit *test)
304304
if (idx == param->expected_reg.addr)
305305
sr_entry = sre;
306306

307-
count++;
307+
count_sr_entries++;
308308
}
309309

310-
KUNIT_EXPECT_EQ(test, count, param->expected_count);
311-
if (count) {
310+
KUNIT_EXPECT_EQ(test, count_sr_entries, param->expected_count_sr_entries);
311+
if (count_sr_entries) {
312312
KUNIT_EXPECT_EQ(test, sr_entry->clr_bits, param->expected_clr_bits);
313313
KUNIT_EXPECT_EQ(test, sr_entry->set_bits, param->expected_set_bits);
314314
KUNIT_EXPECT_EQ(test, sr_entry->reg.raw, param->expected_reg.raw);

0 commit comments

Comments
 (0)