xxxfb_check_var(9)
β¨ NAME β¨
okay so this is xxxfb_check_var(9) from the Kernel API Manual β the optional function that validates a var you pass in. π
πΈ SYNOPSIS πΈ
int xxxfb_check_var (struct fb_var_screeninfo *var , struct fb_info
*info );
π ARGUMENTS π
varβ the frame buffer variable screen structure, bestie.infoβ the frame buffer structure that represents a single frame buffer.
π¦ DESCRIPTION π¦
Okay so what this function does: it checks whether the hardware actually supports the state requested by the var you passed in. This function does not alter the hardware state!!! That means the data stored in struct fb_info and struct xxx_par do not change. This includes the var inside of struct fb_info. Do NOT change these. No cap.
This function can be called on its own if we intend to only test a mode and not actually set it. The stuff in modedb.c is an example of this. If the var passed in is slightly off from what the hardware can support, then we alter the var PASSED in to what we can do. β¨
For values that are off, this function must round them _up_ to the next value that is supported by the hardware. If the value is greater than the highest value supported by the hardware, then this function must return -EINVAL. π
Exception to the above rule: some drivers have a fixed mode, ie, the hardware is already set at boot up, and cannot be changed. In this case, it is more acceptable that this function just return a copy of the currently working var (info->var). Better is to not implement this function, as the upper layer will do the copying of the current var for you. π«Ά
π NOTE π
This is the only function where the contents of var can be freely adjusted after the driver has been registered. If you find that you have code outside of this function that alters the content of var, then you are doing something wrong. Note also that the contents of info->var must be left untouched at all times after driver registration.
Returns negative errno on error, or zero on success. π
π SEE ALSO π
Kernel file ./drivers/video/fbdev/skeletonfb.c and these iconic functions:
xxxfb_open(9)xxxfb_release(9)xxxfb_set_par(9)xxxfb_setcolreg(9)xxxfb_pan_display(9)xxxfb_blank(9)xxxfb_fillrect(9)xxxfb_copyarea(9)xxxfb_imageblit(9)xxxfb_cursor(9)xxxfb_sync(9)xxxfb_suspend(9)xxxfb_resume(9)xxxfb_suspend(9)xxxfb_resume(9)
yes, xxxfb_suspend(9) and xxxfb_resume(9) are listed twice β thatβs exactly what the page says, no cap. π
mwah π source/version: ./drivers/video/fbdev Β· October 2026 β bye bestie! π«Άπ
π¦ 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