MEMORY OBJECTS CONTROL STATE (MOCS)(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… MEMORY OBJECTS CONTROL STATE (MOCS) πŸ’…

okay bestie, sit down, because we're about to talk about MOCS β€” that's Memory Objects Control State for the uninitiated β€” and it's from the Kernel API Manual, section 9, so you know it's gonna be a little nerdy but we're gonna make it cute πŸ’–


🌸 MOTIVATION 🌸

So back in the day (like, previous Gens), the MOCS settings were just a value that was set by user land as part of the batch. simple. iconic. no drama.

But then Gen9 happened and everything changed, because now it's a single table (per ring) that all the batches reference by index instead of programming the MOCS directly. the way that's such a glow-up honestly ✨

The one wrinkle in this whole situation (and there's always a wrinkle, isn't there 😭) is that only PART of the MOCS tables are included in the context β€” specifically the GFX_MOCS_0 - GFX_MOCS_64 and the LNCFCMOCS0 - LNCFCMOCS32 registers. The rest are not included (that's the settings for the other rings, bestie, they're off doing their own thing πŸ™ˆ).

This table has to be set at system start-up, and that's lowkey non-negotiable, because of the way the table interacts with the contexts and the GmmLib interface. it's giving foundational, fr fr 🫢


πŸ¦‹ IMPLEMENTATION πŸ¦‹

So how does this actually work? The tables β€” one per supported platform β€” are defined in intel_mocs.c, and they get programmed in the first batch after the context is loaded (with the hardware workarounds, obviously, we're not savages πŸ’…).

After that, the usual context handling just keeps the MOCS in step. that's it. that's the whole vibe. main character energy from start to finish πŸ‘‘


πŸŽ€ SEE ALSO πŸŽ€

  • Kernel file ./drivers/gpu/drm/i915/gt/intel_mocs.h β€” go read it, iykyk πŸ“–

and that's the whole page, bestie!! this one's from the Kernel API Manual, section 9, sourced from ./drivers/gpu/drm/i915/gt, dated October 2026 β€” so if you ever need to cite it, you're welcome, mwah πŸ’‹πŸ¦‹β­

πŸ“¦ where this page comes from