drm_color_lut_extract(9)
π drm_color_lut_extract(9) π
okay so bestie, welcome to the kernel API manual β this one lives in the drm_color_lut_extract(9) girlie-verse and she is specifically about clamping and rounding LUT entries. yes, that's the whole vibe. let's get into it π
β¨ SYNOPSIS β¨
u32 drm_color_lut_extract(u32 user_input, int bit_precision);
that's the signature, no cap. two args in, one u32 out. π¦
πΈ ARGUMENTS πΈ
user_inputβ the input value, fr. this is the thing you're feeding in.bit_precisionβ the number of bits the hw LUT actually supports. like, how much precision your hardware can even handle. know your limits, king π
π DESCRIPTION π
okay so here's the tea: this function extracts a degamma/gamma LUT value that the user handed over (in the form of drm_color_lut entries) and rounds it to the precision supported by the hardware. it does this following the OpenGL int<->float conversion rules β see, e.g., the OpenGL 4.6 specification, section 2.3.5 Fixed-Point Data Conversions. literally iconic behavior β¨
so yeah: clamp, round, ship it. the hardware gets a value it can actually deal with, and everybody's happy π«Ά
π¦ SEE ALSO π¦
kernel file ./include/drm/drm_color_mgmt.h, plus these besties:
drm_color_lut32_extract(9)drm_color_lut_size(9)drm_color_lut32_size(9)enum drm_color_lut_tests(9)
go read them, iyk yk π
ngl this one's short and sweet β but the rounding rules matter, so don't just skim and assume. read the OpenGL spec reference if you wanna be that girl π
okay that's the whole page, bestie, hope you ate it up π this lil number came out of ./include/drm in October 2026 β signed, sealed, and slayed by the Kernel API Manual crew πβπ
π¦ 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