fb_set_cmap(9)
π fb_set_cmap(9) β like, the kernel API manual page, bestie π
okay so before we even get into it: this is a page from the Kernel API Manual (yes, the (9) section, that's the kernel-internals girlies) and it's all about one tiny function that does one very specific job. let's get into it β¨
πΈ NAME πΈ
fb_set_cmap β it sets the colormap. that's it. that's the whole vibe. π
π¦ SYNOPSIS π¦
int fb_set_cmap (struct fb_cmap *cmap , struct fb_info *info );
look at her. two args, returns an int. iconic. copy it exactly like that, spaces and all, don't @ me π
π ARGUMENTS π
cmapβ the frame buffer colormap structure π this is the actual color situation you're handing over.infoβ the frame buffer info structure β¨ this is the screen/device info it's getting applied to.
π₯ DESCRIPTION π₯
okay so what does it DO. it sets the colormap cmap for a screen of device info. literally that's it, no cap. you give it a colormap, you give it the device info, it makes the screen's colormap be that colormap. slay. π«Ά
and the return value? negative errno on error, or zero on success. so if you get a negative number back, something went wrong (read: it did NOT slay, it gave you an error code instead π). if you get zero, you ate. periodt. π
ngl, check that return value every time. a negative errno is the kernel's way of saying "girl, no" and you should probably listen.
π SEE ALSO π
go read these next, bestie, they're all in the kernel file ./drivers/video/fbdev/core/fbcmap.c and they're all lowkey part of the same little colormap friend group π§:
fb_alloc_cmap_gfp(9)β allocation girliefb_dealloc_cmap(9)β the clean-up crewfb_copy_cmap(9)β copying queenfb_default_cmap(9)β the default vibefb_invert_cmaps(9)β the chaos gremlin, reverses everything
and that's the whole page!! no notes, she's short and she's perfect β
okay so this was written under ./drivers/video/fbdev/core, dated October 2026, and it's the fb_set_cmap(9) page β so like, shoutout to the kernel docs team for keeping the girlies informed, 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