{}
},
},
- {
- .name = "match-or",
- .expected_reg = REGULAR_REG1,
- .expected_set_bits = REG_BIT(0) | REG_BIT(1) | REG_BIT(2),
- .expected_clr_bits = REG_BIT(0) | REG_BIT(1) | REG_BIT(2),
- .expected_active = BIT(0) | BIT(1) | BIT(2),
- .expected_count_sr_entries = 1,
- .entries = (const struct xe_rtp_entry_sr[]) {
- { XE_RTP_NAME("first"),
- XE_RTP_RULES(FUNC(match_yes), OR, FUNC(match_no)),
- XE_RTP_ACTIONS(SET(REGULAR_REG1, REG_BIT(0)))
- },
- { XE_RTP_NAME("middle"),
- XE_RTP_RULES(FUNC(match_no), FUNC(match_no), OR,
- FUNC(match_yes), OR,
- FUNC(match_no)),
- XE_RTP_ACTIONS(SET(REGULAR_REG1, REG_BIT(1)))
- },
- { XE_RTP_NAME("last"),
- XE_RTP_RULES(FUNC(match_no), OR, FUNC(match_yes)),
- XE_RTP_ACTIONS(SET(REGULAR_REG1, REG_BIT(2)))
- },
- { XE_RTP_NAME("no-match"),
- XE_RTP_RULES(FUNC(match_no), OR, FUNC(match_no)),
- XE_RTP_ACTIONS(SET(REGULAR_REG1, REG_BIT(3)))
- },
- {}
- },
- },
- {
- .name = "match-or-xfail",
- .expected_reg = REGULAR_REG1,
- .expected_count_sr_entries = 0,
- .entries = (const struct xe_rtp_entry_sr[]) {
- { XE_RTP_NAME("leading-or"),
- XE_RTP_RULES(OR, FUNC(match_yes)),
- XE_RTP_ACTIONS(SET(REGULAR_REG1, REG_BIT(0)))
- },
- { XE_RTP_NAME("trailing-or"),
- /*
- * First condition is match_no, otherwise the failure
- * wouldn't really trigger as RTP stops processing as
- * soon as it has a matching set of rules
- */
- XE_RTP_RULES(FUNC(match_no), OR),
- XE_RTP_ACTIONS(SET(REGULAR_REG1, REG_BIT(1)))
- },
- { XE_RTP_NAME("no-or-or-yes"),
- XE_RTP_RULES(FUNC(match_no), OR, OR, FUNC(match_yes)),
- XE_RTP_ACTIONS(SET(REGULAR_REG1, REG_BIT(2)))
- },
- {}
- },
- },
- {
- .name = "no-match-no-add-multiple-rules",
- .expected_reg = REGULAR_REG1,
- .expected_set_bits = REG_BIT(0),
- .expected_clr_bits = REG_BIT(0),
- .expected_active = BIT(0),
- .expected_count_sr_entries = 1,
- /* Don't coalesce second entry due to one of the rules */
- .entries = (const struct xe_rtp_entry_sr[]) {
- { XE_RTP_NAME("basic-1"),
- XE_RTP_RULES(FUNC(match_yes)),
- XE_RTP_ACTIONS(SET(REGULAR_REG1, REG_BIT(0)))
- },
- { XE_RTP_NAME("basic-2"),
- XE_RTP_RULES(FUNC(match_yes), FUNC(match_no)),
- XE_RTP_ACTIONS(SET(REGULAR_REG1, REG_BIT(1)))
- },
- {}
- },
- },
{
.name = "two-regs-two-entries",
.expected_reg = REGULAR_REG1,
},
},
{
- .name = "inactive-1st_or_active-inactive",
+ .name = "inactive-active-inactive",
.expected_active = BIT(1),
.entries = (const struct xe_rtp_entry[]) {
{ XE_RTP_NAME("r1"),
XE_RTP_RULES(FUNC(match_no)),
},
- { XE_RTP_NAME("r2_or_conditions"),
- XE_RTP_RULES(FUNC(match_yes), OR,
- FUNC(match_no), OR,
- FUNC(match_no)) },
- { XE_RTP_NAME("r3"),
- XE_RTP_RULES(FUNC(match_no)),
- },
- {}
- },
- },
- {
- .name = "inactive-2nd_or_active-inactive",
- .expected_active = BIT(1),
- .entries = (const struct xe_rtp_entry[]) {
- { XE_RTP_NAME("r1"),
- XE_RTP_RULES(FUNC(match_no)),
+ { XE_RTP_NAME("r2"),
+ XE_RTP_RULES(FUNC(match_yes)),
},
- { XE_RTP_NAME("r2_or_conditions"),
- XE_RTP_RULES(FUNC(match_no), OR,
- FUNC(match_yes), OR,
- FUNC(match_no)) },
{ XE_RTP_NAME("r3"),
XE_RTP_RULES(FUNC(match_no)),
},
},
},
{
- .name = "inactive-last_or_active-inactive",
- .expected_active = BIT(1),
+ .name = "inactive-inactive-inactive",
+ .expected_active = 0,
.entries = (const struct xe_rtp_entry[]) {
{ XE_RTP_NAME("r1"),
XE_RTP_RULES(FUNC(match_no)),
},
- { XE_RTP_NAME("r2_or_conditions"),
- XE_RTP_RULES(FUNC(match_no), OR,
- FUNC(match_no), OR,
- FUNC(match_yes)) },
- { XE_RTP_NAME("r3"),
- XE_RTP_RULES(FUNC(match_no)),
- },
- {}
- },
- },
- {
- .name = "inactive-no_or_active-inactive",
- .expected_active = 0,
- .entries = (const struct xe_rtp_entry[]) {
- { XE_RTP_NAME("r1"),
+ { XE_RTP_NAME("r2"),
XE_RTP_RULES(FUNC(match_no)),
},
- { XE_RTP_NAME("r2_or_conditions"),
- XE_RTP_RULES(FUNC(match_no), OR,
- FUNC(match_no), OR,
- FUNC(match_no)) },
{ XE_RTP_NAME("r3"),
XE_RTP_RULES(FUNC(match_no)),
},