intel_calculate_wm(9)
π 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 π
- Kernel file
./drivers/gpu/drm/i915/display/i9xx_wm.cβ go read the source, it ate π₯ intel_set_memory_cxsr(9)intel_wm_method1(9)intel_wm_method2(9)
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
- 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