FLAT-CCS - MEMORY COMPRESSION FOR LOCAL MEMORY(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– Flat-CCS - Memory compression for Local memory πŸ’–

okay bestie, this is the Kernel API Manual page for section 9, and we are diving straight into Flat-CCS. no cap, it’s giving very specific kernel lore ✨

On Xe-HP and later devices, we use dedicated compression control state (CCS) stored in local memory for each surface, to support the 3D and media compression formats. πŸ’…

The memory required for the CCS of the entire local memory is 1/256 of the local memory size. So before the kernel boot, the required memory is reserved for the CCS data and a secure register will be programmed with the CCS base address. secure register moment πŸ‘‘

Flat CCS data needs to be cleared when a lmem object is allocated. And CCS data can be copied in and out of the CCS region through XY_CTRL_SURF_COPY_BLT. CPU can't access the CCS data directly. periodt. πŸ’€

I915 supports Flat-CCS on lmem only objects. When an object has smem in its preference list, on memory pressure, i915 needs to migrate the lmem content into smem. If the lmem object is Flat-CCS compressed by userspace, then i915 needs to decompress it. But I915 lacks the required information for such decompression. Hence I915 supports Flat-CCS only on lmem only objects. this is the whole boundary, iykyk πŸ¦‹

When we exhaust the lmem, Flat-CCS capable objects' lmem backing memory can be temporarily evicted to smem, along with the auxiliary CCS state, where it can be potentially swapped-out at a later point, if required. If userspace later touches the evicted pages, then we always move the backing memory back to lmem, which includes restoring the saved CCS state, and potentially performing any required swap-in. the way that round-trip works… obsessed 🫢

For the migration of the lmem objects with smem in placement list, such as {lmem, smem}, objects are treated as non Flat-CCS capable objects. so no Flat-CCS magic there, bestie πŸ™ˆ


πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./drivers/gpu/drm/i915/gt/intel_migrate.c

mwah πŸ’‹ that’s the page, bestie. it comes from ./drivers/gpu/drm/i915/gt, dated October 2026, with the footer banner Flat-CCS - M...Local memory(9) β€” iconic, no notes πŸŽ€βœ¨

πŸ“¦ where this page comes from