gen_l3_mask_from_pattern(9)
π gen_l3_mask_from_pattern (kernel API manual, bestie edition) π
Okay so this one lives in the Kernel API Manual, and it's giving "glorified copy-paste but make it hardware" energy. The function is gen_l3_mask_from_pattern β and yes, the name is literally what it does: it replicates a bit pattern according to a mask. Iconic, honestly. π
β¨ NAME β¨
gen_l3_mask_from_pattern β replicate a bit pattern according to a mask. That's it. That's the whole vibe. π¦
πΈ SYNOPSIS πΈ
void gen_l3_mask_from_pattern (struct xe_device *xe , xe_l3_bank_mask_t
dst , xe_l3_bank_mask_t pattern , int patternbits , unsigned long mask
);
π ARGUMENTS π
xeβ the device, aka the main character we're doing all this for πdstβ destination, where the finished mask goes to live its best lifepatternβ the pattern we're replicating, the little ceo of this operationpatternbitsβ size of the pattern, in bits (yes, in bits, write that down π)maskβ the mask describing where to replicate the pattern. It's the map, the pattern is the passenger πΊοΈ
π¦ DESCRIPTION π¦
So here's the tea: this is used to compute the L3 bank masks in a generic format on various platforms where the internal representation of L3 node and masks from registers are different. Basically every platform has its own little dialect and this function is the translator bestie. π
ngl the original diagrams got a little squished in transit, but the numbers are all here and they're all correct β lowkey the whole point is pattern goes in, mask says which slots get a copy, dst comes out. no cap. π
Example 1: ----------
pattern = 0b1111
ββ¬ββ
patternbits = 4 (bits)
mask = 0b0101
ββββββββββββββββββββββ 0b1111 (=1Γ0b1111)
βββββββββββββββ 0b0000 (=0Γ0b1111)
ββββββββ 0b1111 (=1Γ0b1111)
β 0b0000 (=0Γ0b1111)
dst = 0b0000 0b1111 0b0000 0b1111
Example 2: ----------
pattern = 0b11111111
ββ¬ββββββ
patternbits = 8 (bits)
mask = 0b10
ββββββββββββ 0b00000000 (=0Γ0b11111111)
β 0b11111111 (=1Γ0b11111111)
dst = 0b11111111 0b00000000
Likeβ¦ the mask is a 0b0101 and the pattern is 0b1111, and dst is just the pattern stamped into every slot the mask marked with a 1. It's giving sticker sheet. It's giving "copy the aesthetic into these exact spots." Obsessed. π₯
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/xe/xe_gt_topology.cβ go read it, iykyk π xe_gt_topology_dump(9)xe_gt_topology_has_dss_in_quadrant(9)
Okay bestie, that's the whole page! π«Ά This little number ships from ./drivers/gpu/drm/xe, dated October 2026, straight out of the Kernel API Manual. Go replicate some patterns, slay, and remember: the vibe changes, the facts do not. πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms