__set_legacy_tf(9)
π __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β aboolthat 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:
overview(9)amdgpu_dm_init_color_mod(9)__extract_blob_lut(9)__extract_blob_lut32(9)__is_lut_linear(9)__drm_lut_to_dc_gamma(9)__drm_lut32_to_dc_gamma(9)__drm_ctm_to_dc_matrix(9)__drm_ctm_3x4_to_dc_matrix(9)__set_output_tf(9)__set_output_tf_32(9)__set_input_tf(9)__set_input_tf_32(9)amdgpu_dm_verify_lut3d_size(9)amdgpu_dm_verify_lut_sizes(9)amdgpu_dm_check_crtc_color_mgmt(9)amdgpu_dm_update_crtc_color_mgmt(9)amdgpu_dm_update_plane_color_mgmt(9)
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
- 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