READ_LINE_YUV_SEMIPLANAR(9)
π READ_LINE_YUV_SEMIPLANAR π
okay so first things first, bestie: this is from the kernel API manual, section 9 (iykyk), and it's genuinely one of those "macro that writes code for you" situations that sounds scary but is actually kind of iconic once it clicks β¨
It's a generic generator for a read_line function β like, it builds the function for you π«Ά β and it's the one you reach for when you're dealing with yuv formats with two planes where block_w == block_h == 1. No cap, that's the whole vibe check for when this applies.
β¨ SYNOPSIS β¨
READ_LINE_YUV_SEMIPLANAR (function_name , pixel_1_name , pixel_2_name ,
pixel_1_type , pixel_2_type , callback , ... );
literally just pass the args and let the preprocessor do her main character thing π
π ARGUMENTS π
function_nameβ the name of the function you want generated. yeah. it names itself. slay.pixel_1_nameβ a temporary pixel name for the first plane, used inside the__VA_ARGS__parameters π¦pixel_2_nameβ same deal but for the second plane, also used in the__VA_ARGS__parameters πΈpixel_1_typeβ here's where you say what type you want the pixel pointer cast to on plane 1 β¨pixel_2_typeβ and what type to cast the pixel pointer to on plane 2 πcallbackβ the callback that gets called for each pixels. this function should take(struct conversion_matrix*, __VA_ARGS__)as parameter and return apixel_argb_u16π₯...β variable arguments. these are the arguments to pass inside the callback β and you can usepixel_1_nameandpixel_2_nameto access the current pixel values π
the callback contract is lowkey the whole point:(struct conversion_matrix*, __VA_ARGS__)in,pixel_argb_u16out. don't fumble it π
π SEE ALSO π
Kernel file ./drivers/gpu/drm/vkms/vkms_formats.c β that's the home base, go look at her π
And the whole friend group:
packed_pixels_offset(9)packed_pixels_addr(9)get_block_step_bytes(9)packed_pixels_addr_1x1(9)get_subsampling(9)get_subsampling_offset(9)READ_LINE(9)READ_LINE_ARGB8888(9)READ_LINE_le16161616(9)vkms_writeback_row(9)get_pixel_read_line_function(9)swap_uv_columns(9)get_conversion_matrix_to_argb_u16(9)get_pixel_write_function(9)
that's the page, bestie π«Ά this one lives at ./drivers/gpu/drm/vkms, dated October 2026 β go read the source, it ate πβ¨
π¦ 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