XE_RTP_RULES(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… XE_RTP_RULES β€” bestie, this is the macro that stacks your rules ✨

okay so real quick: this page is XE_RTP_RULES(9) from the Kernel API Manual, and it's literally the helper that sets multiple rules onto a struct xe_rtp_entry_sr entry. group-chat summary: it's the "and also…" macro. periodt.


✨ NAME ✨

XE_RTP_RULES β€” the helper that sets multiple rules onto a struct xe_rtp_entry_sr entry πŸŽ€


🌸 SYNOPSIS 🌸

XE_RTP_RULES (... );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • ... β€” the Rules. that's it, that's the whole argument list. it's variadic and it's eating good πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

so when an RTP table is being processed, the rules of each entry get evaluated to check if they match the target entity β€” and which entity that is depends on the specific RTP table, bestie: it's platform, gt or hwe. iykyk.

The sequence of arguments you hand to this macro must follow this eBNF grammar (no cap, this is the actual grammar, keep it exact):

      rules = disjunction;
disjunction = conjunction, { "OR", conjunction };
conjunction = single_rule, { single_rule };
                           (* the AND operator is implicit *)
single_rule = ? GRAPHICS_VERSION(...), MEDIA_VERSION(...),
                FUNC(...), etc ?

so yeah β€” OR is the only operator you actually type, and the AND is just… vibes. implicit vibes. it's giving "the comma is the AND" 🫢


πŸ‘‘ EXAMPLES πŸ‘‘

      const struct xe_rtp_entry_sr wa_entries[] = {
              ...
              { XE_RTP_NAME("entry-a"),
                // Match DG2-G10 with graphics steppings A0 up-to B0
                // (exclusive).
                XE_RTP_RULES(SUBPLATFORM(DG2, G10), GRAPHICS_STEP(A0, B0)),
                ...
              },
              { XE_RTP_NAME("entry-b"),
                // Match graphics version 20 (all steppings) or graphics
                // version 30 steppings A0 up-to B0 (exclusive).
                XE_RTP_RULES(GRAPHICS_VERSION(2000), OR,
                             GRAPHICS_VERSION(3000), GRAPHICS_STEP(A0, B0))
                ...
              },
              ...
      };

like look at entry-b β€” that OR is doing main character work, and everything else is quietly ANDed together. iconic. πŸ”₯


🌈 SEE ALSO 🌈

Kernel file ./drivers/gpu/drm/xe/xe_rtp.h, plus the whole squad:


πŸ’– that's the whole page bestie, go forth and stack your rules πŸ’–

shoutout to ./drivers/gpu/drm/xe for shipping this, and happy October 2026 to everyone who celebrates πŸŽ€βœ¨

πŸ“¦ where this page comes from