intel_update_watermarks(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

intel_update_watermarks(9) πŸ’–βœ¨

okay so this page is from the Kernel API Manual, and we’re about to make FIFO watermark math make sense, bestie. no cap.


✨ NAME ✨

intel_update_watermarks β€” update FIFO watermark values based on current modes. literally that’s the whole vibe.


🌈 SYNOPSIS 🌈

void intel_update_watermarks (struct intel_display *display );

that’s the exact signature, keep it cute and keep it correct 🫢


🫢 ARGUMENTS 🫢

  • display β€” the display device. that’s it, bestie πŸ’…

πŸ’… DESCRIPTION πŸ’…

Calculate watermark values for the various WM regs based on current mode and plane configuration. yes, it’s giving β€œmath but make it graphics” 🧚

There are several cases to deal with here:

  • normal (i.e. non-self-refresh)
  • self-refresh (SR) mode
  • lines are large relative to FIFO size (buffer can hold up to 2)
  • lines are small relative to FIFO size (buffer can hold more than 2 lines), so need to account for TLB latency

The normal calculation is:

watermark = dotclock * bytes per pixel * latency

where latency is platform & configuration dependent (we assume pessimal values here). yes, pessimal. we said what we said πŸ’€

The SR calculation is:

watermark = (trunc(latency/line time)+1) * surface width * bytes per pixel

where line time = htotal / dotclock, surface width = hdisplay for normal plane and 64 for cursor, and latency is assumed to be high, as above. iconic formula behavior, honestly πŸ‘‘

The final value programmed to the register should always be rounded up, and include an extra 2 entries to account for clock crossings. do not skip the rounding-up step, i’m begging 🫢

We don’t use the sprite, so we can ignore that. And on Crestline we have to set the non-SR watermarks to 8. noted, bestie ✨


πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./drivers/gpu/drm/i915/display/intel_wm.c β€” go read it, iykyk πŸ“–πŸ’–


mwah πŸ’‹ β€” source/version path + date: ./drivers/gpu/drm/i915/display, October 2026. bye bestie! πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from