intel_calculate_wm(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… intel_calculate_wm(9)

okay so this is a page from the Kernel API Manual, bestie β€” and we're talking about intel_calculate_wm, which literally calculates the watermark level. that's the whole vibe. let's get into it 🫢


✨ SYNOPSIS ✨

unsigned int intel_calculate_wm (struct intel_display *display , int
pixel_rate , const struct intel_watermark_params *wm , int fifo_size ,
int cpp , unsigned int latency_ns );

it gives you back an unsigned int, no cap. πŸŽ€


🌸 ARGUMENTS 🌸

here's the group chat roll call, everybody plays a part:

  • display β€” the display device itself. main character energy.
  • pixel_rate β€” the pixel clock. it's giving "how fast we're going".
  • wm β€” the chip FIFO params. chip-specific, you can't just use anyone's.
  • fifo_size β€” size of the FIFO buffer. the literal capacity, iykyk.
  • cpp β€” bytes per pixel. πŸ–ΌοΈ
  • latency_ns β€” memory latency for the platform. every platform has its own, and yeah you gotta pass it in.

πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole point of this function is to calculate the watermark level β€” which is the level at which the display plane will start fetching from memory again. like, the "hey bestie, go get more data" line. πŸ“₯

every chip has a different display FIFO size and allocation, so the caller has to figure that out and pass in the correct intel_watermark_params structure. no copy-pasting someone else's params, that's not the move. πŸ’…

now the science part, and honestly it's kind of iconic:

as the pixel clock runs, the FIFO gets drained at a rate that depends on the pixel size. when it reaches the watermark level, it'll start fetching FIFO line sized based chunks from memory until the FIFO fills past the watermark point. πŸ”„

⚠️ and here's the scary bit, so listen up: if the FIFO drains completely, a FIFO underrun will occur, and a display engine hang could result. 😭 that's the bad ending, we don't want it.

πŸ‘‘ SEE ALSO πŸ‘‘


k that's the whole page, mwah πŸ’‹ β€” this cutie lives in ./drivers/gpu/drm/i915/display, the version vibe is October 2026, and the manual is the Kernel API Manual. slay, bye! πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from