Add initial WA infrastructure
First commit implements infra to allow adding registers to be set/modified, folding them together. It may or may not be used in future. Currently it's unused.
Second and third commit implements "how to define a table with registers to be set/modified". Main ask for feedback is in the table definition: please look at the DG2 table. Goals for defining it like that:
- Have a set of generic matches that cover 90%+ of the WAs we have today: match by platform, subplatform, stepping, IP version, engine class. Anything more complex than that can be achieved by the func hook that would call a function to check if the WA needs to be applied. If other match type becomes common, we can add more in the XE_RTP_MATCH_* and correspondent sub-struct in xe_rtp_rule
- Have the same set of functions for masked vs non-masked registers: wr, set, clr, field_set should be sufficient for all operations. Having different functions is a common source of bugs in i915, so I'd like to avoid following the same scheme. Right now it requires a flag to be added on the table to denote if a register is masked or not: in future we could maybe just look it up from a register db.
- Rules are AND'ed: it needs to match all rules for the WA to be considered. If OR is desired, add a new entry. I'd consider separating the match definition from the rule so we could have multiple matches and just write the rule once, but I'm not sure yet if this approach is better. With the move to IP version, hopefully we can match by IP version rather than OR'ing multiple platforms.
- xe_rtp_foreach() + WA application + other things still to be added - see TODO in the xe_wa.c
Edited by Lucas De Marchi