drm_color_lut_extract(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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