fb_get_hblank_by_dclk(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

fb_get_hblank_by_dclk β€” okay so this one gets you the horizontal blank time when you already know the pixelclock, and honestly? iconic little helper function, no cap. πŸ¦‹


✨ SYNOPSIS ✨

u32 fb_get_hblank_by_dclk (u32 dclk , u32 xres );

πŸŽ€ ARGUMENTS πŸŽ€

  • dclk β€” your pixelclock, in Hz. that's it, that's the units bestie πŸ’…
  • xres β€” the horizontal resolution, in pixels. the width of the vibe. ✨

🌸 DESCRIPTION 🌸

Alright so here's the math, and yes it's giving very "trust me, I'm a kernel dev," but stay with me 🫢:

xres * duty_cycle
hblank = ------------------
         100 - duty_cycle

So hblank is literally xres times duty_cycle, over 100 - duty_cycle. slay.

Then duty cycle β€” the percent of htotal that's assigned to inactive display β€” is:

duty cycle = C - (M * h_period)

and h_period is where it gets spicy 🌢️:

where: h_period = SQRT(100 - C + (0.4 * xres * M)/dclk) + C - 100
       -----------------------------------------------
                       2 * M

and the magic numbers are literally right there:

M = 300; C = 30;

so yeah, M is 300, C is 30, and that's the whole recipe. don't ask me to explain the discriminant on a first date πŸ˜­πŸ’€


πŸ”₯ SEE ALSO πŸ”₯

The kernel file ./drivers/video/fbdev/core/fbmon.c is where the source hangs out, and these are the besties in the same friend group πŸ‘‘


that's the whole page, bestie β€” go forth and compute πŸ’œ

source/version: ./drivers/video/fbdev/core Β· date: October 2026 Β· mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from