fb_get_hblank_by_dclk(9)
π 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 π
fb_create_modedb(9)fb_destroy_modedb(9)fb_get_vblank(9)fb_get_hblank_by_hfreq(9)fb_get_hfreq(9)of_get_fb_videomode(9)
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
- 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