__set_legacy_tf(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __set_legacy_tf(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so you're in section 9 of the Kernel API Manual and the function we're absolutely obsessing over today is called __set_legacy_tf β€” yes the double underscore is part of the name, it's giving "internal, don't touch unless you know her" πŸ’…


✨ NAME ✨

__set_legacy_tf β€” literally just calculates the legacy transfer function. that's it. that's the whole vibe check. πŸ¦‹


🌸 SYNOPSIS 🌸

int __set_legacy_tf (struct dc_transfer_func *func , const struct
       drm_color_lut *lut , uint32_t lut_size , bool has_rom );

copy it exactly like that, no cap, the line break is canon 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • func β€” the transfer function itself, the main character of this whole operation πŸ‘‘
  • lut β€” the lookup table that defines the color space. she's the blueprint. the blueprint is her. πŸ“
  • lut_size β€” the size of the respective lut, aka how many entries that particular table is serving ✨
  • has_rom β€” a bool that says whether ROM can be used for the hardcoded curve. like, is the built-in backup allowed to show up? πŸ’€

πŸ’– DESCRIPTION πŸ’–

Only for sRGB input space.

that's the entire description and honestly? iconic. short. mysterious. does not elaborate. πŸ™ˆ

real talk though β€” don't just yeet this at any old color space, it's specifically for sRGB input space and that's the rule 🌈

⭐ RETURN ⭐

  • 0 β€” in case of success πŸŽ‰
  • -ENOMEM β€” if it fails 😭 (memory said no)

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c

and the whole friend group:


and that's the page, bestie!! πŸ’œ this one comes to you from ./drivers/gpu/drm/amd/display/... and it's dated October 2026 β€” mark your calendars, the legacy transfer function is not going anywhere πŸ—“οΈβœ¨ periodt

πŸ“¦ where this page comes from